Skip to content

Commit 6df0259

Browse files
ilyabrowerslizhevskyv-semrushValeria-Zimnitskaya
authored
[UIK-3191][wizard] fixed disabled Wizard.Stepper in Sidebar can be focused and activated by keyboard (#2546)
<!--- Provide a general summary of your changes in the Title above --> ## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## How has this been tested? Manually <!--- Please describe in detail how you tested your changes. --> <!--- For example: --> <!--- I have added unit tests --> <!--- I have added Voice Over tests --> <!--- Code cannot be tested automatically so I have tested it only manually --> ## Screenshots (if appropriate): ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [X] Bug fix (non-breaking change which fixes an issue). - [ ] New feature (non-breaking change which adds functionality). - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). - [ ] Nice improve. ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] I have updated the documentation accordingly. - [X] I have added changelog note to corresponding `CHANGELOG.md` file with planned publish date. - [ ] I have added new tests on added of fixed functionality. --------- Co-authored-by: Slizhevsky Vladislav <[email protected]> Co-authored-by: Valeryia Zimnitskaya <[email protected]>
1 parent 7e34228 commit 6df0259

File tree

60 files changed

+739
-580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+739
-580
lines changed

semcore/wizard/CHANGELOG.md

Lines changed: 7 additions & 1 deletion

semcore/wizard/__tests__/wizard.axe-test.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,45 @@
11
import { e2eStandToHtml } from '@semcore/testing-utils/e2e-stand';
22
import { expect, test, getAccessibilityViolations } from '@semcore/testing-utils/playwright';
3-
4-
test.describe('Wizard axe checks', () => {
3+
import type { Page, Locator } from '@semcore/testing-utils/playwright';
4+
import { loadPage } from '@semcore/testing-utils/shared/helpers';
5+
import { TAG } from '@semcore/testing-utils/shared/tags';
6+
7+
export const locators = {
8+
button: (page: Page, name?: string, index?: number): Locator => {
9+
const base = page.getByRole('button', { name });
10+
return typeof index === 'number' ? base.nth(index) : base;
11+
},
12+
};
13+
14+
test.describe(`@wizard ${TAG.ACCESSIBILITY}`, () => {
515
test('Base example', async ({ page }) => {
6-
const standPath = 'stories/components/wizard/docs/examples/basic_example.tsx';
7-
const htmlContent = await e2eStandToHtml(standPath, 'en');
16+
await loadPage(page, 'stories/components/wizard/docs/examples/basic_example.tsx', 'en');
817

9-
await page.setContent(htmlContent);
1018
await page.keyboard.press('Tab');
1119
await page.keyboard.press('Enter');
12-
await page.waitForTimeout(100);
20+
await locators.button(page, 'Close').waitFor({ state: 'visible' });
1321
const violations = await getAccessibilityViolations({ page });
1422

1523
expect(violations).toEqual([]);
1624
});
1725

1826
test('Custom Step', async ({ page }) => {
19-
const standPath = 'stories/components/wizard/docs/examples/custom_step.tsx';
20-
const htmlContent = await e2eStandToHtml(standPath, 'en');
27+
await loadPage(page, 'stories/components/wizard/docs/examples/custom_step.tsx', 'en');
2128

22-
await page.setContent(htmlContent);
2329
await page.keyboard.press('Tab');
2430
await page.keyboard.press('Enter');
25-
await page.waitForTimeout(100);
31+
await locators.button(page, 'Close').waitFor({ state: 'visible' });
2632
const violations = await getAccessibilityViolations({ page });
2733

2834
expect(violations).toEqual([]);
2935
});
3036

3137
test('Custom Stepper', async ({ page }) => {
32-
const standPath = 'stories/components/wizard/docs/examples/custom_stepper.tsx';
33-
const htmlContent = await e2eStandToHtml(standPath, 'en');
38+
await loadPage(page, 'stories/components/wizard/docs/examples/custom_stepper.tsx', 'en');
3439

35-
await page.setContent(htmlContent);
3640
await page.keyboard.press('Tab');
3741
await page.keyboard.press('Enter');
38-
await page.waitForTimeout(100);
42+
await locators.button(page, 'Close').waitFor({ state: 'visible' });
3943
const violations = await getAccessibilityViolations({ page });
4044

4145
expect(violations).toEqual([]);

semcore/wizard/__tests__/wizard.browser-test.tsx

Lines changed: 693 additions & 558 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)