Skip to content

Commit

Permalink
NTR: fix cypress for payconiq (#794)
Browse files Browse the repository at this point in the history
Co-authored-by: Vitalij Mik <[email protected]>
  • Loading branch information
BlackScorp and Vitalij Mik authored Jul 29, 2024
1 parent 8b3253b commit 5668b08
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ context("Checkout Tests", () => {

scenarioDummyBasket.execute();

if(payment.key === 'payconiq'){
checkout.changeBillingCountry('Belgium');
}

paymentAction.switchPaymentMethod(payment.name);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Session from "Services/utils/Session"
// ------------------------------------------------------
import PaymentAction from "Actions/storefront/checkout/PaymentAction";
import DummyBasketScenario from "Scenarios/DummyBasketScenario";
import CheckoutAction from "Actions/storefront/checkout/CheckoutAction";
// ------------------------------------------------------


Expand All @@ -11,7 +12,7 @@ const session = new Session();

const paymentAction = new PaymentAction();
const scenarioDummyBasket = new DummyBasketScenario(1);

const checkout = new CheckoutAction();
const device = devices.getFirstDevice();


Expand All @@ -31,7 +32,7 @@ describe('Payconiq', () => {
it('C3362896: Payconiq is existing in checkout', () => {

scenarioDummyBasket.execute();

checkout.changeBillingCountry('Belgium');
paymentAction.switchPaymentMethod('Payconiq');

// payment would only work using currency CHF which cannot be done at the moment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,13 @@ export default class CheckoutAction {
cy.get('.header-minimal-back-to-shop > .btn').click();
}

changeBillingCountry(billingCountry){

cy.get('.confirm-shipping-address a[data-address-editor]').click();
cy.wait(2000);
cy.get('.address-editor-edit').click();
cy.wait(1000);
cy.get('select#shipping-addressAddressCountry.country-select').eq(0).select(billingCountry);
cy.get('.address-form-actions button').eq(0).click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default class DummyBasketScenario {
}

checkout.goToCheckoutInOffCanvas();
checkout.changeBillingCountry('Germany');
}

}

0 comments on commit 5668b08

Please sign in to comment.