Skip to content

Commit

Permalink
chore: removed SFRA e2e tests (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
zenit2001 authored Jan 11, 2024
1 parent dd5a669 commit e5e0364
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 726 deletions.
6 changes: 0 additions & 6 deletions tests/playwright/data/cardData.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,4 @@ export class CardData {
expirationDate: '0330',
cvc: '',
};

giftCard = {
cardNumber : '6036280000000000000',
pin : '123',
brand : 'givex'
}
}
22 changes: 0 additions & 22 deletions tests/playwright/data/environments.mjs
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
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') {
environments.push(
{
name: 'SFRA v5.3.0',
CheckoutPage: CheckoutPageSFRA5,
urlExtension: '/s/RefArch/home',
AccountPage: AccountPageSFRA,
}
);
}

if (process.env.SFRA_VERSION === 'v6.1.0') {
environments.push({
name: 'SFRA v6.1.0',
CheckoutPage: CheckoutPageSFRA6,
urlExtension: '/s/RefArch/home',
AccountPage: AccountPageSFRA,
});
}

if (!process.env.SFRA_VERSION) {
environments.push({
Expand Down
2 changes: 0 additions & 2 deletions tests/playwright/fixtures/SEK.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ for (const environment of environments) {

if (environment.name === 'SG') await checkoutPage.setEmail();
await pendingPaymentsPage.doQRCodePayment('swish', environment.name);
if (environment.name.includes('SFRA'))
await checkoutPage.completeCheckout();
await checkoutPage.expectQRcode();
});

Expand Down
60 changes: 0 additions & 60 deletions tests/playwright/fixtures/USD.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ for (const environment of environments) {
// Skipping SG due to CSRF token validation

await cards.doCardPayment(cardData.threeDs1);
// SFRA 6 email setting flow is different
if (environment.name.indexOf('v6') === -1) {
await checkoutPage.setEmail();
}
await checkoutPage.submitPayment();
const checkoutURL = await checkoutPage.getLocation();
await checkoutPage.placeOrder();
Expand Down Expand Up @@ -144,67 +140,11 @@ for (const environment of environments) {

test('PayPal Success @quick', async ({ page }) => {
redirectShopper = new RedirectShopper(page);

// SFRA 6 email setting flow is different
if (environment.name.indexOf('v6') === -1) {
await checkoutPage.setEmail();
}
await redirectShopper.doPayPalPayment();
await checkoutPage.expectSuccess();
});
});

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 () => {
await goToBillingWithFullCartGuestUser();
if (environment.name.indexOf('v6') === -1) {
await checkoutPage.setEmail();
}
await cards.doGiftCardPayment(cardData.giftCard);
await checkoutPage.placeOrder();
await checkoutPage.expectSuccess();
});

test('GiftCard & Card Success', async () => {
await goToBillingWithFullCartGuestUser(3);
await cards.doGiftCardPayment(cardData.giftCard);
await cards.doCardPayment(cardData.noThreeDs);
await checkoutPage.completeCheckout();
await checkoutPage.expectSuccess();
});

test('Remove Gift Card', async ({ page }) => {
await goToBillingWithFullCartGuestUser(3);
await cards.doGiftCardPayment(cardData.giftCard);
await page.locator('.gift-card-action').click();
await cards.doCardPayment(cardData.noThreeDs);
await checkoutPage.completeCheckout();
await checkoutPage.expectSuccess();
});

test('Gift Card Fail', async ({ page, locale }) => {
await goToBillingWithFullCartGuestUser(3);
await cards.doGiftCardPayment(cardData.giftCard);
await page.goto(`/s/RefArch/25720033M.html?lang=${locale}`);
await page.locator('.add-to-cart').click();
await checkoutPage.navigateToCheckout(regionsEnum.US);
if (environment.name.indexOf('v6') === -1){
await checkoutPage.checkoutGuest.click();
}
await checkoutPage.submitShipping();
await checkoutPage.expectGiftCardWarning();
});
}
});

test.describe.parallel(`${environment.name} USD`, () => {
test.beforeEach(async ({ page }) => {
checkoutPage = new environment.CheckoutPage(page);
Expand Down
8 changes: 0 additions & 8 deletions tests/playwright/fixtures/countriesEUR/NL.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ for (const environment of environments) {

redirectShopper = new RedirectShopper(page);
await redirectShopper.doIdealPayment(true);
// SFRA 6 email setting flow is different
if (environment.name.indexOf("v6") === -1) {
await checkoutPage.setEmail();
}
await checkoutPage.submitPayment();
const checkoutURL = await checkoutPage.getLocation();
await checkoutPage.placeOrder()
Expand Down Expand Up @@ -87,10 +83,6 @@ for (const environment of environments) {

test('Google Pay Success', async ({ page }) => {
pendingPayments = new PendingPayments(page);
// SFRA 6 email setting flow is different
if (environment.name.indexOf("v6") === -1) {
await checkoutPage.setEmail();
}
await pendingPayments.doGooglePayPayment();
});
});
Expand Down
5 changes: 0 additions & 5 deletions tests/playwright/fixtures/countriesEUR/PT.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ for (const environment of environments) {
even if it's written */
test.fixme('MBWay Success', async ({ page }) => {
pendingPayments = new PendingPayments(page);

// SFRA 6 email setting flow is different
if (environment.name.indexOf("v6") === -1) {
await checkoutPage.setEmail();
}
await pendingPayments.doMBWayPayment();
await checkoutPage.completeCheckout();

Expand Down
77 changes: 0 additions & 77 deletions tests/playwright/pages/AccountPageSFRA.mjs

This file was deleted.

Loading

0 comments on commit e5e0364

Please sign in to comment.