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

feat: update the message accessibility test #1120

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ module.exports = defineConfig({
}
],
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'https://localhost.paypal.com:8080',
ignoreHTTPSErrors: true,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
Expand Down
7 changes: 3 additions & 4 deletions tests/playwright/practice-tests/accessibility.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { test, expect } from '@playwright/test';
import { AxeBuilder } from '@axe-core/playwright';
import { test, expect } from '../setupTest';

test.describe('smart', () => {
test('message should not have any automatically detectable accessibility issues', async ({ page }) => {
test('message should not have any automatically detectable accessibility issues', async ({ message }) => {
// Navigate to page
await page.goto(`/standalone.html?account=DEV_US_MULTI&amount=200&offer=PAY_LATER_SHORT_TERM`);
page.waitForLoadState('domcontentloaded');
const page = await message({ amount: 200 });

const zoidIFrame = await page.$('iframe[name*="__zoid__paypal_message__"]');
const messageIframe = await zoidIFrame.contentFrame();
Expand Down
19 changes: 0 additions & 19 deletions tests/playwright/practice-tests/example.spec.js

This file was deleted.

18 changes: 18 additions & 0 deletions tests/playwright/setupTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { test as base, expect } from '@playwright/test';

const test = base.extend({
message: async ({ page }, use) => {
const webpageMessage = async (options = {}) => {
// Default options
const { amount = 100, account = 'DEV_US_MULTI', offer = 'PAY_LATER_SHORT_TERM' } = options;

const url = `https://localhost.paypal.com:8080/snapshot/v2/sdk.html?account=${account}&amount=${amount}&offer=${offer}&env=local`;
await page.goto(url);
page.waitForLoadState('domcontentloaded');
return page;
};
await use(webpageMessage);
}
// modal: // TODO
});
export { test, expect };

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading