Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maintenance] E2E tests #1017

Merged
merged 9 commits into from
Nov 29, 2023
4 changes: 2 additions & 2 deletions .github/workflows/E2E_SFRA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
run: npx playwright install --with-deps
- name: run e2e tests full coverage
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
if: github.event.pull_request.base.ref == 'main' || github.event.pull_request.base.ref == 'develop'
if: github.event.pull_request.base.ref == 'main'
run: npm run test:ci
env:
SANDBOX_HTTP_AUTH_USERNAME: ${{ secrets.SANDBOX_HTTP_AUTH_USERNAME }}
Expand All @@ -110,7 +110,7 @@ jobs:
SFCC_HOSTNAME: ${{ secrets[matrix.sfcc-hostname-secret] }}
- name: run e2e tests quick coverage
working-directory: adyen-salesforce-commerce-cloud/tests/playwright/
if: github.event.pull_request.base.ref != 'main' && github.event.pull_request.base.ref != 'develop'
if: github.event.pull_request.base.ref != 'main'
run: npm run test:ci:quick
env:
SANDBOX_HTTP_AUTH_USERNAME: ${{ secrets.SANDBOX_HTTP_AUTH_USERNAME }}
Expand Down
112 changes: 0 additions & 112 deletions .github/workflows/E2E_SG.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ dw.json
/coverage/
screenshots/
playwright-report/
test-results/
Vagrantfile
10 changes: 0 additions & 10 deletions tests/playwright/data/environments.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import CheckoutPageSFRA5 from '../pages/CheckoutPageSFRA5.mjs';
import CheckoutPageSFRA6 from '../pages/CheckoutPageSFRA6.mjs';
import CheckoutPageSG from '../pages/CheckoutPageSG.mjs';
import AccountPageSFRA from '../pages/AccountPageSFRA.mjs';
import AccountPageSG from '../pages/AccountPageSG.mjs';

export const environments = [];
if (process.env.SFRA_VERSION === 'v5.3.0') {
Expand All @@ -25,12 +23,4 @@ if (process.env.SFRA_VERSION === 'v6.1.0') {
});
}

if (!process.env.SFRA_VERSION) {
environments.push({
name: 'SG',
CheckoutPage: CheckoutPageSG,
urlExtension: '/on/demandware.store/Sites-SiteGenesis-Site',
AccountPage: AccountPageSG,
},);
}

2 changes: 1 addition & 1 deletion tests/playwright/fixtures/BRL.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ for (const environment of environments) {
};
});

test('Card payment 3DS2 installments success', async () => {
test('Card payment 3DS2 installments success @quick', async () => {
await cards.doCardPaymentInstallments(cardData.threeDs2, 4);
await checkoutPage.completeCheckout();
await cards.do3Ds2Verification();
Expand Down
2 changes: 1 addition & 1 deletion tests/playwright/fixtures/INR.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for (const environment of environments) {
await checkoutPage.expectRefusal();
});

test('UPI QR Success', async ({ page }) => {
test('UPI QR Success @quick', async ({ page }) => {
redirectShopper = new RedirectShopper(page);
await redirectShopper.doUPIPayment('upi_qr');
await checkoutPage.completeCheckout();
Expand Down
1 change: 0 additions & 1 deletion tests/playwright/fixtures/SEK.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ for (const environment of environments) {
test('Swish success', async ({ page }) => {
pendingPaymentsPage = new PendingPayments(page);

if (environment.name === 'SG') await checkoutPage.setEmail();
await pendingPaymentsPage.doQRCodePayment('swish', environment.name);
if (environment.name.includes('SFRA'))
await checkoutPage.completeCheckout();
Expand Down
30 changes: 13 additions & 17 deletions tests/playwright/fixtures/USD.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { RedirectShopper } from '../paymentFlows/redirectShopper.mjs';
import { Cards } from '../paymentFlows/cards.mjs';
import { ShopperData } from '../data/shopperData.mjs';
import { CardData } from '../data/cardData.mjs';
import PaymentMethodsPage from '../pages/PaymentMethodsPage.mjs';

const shopperData = new ShopperData();
const cardData = new CardData();
Expand Down Expand Up @@ -48,8 +49,6 @@ for (const environment of environments) {
});

test('Card payment no 3DS failure @quick', async () => {
if (environment.name === 'SG') test.fixme();

const cardDataInvalid = Object.assign({}, cardData.noThreeDs);
cardDataInvalid.expirationDate = '0150';
await cards.doCardPayment(cardDataInvalid);
Expand Down Expand Up @@ -87,15 +86,14 @@ for (const environment of environments) {
});

test.describe.parallel(`${environment.name} USD`, () => {
if (environment.name != 'SG') {
test.beforeEach(async ({ page }) => {
checkoutPage = new environment.CheckoutPage(page);
accountPage = new environment.AccountPage(page);
cards = new Cards(page);
await page.goto(`${environment.urlExtension}`);
});

test('GiftCard Only Success', async () => {
test('GiftCard Only Success @quick', async () => {
await goToBillingWithFullCartGuestUser();
if (environment.name.indexOf("v6") === -1) {
await checkoutPage.setEmail();
Expand All @@ -105,7 +103,7 @@ for (const environment of environments) {
await checkoutPage.expectSuccess();
});

test('GiftCard & Card Success', async () => {
test('GiftCard & Card Success @quick', async () => {
await goToBillingWithFullCartGuestUser(3);
if (environment.name.indexOf("v6") === -1) {
await checkoutPage.setEmail();
Expand Down Expand Up @@ -143,7 +141,6 @@ for (const environment of environments) {
await checkoutPage.submitShipping();
await checkoutPage.expectGiftCardWarning();
});
}
});

test.describe.parallel(`${environment.name} USD`, () => {
Expand All @@ -166,6 +163,13 @@ for (const environment of environments) {
await redirectShopper.completeAffirmRedirect(false);
await checkoutPage.expectRefusal();
});

test('CashApp Renders', async ({ page }) => {
if (environment.name.indexOf("v6") === -1) {
await checkoutPage.setEmail();
};
await new PaymentMethodsPage(page).initiateCashAppPayment();
});
});

test.describe(`${environment.name} USD Card logged in user `, () => {
Expand All @@ -181,18 +185,14 @@ for (const environment of environments) {
};
});

test('3DS2 oneClick test success', async () => {
if (environment.name === 'SG') test.fixme();

test('3DS2 oneClick test success @quick', async () => {
await cards.doCardPaymentOneclick(cardData.threeDs2);
await checkoutPage.completeCheckoutLoggedInUser();
await cards.do3Ds2Verification();
await checkoutPage.expectSuccess();
});

test('3DS2 oneClick test failure', async () => {
if (environment.name === 'SG') test.fixme();

const cardDataInvalid = Object.assign({}, cardData.threeDs2);
cardDataInvalid.cvc = '123';
await cards.doCardPaymentOneclick(cardDataInvalid);
Expand All @@ -202,8 +202,6 @@ for (const environment of environments) {
});

test('co-branded BCMC/Maestro oneClick test success', async () => {
if (environment.name === 'SG') test.fixme();

await cards.doCardPaymentOneclick(cardData.coBrandedBCMC);
await checkoutPage.completeCheckoutLoggedInUser();
await checkoutPage.expectSuccess();
Expand All @@ -222,7 +220,7 @@ for (const environment of environments) {
await checkoutPage.loginUser(shopperData.USAccountTestUser);
});

test('my account add card no 3DS success', async () => {
test('my account add card no 3DS success @quick', async () => {
await accountPage.addCard(cardData.noThreeDs);
await accountPage.expectSuccess(cardData.noThreeDs);
await accountPage.removeCard(cardData.noThreeDs);
Expand All @@ -236,10 +234,8 @@ for (const environment of environments) {
await accountPage.expectFailure();
});

test('my account add card 3DS2 success', async () => {
if (environment.name === 'SG') test.fixme();
test('my account add card 3DS2 success @quick', async () => {
await accountPage.addCard(cardData.threeDs2);

await cards.do3Ds2Verification();
await accountPage.expectSuccess(cardData.threeDs2);
await accountPage.removeCard(cardData.threeDs2);
Expand Down
8 changes: 3 additions & 5 deletions tests/playwright/fixtures/countriesEUR/BE.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,16 @@ for (const environment of environments) {
await checkoutPage.setEmail();
};
});
test('bcmc mobile renders', async ({ page }) => {
test('bcmc mobile renders @quick', async ({ page }) => {
pendingPayments = new PendingPayments(page);
if (environment.name === 'SG') await checkoutPage.setEmail();
await pendingPayments.doQRCodePayment('bcmc_mobile', environment.name);
if (environment.name != 'SG') await checkoutPage.completeCheckout();
await checkoutPage.completeCheckout();
await checkoutPage.expectQRcode();
});
test('bcmc mobile cancellation flow', async ({ page }) => {
pendingPayments = new PendingPayments(page);
if (environment.name === 'SG') await checkoutPage.setEmail();
await pendingPayments.doQRCodePayment('bcmc_mobile', environment.name);
if (environment.name != 'SG') await checkoutPage.completeCheckout();
await checkoutPage.completeCheckout();
await pendingPayments.cancelQRCodePayment();
});

Expand Down
7 changes: 4 additions & 3 deletions tests/playwright/fixtures/countriesEUR/FR.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test.describe.parallel(`${environment.name} EUR FR`, () => {
cards = new Cards(page);
});

test('No 3DS Amazon Pay', async ({ page }) => {
test('No 3DS Amazon Pay @quick', async ({ page }) => {
await checkoutPage.goToCheckoutPageWithFullCart(regionsEnum.EU);
await checkoutPage.setShopperDetails(shopperData.FR);
if (environment.name.indexOf('v6') === -1) {
Expand All @@ -77,12 +77,13 @@ test.describe.parallel(`${environment.name} EUR FR`, () => {
await checkoutPage.expectSuccess();
});

test('Amazon Pay Express', async ({ page }) => {
test('Amazon Pay Express @quick', async ({ page }) => {
redirectShopper = new RedirectShopper(page);
await checkoutPage.addProductToCart();
await checkoutPage.navigateToCart(regionsEnum.EU);
await redirectShopper.doAmazonPayment(false);
await redirectShopper.doAmazonExpressPayment();
const result = await redirectShopper.doAmazonExpressPayment();
if(result != true){test.skip()};
await checkoutPage.expectSuccess();
});

Expand Down
5 changes: 1 addition & 4 deletions tests/playwright/fixtures/countriesEUR/NL.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ for (const environment of environments) {
redirectShopper = new RedirectShopper(page);
await redirectShopper.doIdealPayment(true);
await checkoutPage.completeCheckout();
environment.name != 'SG' ? await checkoutPage.goBackAndSubmitShipping()
: await checkoutPage.goBack();
await checkoutPage.goBackAndSubmitShipping()
await redirectShopper.doIdealPayment(true);
await checkoutPage.submitPayment();
await checkoutPage.placeOrder();
Expand Down Expand Up @@ -65,8 +64,6 @@ for (const environment of environments) {
};
});
test('iDeal with restored cart Fail', async ({ page, context }) => {
if (environment.name === 'SG') test.skip();
// Skipping SG due to CSRF token validation
redirectShopper = new RedirectShopper(page);
await redirectShopper.doIdealPayment(true);
await checkoutPage.submitPayment();
Expand Down
Loading
Loading