Skip to content

refactor(pie-text-input): DSW-2384 tests to use @playwright/test #2194

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

Merged
merged 10 commits into from
Feb 10, 2025
Merged
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
402 changes: 402 additions & 0 deletions apps/pie-storybook/stories/testing/pie-text-input.test.stories.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@sand4rt/experimental-ct-web';
import { getPlaywrightVisualConfig } from '@justeattakeaway/pie-components-config';
import { defineConfig } from '@playwright/test';
import { getPlaywrightNativeVisualConfig } from '@justeattakeaway/pie-components-config';

export default defineConfig(getPlaywrightVisualConfig());
export default defineConfig(getPlaywrightNativeVisualConfig());
6 changes: 3 additions & 3 deletions packages/components/pie-text-input/playwright-lit.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@sand4rt/experimental-ct-web';
import { getPlaywrightConfig } from '@justeattakeaway/pie-components-config';
import { defineConfig } from '@playwright/test';
import { getPlaywrightNativeConfig } from '@justeattakeaway/pie-components-config';

export default defineConfig(getPlaywrightConfig());
export default defineConfig(getPlaywrightNativeConfig());
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts';
import { PieTextInput } from '../../src/index.ts';
import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/playwright-fixtures.ts';
import { BasePage } from '@justeattakeaway/pie-webc-testing/src/helpers/page-object/base-page.ts';

test.describe('PieTextInput - Accessibility tests', () => {
test('a11y - should test the PieTextInput component WCAG compliance', async ({ makeAxeBuilder, mount }) => {
await mount(PieTextInput);
test('a11y - should test the PieTextInput component WCAG compliance', async ({ makeAxeBuilder, page }) => {
const textInputDefaultPage = new BasePage(page, 'text-input--default');
await textInputDefaultPage.load();

const results = await makeAxeBuilder().analyze();

Expand Down
1,234 changes: 624 additions & 610 deletions packages/components/pie-text-input/test/component/pie-text-input.spec.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const textInput = {
selectors: {
container: {
dataTestId: 'pie-text-input-container',
},
assistiveText: {
dataTestId: 'pie-text-input-assistive-text',
},
input: {
dataTestId: 'pie-text-input',
},
},
};
export {
textInput,
};
Loading
Loading