Skip to content

Commit

Permalink
Merge pull request #1126 from erikacolette29/feature/DTCRCMERC-3458-a…
Browse files Browse the repository at this point in the history
…ll-modals

feat: all modal tests (DTCRCMERC-3458)
  • Loading branch information
perco12 authored Sep 19, 2024
2 parents a40a76c + e1f5400 commit 93aa376
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 7 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest

strategy:
matrix:
countries: [AU, DE, GB, FR, IT, ES, US]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -23,12 +28,14 @@ jobs:
run: |
./.github/scripts/runServerV2.sh
- name: Run Playwright Modals
run: npx playwright test tests/playwright/tests/sdk/modals
continue-on-error: true
run: npx playwright test tests/playwright/tests/sdk/modals --grep @${{matrix.countries}} --output=playwright-report-${{matrix.countries}}
- name: Run Playwright Messages
run: npx playwright test tests/playwright/tests/sdk/messages
continue-on-error: true
run: npx playwright test tests/playwright/tests/sdk/messages --grep @${{matrix.countries}} --output=playwright-report-${{matrix.countries}}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
name: playwright-report-${{matrix.countries}}
path: playwright-report/
retention-days: 30
8 changes: 8 additions & 0 deletions tests/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,11 @@ npx playwright codegen
--debug

<!-- opens codegen debug tool -->

npx playwright test --grep @smoke
<!-- run with only certain tag name -->

npx playwright test --grep-invert @regression
<!-- If you want to run tests excluding a specific tag, use --grep-invert: -->


14 changes: 13 additions & 1 deletion tests/playwright/tests/sdk/modals/longTerm.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { modalTest } from '../../../pages/modals_fixture';

modalTest.describe('Long Term Modals', () => {
modalTest.describe('@US Long Term Modals', () => {
modalTest('US Modal long term non qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_US_LONG_TERM', amount: 20001, offer: 'PAY_LATER_LONG_TERM' });
const modalIframe = await loadModal();
Expand All @@ -27,3 +27,15 @@ modalTest.describe('Long Term Modals', () => {
await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
modalTest.describe('@DE Long Term Modals', () => {
modalTest('DE Modal LONG TERM Q', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_LONG_TERM', amount: 500, offer: 'PAY_LATER_LONG_TERM' });
const modalIframe = await loadModal();
await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
modalTest('DE Modal LONG TERM NQ', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_LONG_TERM', amount: 50, offer: 'PAY_LATER_LONG_TERM' });
const modalIframe = await loadModal();
await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
14 changes: 13 additions & 1 deletion tests/playwright/tests/sdk/modals/multi.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { modalTest } from '../../../pages/modals_fixture';

modalTest.describe('Multi Modals', () => {
modalTest.describe('@US Multi Modals', () => {
modalTest('US Modal long term non qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_US_MULTI', amount: 20001, offer: 'PAY_LATER_LONG_TERM' });
const modalIframe = await loadModal();
Expand Down Expand Up @@ -31,3 +31,15 @@ modalTest.describe('Multi Modals', () => {
await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
modalTest.describe('@DE Multi Modals', () => {
modalTest('DE Modal PRODUCT LIST', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_MULTI', amount: 200, offer: '' });
const modalIframe = await loadModal();
await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
modalTest('DE Modal PAY IN ONE', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_MULTI', amount: 200, offer: 'PAY_LATER_PAY_IN_1' });
const modalIframe = await loadModal();
await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
77 changes: 75 additions & 2 deletions tests/playwright/tests/sdk/modals/shortTerm.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { modalTest } from '../../../pages/modals_fixture';

modalTest.describe('Short Term', () => {
modalTest.describe('@US Short Term', () => {
modalTest('US Modal short term non qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_US_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });
const modalIframe = await loadModal();
Expand All @@ -18,12 +18,85 @@ modalTest.describe('Short Term', () => {
const modalIframe = await loadModal();
await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
modalTest.describe('@AU Short Term', () => {
// Test out differnt countries
modalTest('AU Modal', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
modalTest('AU Modal qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_AU_SHORT_TERM', amount: 200, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
modalTest('AU Modal non qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_AU_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
modalTest.describe('@ES Short Term', () => {
modalTest('ES Modal qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_ES_SHORT_TERM', amount: 200, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
modalTest('ES Modal non qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_ES_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
modalTest.describe('@FR Short Term', () => {
modalTest('FR Modal qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_FR_SHORT_TERM', amount: 200, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
modalTest('FR Modal non qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_FR_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
modalTest.describe('@GB Short Term', () => {
modalTest('GB Modal qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_GB_SHORT_TERM', amount: 200, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
modalTest('GB Modal non qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_GB_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
modalTest.describe('@IT Short Term', () => {
modalTest('IT Modal qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_IT_SHORT_TERM', amount: 200, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
modalTest('IT Modal non qualifying', async ({ navigatePage, loadModal, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_IT_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });

const modalIframe = await loadModal();

await runAxeCoreScan(modalIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});

0 comments on commit 93aa376

Please sign in to comment.