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

test(e2e): add proper tags to avt tests #14915

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9216350
test(e2e): add proper tags to avt tests
tay1orjones Oct 16, 2023
7ca61d2
Merge branch 'main' into 14595-partial-avt-tags
tay1orjones Oct 16, 2023
9e9f6bd
Merge branch 'main' of github.com:carbon-design-system/carbon into 14…
tay1orjones Oct 18, 2023
ebf538c
Merge branch 'main' of github.com:carbon-design-system/carbon into 14…
tay1orjones Oct 23, 2023
e735883
ci(avt): shard avt tests
tay1orjones Oct 23, 2023
0a6acf8
Merge branch 'main' into 14595-partial-avt-tags
tay1orjones Oct 23, 2023
99b85b8
fix: typo
tay1orjones Oct 23, 2023
b250e92
Merge branch 'main' into 14595-partial-avt-tags
tay1orjones Oct 23, 2023
edb163b
test(config): increase playwright expect timeout
tay1orjones Oct 24, 2023
958d07b
test(playwright): increase timeout config
tay1orjones Oct 24, 2023
9bb01f0
Merge branch 'main' into 14595-partial-avt-tags
andreancardona Oct 25, 2023
ae7ac93
Merge branch 'main' into 14595-partial-avt-tags
alisonjoseph Oct 30, 2023
533400b
Merge branch 'main' into 14595-partial-avt-tags
tw15egan Oct 31, 2023
d5ef9fe
Merge branch 'main' into 14595-partial-avt-tags
tay1orjones Oct 31, 2023
7614137
Merge branch 'main' into 14595-partial-avt-tags
tay1orjones Oct 31, 2023
fab1912
Merge branch 'main' of github.com:carbon-design-system/carbon into 14…
tay1orjones Nov 6, 2023
5aa13f7
test(progressindicator): update to use proper tags
tay1orjones Nov 6, 2023
f686893
test(progressindicator): correct focus order
tay1orjones Nov 7, 2023
a329c61
Merge branch 'main' into 14595-partial-avt-tags
tay1orjones Nov 7, 2023
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
18 changes: 15 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ jobs:
if: ${{ needs.vrt-runner.result != 'success' }}
run: exit 1

avt:
avt-runner:
strategy:
matrix:
shard: [1, 2, 3, 4]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
Expand Down Expand Up @@ -206,15 +209,15 @@ jobs:
run: |
npx serve -l 3000 packages/react/storybook-static &
pid=$!
echo ::set-output name=pid::"$pid"
echo "pid=$pid" >> $GITHUB_OUTPUT
- uses: ./actions/wait-for-it
with:
URL: 'http://localhost:3000'
timeout-minutes: 3
- name: Run AVT
if: github.repository == 'carbon-design-system/carbon'
run: |
yarn playwright test --project chromium --grep @avt
yarn playwright test --project chromium --grep @avt --shard="${{ matrix.shard }}/4"
- name: Stop storybook
run: kill ${{ steps.storybook.outputs.pid }}
- name: Upload test results
Expand All @@ -223,3 +226,12 @@ jobs:
with:
name: playwright-avt-report
path: .playwright

avt:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: avt-runner
steps:
- name: Check AVT Runner job status
if: ${{ needs.avt-runner.result != 'success' }}
run: exit 1
24 changes: 24 additions & 0 deletions e2e/components/AspectRatio/AspectRatio-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('AspectRatio @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'AspectRatio',
id: 'components-aspectratio--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('AspectRatio @avt-default-state');
});
});
15 changes: 2 additions & 13 deletions e2e/components/AspectRatio/AspectRatio-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

'use strict';

const { expect, test } = require('@playwright/test');
const { test } = require('@playwright/test');
const { themes } = require('../../test-utils/env');
const { snapshotStory, visitStory } = require('../../test-utils/storybook');
const { snapshotStory } = require('../../test-utils/storybook');

test.describe('AspectRatio', () => {
themes.forEach((theme) => {
Expand All @@ -23,15 +23,4 @@ test.describe('AspectRatio', () => {
});
});
});

test('accessibility-checker @avt', async ({ page }) => {
await visitStory(page, {
component: 'AspectRatio',
id: 'components-aspectratio--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('AspectRatio');
});
});
24 changes: 12 additions & 12 deletions e2e/components/Button/Button-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('Button @avt', () => {
test('accessibility-checker', async ({ page }) => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--default',
Expand All @@ -22,7 +22,7 @@ test.describe('Button @avt', () => {
await expect(page).toHaveNoACViolations('Button');
});

test('accessibility-checker button danger', async ({ page }) => {
test('@avt-advanced-states danger', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--danger',
Expand All @@ -33,7 +33,7 @@ test.describe('Button @avt', () => {
await expect(page).toHaveNoACViolations('Button-danger');
});

test('accessibility-checker button ghost', async ({ page }) => {
test('@avt-advanced-states ghost', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--ghost',
Expand All @@ -44,7 +44,7 @@ test.describe('Button @avt', () => {
await expect(page).toHaveNoACViolations('Button-ghost');
});

test('accessibility-checker button icon-button', async ({ page }) => {
test('@avt-advanced-states icon-button', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--icon-button',
Expand All @@ -55,7 +55,7 @@ test.describe('Button @avt', () => {
await expect(page).toHaveNoACViolations('Button-icon-button');
});

test('accessibility-checker button secondary', async ({ page }) => {
test('@avt-advanced-states secondary', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--secondary',
Expand All @@ -66,7 +66,7 @@ test.describe('Button @avt', () => {
await expect(page).toHaveNoACViolations('Button-secondary');
});

test('accessibility-checker button set-of-buttons', async ({ page }) => {
test('@avt-advanced-states set-of-buttons', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--set-of-buttons',
Expand All @@ -77,7 +77,7 @@ test.describe('Button @avt', () => {
await expect(page).toHaveNoACViolations('Button-set-of-buttons');
});

test('accessibility-checker button skeleton', async ({ page }) => {
test('@avt-advanced-states skeleton', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--skeleton',
Expand All @@ -88,7 +88,7 @@ test.describe('Button @avt', () => {
await expect(page).toHaveNoACViolations('Button-skeleton');
});

test('accessibility-checker button tertiary', async ({ page }) => {
test('@avt-advanced-states tertiary', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--tertiary',
Expand All @@ -99,7 +99,7 @@ test.describe('Button @avt', () => {
await expect(page).toHaveNoACViolations('Button-tertiary');
});

test('accessibility-checker disabled button', async ({ page }) => {
test('@avt-advanced-states disabled', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--default',
Expand All @@ -115,7 +115,7 @@ test.describe('Button @avt', () => {
await expect(page).toHaveNoACViolations('Button-disabled');
});

test('accessibility-checker keyboard interaction', async ({ page }) => {
test('@avt-keyboard-nav', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--default',
Expand All @@ -128,7 +128,7 @@ test.describe('Button @avt', () => {
await expect(page.getByRole('button')).toBeFocused();
});

test('accessibility-checker mouse interaction', async ({ page }) => {
test('@avt-advanced-states mouse interaction', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--default',
Expand All @@ -141,7 +141,7 @@ test.describe('Button @avt', () => {
await expect(page.getByRole('button')).toBeFocused();
});

test('accessibility-checker hover state', async ({ page }) => {
test('@avt-advanced-states hover state', async ({ page }) => {
await visitStory(page, {
component: 'Button',
id: 'components-button--default',
Expand Down
24 changes: 24 additions & 0 deletions e2e/components/ClassPrefix/ClassPrefix-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('ClassPrefix @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'ClassPrefix',
id: 'components-classprefix--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaaveNoACViolations('ClassPrefix @avt-default-state');
});
});
15 changes: 2 additions & 13 deletions e2e/components/ClassPrefix/ClassPrefix-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

'use strict';
const { expect, test } = require('@playwright/test');
const { test } = require('@playwright/test');
const { themes } = require('../../test-utils/env');
const { snapshotStory, visitStory } = require('../../test-utils/storybook');
const { snapshotStory } = require('../../test-utils/storybook');

test.describe('ClassPrefix', () => {
themes.forEach((theme) => {
Expand All @@ -22,15 +22,4 @@ test.describe('ClassPrefix', () => {
});
});
});

test('accessibility-checker @avt', async ({ page }) => {
await visitStory(page, {
component: 'ClassPrefix',
id: 'components-classprefix--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('ClassPrefix');
});
});
31 changes: 10 additions & 21 deletions e2e/components/CodeSnippet/CodeSnippet-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('CodeSnippet @avt', () => {
test('accessibility-checker CodeSnippet inline', async ({ page }) => {
test('@avt-default-state inline', async ({ page }) => {
await visitStory(page, {
component: 'CodeSnippet',
id: 'components-codesnippet--inline',
Expand All @@ -22,9 +22,7 @@ test.describe('CodeSnippet @avt', () => {
await expect(page).toHaveNoACViolations('CodeSnippet inline');
});

test('accessibility-checker CodeSnippet inline hover @avt', async ({
page,
}) => {
test('@avt-advanced-states inline hover', async ({ page }) => {
await visitStory(page, {
component: 'CodeSnippet',
id: 'components-codesnippet--inline',
Expand All @@ -38,9 +36,7 @@ test.describe('CodeSnippet @avt', () => {
await expect(page).toHaveNoACViolations('CodeSnippet inline hover');
});

test('accessibility-checker CodeSnippet inline focused @avt', async ({
page,
}) => {
test('@avt-advanced-states inline focused', async ({ page }) => {
await visitStory(page, {
component: 'CodeSnippet',
id: 'components-codesnippet--inline',
Expand All @@ -54,7 +50,8 @@ test.describe('CodeSnippet @avt', () => {
await expect(page).toHaveNoACViolations('CodeSnippet inline focused');
});

test('accessibility-checker CodeSnippet multiline @avt', async ({ page }) => {
// Skipping due to a11y violation issue #14237
test.skip('@avt-default-state multiline', async ({ page }) => {
await visitStory(page, {
component: 'CodeSnippet',
id: 'components-codesnippet--multiline',
Expand All @@ -65,9 +62,7 @@ test.describe('CodeSnippet @avt', () => {
await expect(page).toHaveNoACViolations('CodeSnippet multiline');
});

test('accessibility-checker CodeSnippet singleline @avt', async ({
page,
}) => {
test('@avt-default-state singleline', async ({ page }) => {
await visitStory(page, {
component: 'CodeSnippet',
id: 'components-codesnippet--singleline',
Expand All @@ -78,7 +73,7 @@ test.describe('CodeSnippet @avt', () => {
await expect(page).toHaveNoACViolations('CodeSnippet singleline');
});

test('accessibility-checker CodeSnippet skeleton @avt', async ({ page }) => {
test('@avt-advanced-states skeleton', async ({ page }) => {
await visitStory(page, {
component: 'CodeSnippet',
id: 'components-codesnippet--skeleton',
Expand All @@ -89,9 +84,7 @@ test.describe('CodeSnippet @avt', () => {
await expect(page).toHaveNoACViolations('CodeSnippet skeleton');
});

test('accessibility-checker CodeSnippet inline keyboard nav', async ({
page,
}) => {
test('inline @avt-keyboard-nav', async ({ page }) => {
await visitStory(page, {
component: 'CodeSnippet',
id: 'components-codesnippet--inline',
Expand All @@ -110,9 +103,7 @@ test.describe('CodeSnippet @avt', () => {
await expect(page.getByRole('tooltip')).toHaveText('Copied to clipboard');
});

test('accessibility-checker CodeSnippet multiline keyboard nav', async ({
page,
}) => {
test('multiline @avt-keyboard-nav', async ({ page }) => {
await visitStory(page, {
component: 'CodeSnippet',
id: 'components-codesnippet--multiline',
Expand All @@ -139,9 +130,7 @@ test.describe('CodeSnippet @avt', () => {
await expect(page.getByText('Show more')).not.toBeVisible();
});

test('accessibility-checker CodeSnippet singleline keyboard nav', async ({
page,
}) => {
test('singleline @avt-keyboard-nav', async ({ page }) => {
await visitStory(page, {
component: 'CodeSnippet',
id: 'components-codesnippet--singleline',
Expand Down
6 changes: 3 additions & 3 deletions e2e/components/ComboBox/ComboBox-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { expect, test } = require('@playwright/test');
const { visitStory } = require('../../test-utils/storybook');

test.describe('ComboBox @avt', () => {
test('accessibility-checker combobox', async ({ page }) => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'ComboBox',
id: 'components-combobox--default',
Expand All @@ -23,7 +23,7 @@ test.describe('ComboBox @avt', () => {
});

// Skipping now due to AVT violation, possible false positive
test.skip('accessibility-checker open combobox', async ({ page }) => {
test.skip('@avt-advanced-states open', async ({ page }) => {
await visitStory(page, {
component: 'ComboBox',
id: 'components-combobox--default',
Expand All @@ -44,7 +44,7 @@ test.describe('ComboBox @avt', () => {
await expect(page).toHaveNoACViolations('ComboBox-open');
});

test('combobox - keyboard nav', async ({ page }) => {
test('@avt-keyboard-nav', async ({ page }) => {
await visitStory(page, {
component: 'ComboBox',
id: 'components-combobox--default',
Expand Down
4 changes: 2 additions & 2 deletions e2e/components/ComboButton/ComboButton-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import { expect, test } from '@playwright/test';
import { visitStory } from '../../test-utils/storybook';

test.describe('ComboButton @avt', () => {
test('@avt-default-state ComboButton', async ({ page }) => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'ComboButton',
id: 'components-combobutton--default',
globals: {
theme: 'white',
},
});
await expect(page).toHaveNoACViolations('ComboButton');
await expect(page).toHaveNoACViolations('ComboButton @avt-default-state');
});

test('@avt-advanced-states ComboButton With Danger', async ({ page }) => {
Expand Down
Loading
Loading