Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NTR: fix cypress for payconiq
Browse files Browse the repository at this point in the history
Vitalij Mik committed Jul 29, 2024
1 parent f2436dc commit 32d147f
Showing 4 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -91,6 +91,10 @@ context("Checkout Tests", () => {

scenarioDummyBasket.execute();

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

paymentAction.switchPaymentMethod(payment.name);


Original file line number Diff line number Diff line change
@@ -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";
// ------------------------------------------------------


@@ -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();


@@ -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
Original file line number Diff line number Diff line change
@@ -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
@@ -68,6 +68,7 @@ export default class DummyBasketScenario {
}

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

}

0 comments on commit 32d147f

Please sign in to comment.