Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
michielgerritsen committed Feb 10, 2025
1 parent 16fd3c0 commit bdc8abf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Test/End-2-end/cypress/e2e/magento/methods/swish.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ if (Cypress.env('mollie_available_methods').includes('swish')) {
{status: 'canceled', orderStatus: 'Canceled', title: 'C4235814: Validate the submission of an order with Swish as payment method and payment mark as "Canceled"'},
].forEach((testCase) => {
it(testCase.title, () => {
visitCheckoutPayment.visit();
visitCheckoutPayment.changeCurrencyTo('SEK');
visitCheckoutPayment.visit('SE');

cy.intercept('mollie/checkout/redirect/paymentToken/*').as('mollieRedirect');

Expand Down
16 changes: 16 additions & 0 deletions Test/End-2-end/cypress/fixtures/swedish-shipping-address.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": {
"username": "[email protected]",
"firstname": "Jean",
"company": "Exempel AB",
"lastname": "Dupont",
"street[0]": "Exempelgatan 1",
"city": "Stockholm",
"postcode": "111 22",
"telephone": "+46 8 XXXXXXXX"
},
"select": {
"country_id": "SE",
"region_id": "Blekinge län"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export default class VisitCheckoutPaymentCompositeAction {
return;
}

if (fixture === 'SE') {
checkoutShippingPage.fillSwedishShippingAddress();
return;
}

checkoutShippingPage.fillShippingAddressUsingFixture(fixture);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export default class CheckoutShippingPage {
});
}

fillSwedishShippingAddress() {
cy.fixture('swedish-shipping-address').then((address) => {
this.fillShippingAddress(address);
});
}

fillShippingAddressUsingFixture(fixture) {
cy.fixture(fixture).then((address) => {
this.fillShippingAddress(address);
Expand Down

0 comments on commit bdc8abf

Please sign in to comment.