Skip to content

Commit

Permalink
feat: enabling new web component version, with new upi flow and e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
zenit2001 committed Oct 4, 2024
1 parent 8f764d9 commit 130706d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,7 @@ function getGiftCardConfig() {
}

function handleOnChange(state) {
let { type } = state.data.paymentMethod;
const multipleTxVariantComponents = constants.MULTIPLE_TX_VARIANTS_COMPONENTS;
if (multipleTxVariantComponents.includes(store.selectedMethod)) {
type = store.selectedMethod;
}
const { type } = state.data.paymentMethod;
store.isValid = state.isValid;
if (!store.componentsObj[type]) {
store.componentsObj[type] = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ module.exports = {
'amazonpay',
'applepay',
'cashapp',
'upi',
],
MULTIPLE_TX_VARIANTS_COMPONENTS: ['upi'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {
PAYPAL: 'paypal',
},

CAN_SKIP_SUMMARY_PAGE: ['applepay', 'cashapp'],
CAN_SKIP_SUMMARY_PAGE: ['applepay', 'cashapp', 'upi'],

SERVICE: {
PAYMENT: 'AdyenPayment',
Expand Down Expand Up @@ -100,6 +100,6 @@ module.exports = {
APPLE_DOMAIN_URL:
'/.well-known/apple-developer-merchantid-domain-association',

CHECKOUT_COMPONENT_VERSION: '5.65.0',
CHECKOUT_COMPONENT_VERSION: '5.68.0',
VERSION: '24.4.0',
};
3 changes: 0 additions & 3 deletions tests/playwright/fixtures/INR.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,18 @@ for (const environment of environments) {
test('UPI Success', async ({ page }) => {
redirectShopper = new RedirectShopper(page);
await redirectShopper.doUPIPayment('upi_collect');
await checkoutPage.completeCheckout();
await checkoutPage.isPaymentModalShown("upi_collect");
});

test('UPI Failure', async ({ page }) => {
redirectShopper = new RedirectShopper(page);
await redirectShopper.doUPIPayment('upi_collect', false);
await checkoutPage.completeCheckout();
await checkoutPage.expectRefusal();
});

test('UPI QR Success @quick', async ({ page }) => {
redirectShopper = new RedirectShopper(page);
await redirectShopper.doUPIPayment('upi_qr');
await checkoutPage.completeCheckout();
await checkoutPage.isPaymentModalShown("Scan QR code");
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/playwright/pages/CheckoutPageSFRA5.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default class CheckoutPageSFRA5 {
this.passwordField = page.locator('#login-form-password');
this.loginButton = page.locator('.login button[type="submit"]');

this.paymentModal = page.locator("#action-modal #adyenModalDialog");
this.paymentModal = page.locator(".additionalFields");

this.donationAmountButton = page.locator('.adyen-checkout__button').nth(0);
this.donationButton = page.locator('.adyen-checkout__button--donate');
Expand Down
2 changes: 1 addition & 1 deletion tests/playwright/pages/CheckoutPageSFRA6.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class CheckoutPageSFRA {
this.passwordField = page.locator('#login-form-password');
this.loginButton = page.locator('.login button[type="submit"]');

this.paymentModal = page.locator("#action-modal #adyenModalDialog");
this.paymentModal = page.locator(".additionalFields");

this.donationAmountButton = page.locator('.adyen-checkout__button').nth(0);
this.donationButton = page.locator('.adyen-checkout__button--donate');
Expand Down
2 changes: 2 additions & 0 deletions tests/playwright/pages/PaymentMethodsPage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export default class PaymentMethodsPage {
};

initiateUPIPayment = async (paymentMethod, success = true) => {
const continueButton = this.page.locator(".adyen-checkout__button--pay");
await this.page.locator(`#rb_upi`).click();
if (paymentMethod == "upi_collect") {
await this.page.locator("#upi-button-vpa").click();
Expand All @@ -179,6 +180,7 @@ export default class PaymentMethodsPage {
if (paymentMethod == "upi_qr") {
await this.page.locator("#upi-button-qrCode").click();
}
await continueButton.click();
};


Expand Down
2 changes: 1 addition & 1 deletion tests/playwright/paymentFlows/redirectShopper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class RedirectShopper {
await this.page.fill('input[name="dateOfBirth"]', '1980-01-11');
await this.page.fill('input[name="shopperEmail"]', email);
// There is no static locator to click the checkbox
await this.page.locator('label:has-text("Ich stimme den")').click();
await this.page.locator('label:has-text("Ich bin mit")').click();
};

completeGiropayRedirect = async (success) => {
Expand Down

0 comments on commit 130706d

Please sign in to comment.