diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 60b7fe1716..4f54f03fd6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -7,7 +7,7 @@ on: jobs: build-then-e2e: if: ${{ github.actor != 'renovate[bot]' && github.actor != 'lgtm-com[bot]' }} - timeout-minutes: 30 + timeout-minutes: 60 runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/packages/e2e-playwright/tests/a11y/card/errorPanel.avs.spec.ts b/packages/e2e-playwright/tests/a11y/card/errorPanel.avs.spec.ts index 29785ceed8..e2ae5ca566 100644 --- a/packages/e2e-playwright/tests/a11y/card/errorPanel.avs.spec.ts +++ b/packages/e2e-playwright/tests/a11y/card/errorPanel.avs.spec.ts @@ -51,9 +51,9 @@ test('#3 fill out credit card fields & see that first error in error panel is co 'Enter the City-sr' ]; await cardWithAvs.goto(url); - await cardWithAvs.fillCardNumber(REGULAR_TEST_CARD); - await cardWithAvs.fillExpiryDate(TEST_DATE_VALUE); - await cardWithAvs.fillCvc(TEST_CVC_VALUE); + await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); + await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); + await cardWithAvs.typeCvc(TEST_CVC_VALUE); await cardWithAvs.pay(); // Wait for all sr panel messages @@ -105,9 +105,9 @@ test('#5 Switch country to US, fill out credit card fields & see that first erro const expectedSRPanelTexts = ['Enter the Address-sr', 'Enter the City-sr', 'Enter the State-sr', 'Enter the Zip code-sr']; await cardWithAvs.goto(url); - await cardWithAvs.fillCardNumber(REGULAR_TEST_CARD); - await cardWithAvs.fillExpiryDate(TEST_DATE_VALUE); - await cardWithAvs.fillCvc(TEST_CVC_VALUE); + await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); + await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); + await cardWithAvs.typeCvc(TEST_CVC_VALUE); await cardWithAvs.billingAddress.selectCountry({ name: 'United States' }); await cardWithAvs.pay(); // Wait for all sr panel messages @@ -158,9 +158,9 @@ test('#7 Switch country to UK, fill out credit card fields & see that first erro const expectedSRPanelTexts = ['Enter the House number-sr', 'Enter the Street-sr', 'Enter the City / Town-sr', 'Enter the Postal code-sr']; await cardWithAvs.goto(url); - await cardWithAvs.fillCardNumber(REGULAR_TEST_CARD); - await cardWithAvs.fillExpiryDate(TEST_DATE_VALUE); - await cardWithAvs.fillCvc(TEST_CVC_VALUE); + await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); + await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); + await cardWithAvs.typeCvc(TEST_CVC_VALUE); await cardWithAvs.billingAddress.selectCountry({ name: 'United Kingdom' }); await cardWithAvs.pay(); // Wait for all sr panel messages diff --git a/packages/e2e-playwright/tests/e2e/card/avs.spec.ts b/packages/e2e-playwright/tests/e2e/card/avs.spec.ts index 5f75042e96..b238aef282 100644 --- a/packages/e2e-playwright/tests/e2e/card/avs.spec.ts +++ b/packages/e2e-playwright/tests/e2e/card/avs.spec.ts @@ -5,9 +5,9 @@ import { URL_MAP } from '../../../fixtures/URL_MAP'; test.describe('Card payments with address lookup', () => { test('should make a successful card payment', async ({ cardWithAvs }) => { await cardWithAvs.goto(URL_MAP.addressLookupUrl); - await cardWithAvs.fillCardNumber(REGULAR_TEST_CARD); - await cardWithAvs.fillExpiryDate(TEST_DATE_VALUE); - await cardWithAvs.fillCvc(TEST_CVC_VALUE); + await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); + await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); + await cardWithAvs.typeCvc(TEST_CVC_VALUE); await cardWithAvs.billingAddress.searchAddressAndChooseTheFirst('1'); await cardWithAvs.pay(); @@ -20,9 +20,9 @@ test.describe('Card payments with partial avs', () => { test.describe('When fill in a valid the post code', () => { test('should make a successful card payment', async ({ cardWithAvs }) => { await cardWithAvs.goto(URL_MAP.cardWithPartialAvs); - await cardWithAvs.fillCardNumber(REGULAR_TEST_CARD); - await cardWithAvs.fillExpiryDate(TEST_DATE_VALUE); - await cardWithAvs.fillCvc(TEST_CVC_VALUE); + await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); + await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); + await cardWithAvs.typeCvc(TEST_CVC_VALUE); await cardWithAvs.billingAddress.fillInPostCode(TEST_POSTCODE); await cardWithAvs.pay(); await cardWithAvs.paymentResult.waitFor({ state: 'visible' }); @@ -33,9 +33,9 @@ test.describe('Card payments with partial avs', () => { test.describe('When not fill in a post code ', () => { test('should not submit the payment', async ({ cardWithAvs }) => { await cardWithAvs.goto(URL_MAP.cardWithPartialAvs); - await cardWithAvs.fillCardNumber(REGULAR_TEST_CARD); - await cardWithAvs.fillExpiryDate(TEST_DATE_VALUE); - await cardWithAvs.fillCvc(TEST_CVC_VALUE); + await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); + await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); + await cardWithAvs.typeCvc(TEST_CVC_VALUE); await cardWithAvs.pay(); await expect(cardWithAvs.billingAddress.postalCodeError).toContainText('Enter the zip code'); }); @@ -46,9 +46,9 @@ test.describe('Card payments with full avs', () => { test.describe('When fill in the valid address data', () => { test('should make a successful card payment', async ({ cardWithAvs }) => { await cardWithAvs.goto(URL_MAP.fullAvsWithoutPrefilledDataUrl); - await cardWithAvs.fillCardNumber(REGULAR_TEST_CARD); - await cardWithAvs.fillExpiryDate(TEST_DATE_VALUE); - await cardWithAvs.fillCvc(TEST_CVC_VALUE); + await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); + await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); + await cardWithAvs.typeCvc(TEST_CVC_VALUE); await cardWithAvs.billingAddress.selectCountry({ name: 'United States' }); await cardWithAvs.billingAddress.fillInStreet('Test address'); @@ -64,9 +64,9 @@ test.describe('Card payments with full avs', () => { test.describe('When fill in the invalid address data', () => { test('should not submit the payment', async ({ cardWithAvs }) => { await cardWithAvs.goto(URL_MAP.fullAvsWithoutPrefilledDataUrl); - await cardWithAvs.fillCardNumber(REGULAR_TEST_CARD); - await cardWithAvs.fillExpiryDate(TEST_DATE_VALUE); - await cardWithAvs.fillCvc(TEST_CVC_VALUE); + await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); + await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); + await cardWithAvs.typeCvc(TEST_CVC_VALUE); await cardWithAvs.billingAddress.selectCountry({ name: 'United States' }); await cardWithAvs.pay(); @@ -84,9 +84,9 @@ test.describe('Card payments with full avs', () => { await cardWithAvs.goto(url); await expect(cardWithAvs.billingAddress.postalCodeError).toContainText('Invalid format. Expected format'); await cardWithAvs.billingAddress.selectCountry({ name: 'Japan' }); - await cardWithAvs.fillCardNumber(REGULAR_TEST_CARD); - await cardWithAvs.fillExpiryDate(TEST_DATE_VALUE); - await cardWithAvs.fillCvc(TEST_CVC_VALUE); + await cardWithAvs.typeCardNumber(REGULAR_TEST_CARD); + await cardWithAvs.typeExpiryDate(TEST_DATE_VALUE); + await cardWithAvs.typeCvc(TEST_CVC_VALUE); await cardWithAvs.pay(); await cardWithAvs.paymentResult.waitFor({ state: 'visible' }); await expect(cardWithAvs.paymentResult).toContainText(PAYMENT_RESULT.authorised); diff --git a/packages/e2e-playwright/tests/ui/card/expiryDate/card.expiryDatePolicies.hidden.spec.ts b/packages/e2e-playwright/tests/ui/card/expiryDate/card.expiryDatePolicies.hidden.spec.ts index 68a1ba48a7..5be078c541 100644 --- a/packages/e2e-playwright/tests/ui/card/expiryDate/card.expiryDatePolicies.hidden.spec.ts +++ b/packages/e2e-playwright/tests/ui/card/expiryDate/card.expiryDatePolicies.hidden.spec.ts @@ -4,7 +4,7 @@ import { ENCRYPTED_CARD_NUMBER, ENCRYPTED_EXPIRY_DATE, ENCRYPTED_SECURITY_CODE, - SYNCHRONY_PLCC_NO_DATE, + PLCC_NO_LUHN_NO_DATE, TEST_CVC_VALUE } from '../../../utils/constants'; import { getStoryUrl } from '../../../utils/getStoryUrl'; @@ -22,7 +22,7 @@ test.describe('Test how Card Component handles hidden expiryDate policy', () => await card.goto(url); // Fill number to provoke binLookup response - await card.typeCardNumber(SYNCHRONY_PLCC_NO_DATE); + await card.typeCardNumber(PLCC_NO_LUHN_NO_DATE); // UI reflects that binLookup says expiryDate is hidden await expect(card.expiryDateField).not.toBeVisible(); @@ -66,7 +66,7 @@ test.describe('Test how Card Component handles hidden expiryDate policy', () => await expect(cardErrors[ENCRYPTED_SECURITY_CODE]).not.toBe(undefined); // Fill number to provoke binLookup response - await card.typeCardNumber(SYNCHRONY_PLCC_NO_DATE); + await card.typeCardNumber(PLCC_NO_LUHN_NO_DATE); // Headless test seems to need time for UI reset to register on state await page.waitForTimeout(500); @@ -95,7 +95,7 @@ test.describe('Test how Card Component handles hidden expiryDate policy', () => await card.cardNumberLabelElement.click(); // Fill number to provoke binLookup response - await card.typeCardNumber(SYNCHRONY_PLCC_NO_DATE); + await card.typeCardNumber(PLCC_NO_LUHN_NO_DATE); // UI reflects that binLookup says expiryDate is hidden await expect(card.expiryDateField).not.toBeVisible(); diff --git a/packages/e2e-playwright/tests/ui/customCard/branding/customcard.plcc.luhn.spec.ts b/packages/e2e-playwright/tests/ui/customCard/branding/customcard.plcc.luhn.spec.ts index 95ddb547b6..e949956e1c 100644 --- a/packages/e2e-playwright/tests/ui/customCard/branding/customcard.plcc.luhn.spec.ts +++ b/packages/e2e-playwright/tests/ui/customCard/branding/customcard.plcc.luhn.spec.ts @@ -26,7 +26,7 @@ test.describe('Testing PLCCs, in the custom card component)', () => { // await t.expect(getPropFromStateValid('encryptedCardNumber')).eql(true); // // // Enter bin that needs luhn check but replace last digit to one that will mean number fails luhn check - // const partialNum = SYNCHRONY_PLCC_WITH_LUHN.substr(0, 15); + // const partialNum = PLCC_WITH_LUHN_NO_DATE.substr(0, 15); // await cardUtilsRegular.fillCardNumber(t, partialNum + '8', 'replace'); // // // num is not valid @@ -36,7 +36,7 @@ test.describe('Testing PLCCs, in the custom card component)', () => { // cardUtilsRegular.deleteDigitsFromCardNumber(t, 18, 19); // // // now enter correct last digit - // const endNum = SYNCHRONY_PLCC_WITH_LUHN.substr(15, 16); + // const endNum = PLCC_WITH_LUHN_NO_DATE.substr(15, 16); // await cardUtilsRegular.fillCardNumber(t, endNum); // // // num is valid w. luhn check @@ -54,7 +54,7 @@ test.describe('Testing PLCCs, in the custom card component)', () => { // await start(t, 2000, TEST_SPEED); // // // Enter num - // await cardUtilsRegular.fillCardNumber(t, SYNCHRONY_PLCC_WITH_LUHN); + // await cardUtilsRegular.fillCardNumber(t, PLCC_WITH_LUHN_NO_DATE); // // num is valid // await t.expect(getPropFromStateValid('encryptedCardNumber')).eql(true); // @@ -64,7 +64,7 @@ test.describe('Testing PLCCs, in the custom card component)', () => { // await t.expect(getPropFromStateValid('encryptedCardNumber')).eql(true); // // // Enter bin that needs luhn check but replace last digit to one that will mean number fails luhn check - // const partialNum = SYNCHRONY_PLCC_WITH_LUHN.substr(0, 15); + // const partialNum = PLCC_WITH_LUHN_NO_DATE.substr(0, 15); // await cardUtilsRegular.fillCardNumber(t, partialNum + '8', 'paste'); // // num is not valid // await t.expect(getPropFromStateValid('encryptedCardNumber')).eql(false); @@ -73,7 +73,7 @@ test.describe('Testing PLCCs, in the custom card component)', () => { // cardUtilsRegular.deleteDigitsFromCardNumber(t, 18, 19); // // // now enter correct last digit - // const endNum = SYNCHRONY_PLCC_WITH_LUHN.substr(15, 16); + // const endNum = PLCC_WITH_LUHN_NO_DATE.substr(15, 16); // await cardUtilsRegular.fillCardNumber(t, endNum); // // // num is valid w. luhn check diff --git a/packages/e2e-playwright/tsconfig.json b/packages/e2e-playwright/tsconfig.json index 2ed524f97f..9152cb06e4 100644 --- a/packages/e2e-playwright/tsconfig.json +++ b/packages/e2e-playwright/tsconfig.json @@ -26,6 +26,6 @@ /* Include types for the browser: window, document, etc */ "lib": ["es2022", "dom", "dom.iterable"] }, - "include": ["app/", "tests/", "mocks/", "models/", "pages/"], + "include": ["tests/", "mocks/", "models/"], "exclude": ["node_modules"] }