-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AVT] - StructuredList test (#14375)
* test: added avt test * test: added AVT tests * fix: added aria-label * fix: changed aria-busy position * test: fixed version in esbuild * test: sanpshot e2e updated * test: updated snapshot
- Loading branch information
Showing
18 changed files
with
183 additions
and
107 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+32.3 KB
...uild-npm-0.19.1-892202a3bf-e7c1b123ab.zip → ...uild-npm-0.19.2-84addf679d-f9ad8ad4f0.zip
Binary file not shown.
86 changes: 86 additions & 0 deletions
86
e2e/components/StructuredList/StructuredList-test.avt.e2e.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/** | ||
* 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('StructuredList @avt', () => { | ||
test('accessibility-checker', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'StructuredList', | ||
id: 'components-structuredlist--default', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('StructuredList'); | ||
}); | ||
|
||
test('accessibility-checker selection', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'StructuredList', | ||
id: 'components-structuredlist--selection', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('StructuredList-selection'); | ||
}); | ||
|
||
test('accessibility-checker skeleton', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'StructuredList', | ||
id: 'components-structuredlist--skeleton', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
await expect(page).toHaveNoACViolations('StructuredList-skeleton'); | ||
}); | ||
|
||
test('accessibility-checker keyboard nav', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'StructuredList', | ||
id: 'components-structuredlist--selection', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
|
||
await expect(page.getByRole('table')).toBeVisible(); | ||
await page.keyboard.press('Tab'); | ||
await expect(page.locator('input#row-0')).toBeFocused(); | ||
await page.keyboard.press('ArrowDown'); | ||
const row = page.getByRole('row'); | ||
await expect(row.nth(2)).toHaveClass(/cds--structured-list-row--selected/); | ||
await page.keyboard.press('ArrowDown'); | ||
await page.keyboard.press('ArrowDown'); | ||
await page.keyboard.press('ArrowDown'); | ||
await expect(page.locator('input#row-0')).toBeFocused(); | ||
|
||
await expect(page).toHaveNoACViolations('StructuredList-keyboardnav'); | ||
}); | ||
|
||
test('accessibility-checker mouse interaction', async ({ page }) => { | ||
await visitStory(page, { | ||
component: 'StructuredList', | ||
id: 'components-structuredlist--selection', | ||
globals: { | ||
theme: 'white', | ||
}, | ||
}); | ||
|
||
await expect(page.getByRole('table')).toBeVisible(); | ||
page.locator('input#row-1').click({ force: true }); | ||
const row = page.getByRole('row'); | ||
await expect(row.nth(2)).toHaveClass(/cds--structured-list-row--selected/); | ||
|
||
await expect(page).toHaveNoACViolations('StructuredList-mouse-interaction'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.