Skip to content

Commit

Permalink
Merge pull request #1130 from perco12/mighty-mice-munch-magical-marsh…
Browse files Browse the repository at this point in the history
…mellow-muffins

feat: update a11y message test for all countries
  • Loading branch information
perco12 authored Sep 20, 2024
2 parents 93aa376 + ecdf25d commit 85d73ab
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 5 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,25 @@ jobs:
- name: Run server
run: |
./.github/scripts/runServerV2.sh
- name: Run Playwright Modals
continue-on-error: true
run: npx playwright test tests/playwright/tests/sdk/modals --grep @${{matrix.countries}} --output=playwright-report-${{matrix.countries}}

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-modal-${{matrix.countries}}
path: playwright-report/
retention-days: 1

- name: Run Playwright 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-${{matrix.countries}}
name: playwright-report-message-${{matrix.countries}}
path: playwright-report/
retention-days: 30
retention-days: 1
24 changes: 23 additions & 1 deletion tests/playwright/tests/sdk/messages/longTerm.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { messageTest } from '../../../pages/messages_fixture';

messageTest.describe('Long Term', () => {
messageTest.describe('@US Long Term', () => {
messageTest('US Message long term non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_US_LONG_TERM', amount: 29, offer: 'PAY_LATER_LONG_TERM' });
const messageIFrame = await loadMessage();
Expand All @@ -17,3 +17,25 @@ messageTest.describe('Long Term', () => {
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
messageTest.describe('@DE Long Term', () => {
messageTest('DE Message long term qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_LONG_TERM', amount: 100, offer: 'PAY_LATER_LONG_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('DE Message long term non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_LONG_TERM', amount: 29, offer: 'PAY_LATER_LONG_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('DE Message long term 0APR non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_LONG_TERM_0APR', amount: 29, offer: 'PAY_LATER_LONG_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('DE Message long term 0APR qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_LONG_TERM_0APR', amount: 100, offer: 'PAY_LATER_LONG_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
26 changes: 25 additions & 1 deletion tests/playwright/tests/sdk/messages/multi.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { messageTest } from '../../../pages/messages_fixture';

messageTest.describe('Multi Messages', () => {
messageTest.describe('@US Multi Messages', () => {
messageTest('US long term non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_US_MULTI', amount: 20001, offer: 'PAY_LATER_LONG_TERM' });
const messageIframe = await loadMessage();
Expand Down Expand Up @@ -31,3 +31,27 @@ messageTest.describe('Multi Messages', () => {
await runAxeCoreScan(messageIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});

messageTest.describe('@DE Multi Messages', () => {
messageTest('DE multi qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_MULTI', amount: 200, offer: 'PAY_LATER_SHORT_TERM' });
const messageIframe = await loadMessage();
await runAxeCoreScan(messageIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});

messageTest('DE multi non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_MULTI', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });
const messageIframe = await loadMessage();
await runAxeCoreScan(messageIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('DE pay in 1 qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_PAY_IN_1', amount: 200, offer: 'PAY_LATER_PAY_IN_1' });
const messageIframe = await loadMessage();
await runAxeCoreScan(messageIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('DE pay in 1 non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_DE_PAY_IN_1', amount: 1001.1, offer: 'PAY_LATER_PAY_IN_1' });
const messageIframe = await loadMessage();
await runAxeCoreScan(messageIframe, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
76 changes: 75 additions & 1 deletion tests/playwright/tests/sdk/messages/shortTerm.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,80 @@
import { messageTest } from '../../../pages/messages_fixture';

messageTest.describe('Short Term', () => {
messageTest.describe('@AU Short Term', () => {
messageTest('AU Message short term non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_AU_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('AU Message short term qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_AU_SHORT_TERM', amount: 100, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
messageTest.describe('@ES Short Term', () => {
messageTest('ES Message short term non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_ES_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('ES Message short term qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_ES_SHORT_TERM', amount: 100, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
messageTest.describe('@FR Short Term', () => {
messageTest('FR Message short term non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_FR_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('FR Message short term qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_FR_SHORT_TERM', amount: 100, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
messageTest.describe('@GB Short Term', () => {
messageTest('GB Message short term non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_GB_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('GB Message short term qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_GB_SHORT_TERM', amount: 100, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('GB Message short term checkout qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_GB_SHORT_TERM_CHECKOUT', amount: 100, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});

messageTest(
'GB Message short term checkout non qualifying',
async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_GB_SHORT_TERM_CHECKOUT', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
}
);
});
messageTest.describe('@IT Short Term', () => {
messageTest('IT Message short term non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_IT_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
messageTest('IT Message short term qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_IT_SHORT_TERM', amount: 100, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
await runAxeCoreScan(messageIFrame, ['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']);
});
});
messageTest.describe('@US Short Term', () => {
messageTest('US Message short term non qualifying', async ({ navigatePage, loadMessage, runAxeCoreScan }) => {
await navigatePage({ account: 'DEV_US_SHORT_TERM', amount: 29, offer: 'PAY_LATER_SHORT_TERM' });
const messageIFrame = await loadMessage();
Expand Down

0 comments on commit 85d73ab

Please sign in to comment.