Skip to content

Commit

Permalink
feat: 14595-update-ally-test-tags (#14913)
Browse files Browse the repository at this point in the history
Co-authored-by: TJ Egan <[email protected]>
Co-authored-by: Guilherme Datilio Ribeiro <[email protected]>
Co-authored-by: Taylor Jones <[email protected]>
Co-authored-by: Taylor Jones <[email protected]>
  • Loading branch information
5 people authored Nov 17, 2023
1 parent 7b8f629 commit 1488f59
Show file tree
Hide file tree
Showing 22 changed files with 144 additions and 152 deletions.
46 changes: 28 additions & 18 deletions e2e/components/Accordion/Accordion-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,33 @@ test.describe('Accordion @avt', () => {
},
});

const accordin_btn1 = page.getByRole('button', { name: 'Section 1 title' });
const accordin_btn2 = page.getByRole('button', { name: 'Section 2 title' });
const accordion_btn1 = page.getByRole('button', {
name: 'Section 1 title',
});
const accordion_btn2 = page.getByRole('button', {
name: 'Section 2 title',
});

await expect(accordin_btn1).toBeVisible();
await expect(accordion_btn1).toBeVisible();
await page.keyboard.press('Tab');

// Check the focus on Accordion 1
await expect(accordin_btn1).toBeFocused();
await expect(accordion_btn1).toBeFocused();
await page.keyboard.press('Enter');

// Open the Accordion 1
await expect(accordin_btn1).toHaveAttribute('aria-expanded', 'true');
await expect(accordion_btn1).toHaveAttribute('aria-expanded', 'true');
await page.keyboard.press('Enter');
await expect(accordin_btn1).toHaveAttribute('aria-expanded', 'false');
await expect(accordion_btn1).toHaveAttribute('aria-expanded', 'false');

await page.keyboard.press('Tab');

// Check the focus and open state on Accordion 2
await expect(accordin_btn2).toBeFocused();
await expect(accordion_btn2).toBeFocused();
await page.keyboard.press('Space');
await expect(accordin_btn2).toHaveAttribute('aria-expanded', 'true');
await expect(accordion_btn2).toHaveAttribute('aria-expanded', 'true');
await page.keyboard.press('Escape');
await expect(accordin_btn2).toHaveAttribute('aria-expanded', 'false');
await expect(accordion_btn2).toHaveAttribute('aria-expanded', 'false');
});

test('@avt-advanced-states mouse click', async ({ page }) => {
Expand All @@ -90,16 +94,18 @@ test.describe('Accordion @avt', () => {
theme: 'white',
},
});
const accordin_btn1 = page.getByRole('button', { name: 'Section 1 title' });
await accordin_btn1.click();
await expect(accordin_btn1).toHaveAttribute('aria-expanded', 'true');
const accordion_btn1 = page.getByRole('button', {
name: 'Section 1 title',
});
await accordion_btn1.click();
await expect(accordion_btn1).toHaveAttribute('aria-expanded', 'true');

// Checking for ACViolation
await expect(page).toHaveNoACViolations(
'Accordion @avt-advanced-states mouse click'
);
await accordin_btn1.click();
await expect(accordin_btn1).toHaveAttribute('aria-expanded', 'false');
await accordion_btn1.click();
await expect(accordion_btn1).toHaveAttribute('aria-expanded', 'false');
});

test('@avt-advanced-states mouse hover', async ({ page }) => {
Expand All @@ -110,8 +116,10 @@ test.describe('Accordion @avt', () => {
theme: 'white',
},
});
const accordin_btn1 = page.getByRole('button', { name: 'Section 1 title' });
await accordin_btn1.hover();
const accordion_btn1 = page.getByRole('button', {
name: 'Section 1 title',
});
await accordion_btn1.hover();
await expect(page).toHaveNoACViolations(
'Accordion @avt-advanced-states mouse hover'
);
Expand All @@ -128,8 +136,10 @@ test.describe('Accordion @avt', () => {
disabled: true,
},
});
const accordin_btn1 = page.getByRole('button', { name: 'Section 1 title' });
await expect(accordin_btn1).toBeDisabled();
const accordion_btn1 = page.getByRole('button', {
name: 'Section 1 title',
});
await expect(accordion_btn1).toBeDisabled();
await expect(page).toHaveNoACViolations(
'Accordion @avt-advanced-states disabled'
);
Expand Down
40 changes: 14 additions & 26 deletions e2e/components/Notifications/Notifications-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('Notifications @avt', () => {
test('accessibility-checker Notifications actionable', async ({ page }) => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'Notifications',
id: 'components-notifications-actionable--default',
Expand Down Expand Up @@ -51,9 +51,7 @@ test.describe('Notifications @avt', () => {
);
});

test('accessibility-checker Notifications actionable low contrast', async ({
page,
}) => {
test('@avt-advanced-states actionable low contrast', async ({ page }) => {
await visitStory(page, {
component: 'Notifications',
id: 'components-notifications-actionable--default',
Expand All @@ -69,9 +67,7 @@ test.describe('Notifications @avt', () => {
);
});

test('accessibility-checker Notifications actionable info', async ({
page,
}) => {
test('@avt-advanced-states actionable info', async ({ page }) => {
await visitStory(page, {
component: 'Notifications',
id: 'components-notifications-actionable--playground',
Expand All @@ -85,9 +81,7 @@ test.describe('Notifications @avt', () => {
await expect(page).toHaveNoACViolations('Notifications actionable info');
});

test('accessibility-checker Notifications actionable info-square', async ({
page,
}) => {
test('@avt-advanced-states actionable info-square', async ({ page }) => {
await visitStory(page, {
component: 'Notifications',
id: 'components-notifications-actionable--playground',
Expand All @@ -103,9 +97,7 @@ test.describe('Notifications @avt', () => {
);
});

test('accessibility-checker Notifications actionable success', async ({
page,
}) => {
test('@avt-advanced-states actionable success', async ({ page }) => {
await visitStory(page, {
component: 'Notifications',
id: 'components-notifications-actionable--playground',
Expand All @@ -119,9 +111,7 @@ test.describe('Notifications @avt', () => {
await expect(page).toHaveNoACViolations('Notifications actionable success');
});

test('accessibility-checker Notifications actionable warning', async ({
page,
}) => {
test('@avt-advanced-states actionable warning', async ({ page }) => {
await visitStory(page, {
component: 'Notifications',
id: 'components-notifications-actionable--playground',
Expand All @@ -135,9 +125,7 @@ test.describe('Notifications @avt', () => {
await expect(page).toHaveNoACViolations('Notifications actionable warning');
});

test('accessibility-checker Notifications actionable warning-alt', async ({
page,
}) => {
test('@avt-advanced-states actionable warning-alt', async ({ page }) => {
await visitStory(page, {
component: 'Notifications',
id: 'components-notifications-actionable--playground',
Expand All @@ -153,7 +141,7 @@ test.describe('Notifications @avt', () => {
);
});

test('accessibility-checker Notifications actionable info low contrast', async ({
test('@avt-advanced-states actionable info low contrast', async ({
page,
}) => {
await visitStory(page, {
Expand All @@ -172,7 +160,7 @@ test.describe('Notifications @avt', () => {
);
});

test('accessibility-checker Notifications actionable info-squar low contraste', async ({
test('@avt-advanced-states actionable info-square low contrast', async ({
page,
}) => {
await visitStory(page, {
Expand All @@ -191,7 +179,7 @@ test.describe('Notifications @avt', () => {
);
});

test('accessibility-checker Notifications actionable success low contrast', async ({
test('@avt-advanced-states actionable success low contrast', async ({
page,
}) => {
await visitStory(page, {
Expand All @@ -210,7 +198,7 @@ test.describe('Notifications @avt', () => {
);
});

test('accessibility-checker Notifications actionable warning low contrast', async ({
test('@avt-advanced-states actionable warning low contrast', async ({
page,
}) => {
await visitStory(page, {
Expand All @@ -229,7 +217,7 @@ test.describe('Notifications @avt', () => {
);
});

test('accessibility-checker Notifications actionable warning-alt low contrast', async ({
test('@avt-advanced-states actionable warning-alt low contrast', async ({
page,
}) => {
await visitStory(page, {
Expand All @@ -248,7 +236,7 @@ test.describe('Notifications @avt', () => {
);
});

test('accessibility-checker Notifications inline', async ({ page }) => {
test('@avt-advanced-states inline', async ({ page }) => {
await visitStory(page, {
component: 'Notifications',
id: 'components-notifications-inline--default',
Expand All @@ -259,7 +247,7 @@ test.describe('Notifications @avt', () => {
await expect(page).toHaveNoACViolations('Notifications inline');
});

test('accessibility-checker Notifications toast', async ({ page }) => {
test('@avt-advanced-states toast', async ({ page }) => {
await visitStory(page, {
component: 'Notifications',
id: 'components-notifications-toast--default',
Expand Down
6 changes: 3 additions & 3 deletions e2e/components/NumberInput/NumberInput-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('NumberInput @avt', () => {
test('accessibility-checker default', async ({ page }) => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'NumberInput',
id: 'components-numberinput--default',
Expand All @@ -22,7 +22,7 @@ test.describe('NumberInput @avt', () => {
await expect(page).toHaveNoACViolations('components-numberinput--default');
});

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

test('number input - keyboard nav', async ({ page }) => {
test('@avt-keyboard-nav', async ({ page }) => {
await visitStory(page, {
component: 'NumberInput',
id: 'components-numberinput--default',
Expand Down
4 changes: 2 additions & 2 deletions e2e/components/OrderedList/OrderedList-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('OrderedList @avt', () => {
test('accessibility-checker default', async ({ page }) => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'OrderedList',
id: 'components-orderedlist--default',
Expand All @@ -22,7 +22,7 @@ test.describe('OrderedList @avt', () => {
await expect(page).toHaveNoACViolations('components-orderedlist--default');
});

test('accessibility-checker nested', async ({ page }) => {
test('@avt-advanced-states nested', async ({ page }) => {
await visitStory(page, {
component: 'OrderedList',
id: 'components-orderedlist--nested',
Expand Down
10 changes: 5 additions & 5 deletions e2e/components/OverflowMenu/OverflowMenu-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('OverflowMenu @avt', () => {
test('accessibility-checker', async ({ page }) => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'OverflowMenu',
id: 'components-overflowmenu--default',
Expand All @@ -22,7 +22,7 @@ test.describe('OverflowMenu @avt', () => {
await expect(page).toHaveNoACViolations('OverflowMenu');
});

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

test('accessibility-checker open menu', async ({ page }) => {
test('@avt-advanced-states open menu', async ({ page }) => {
await visitStory(page, {
component: 'OverflowMenu',
id: 'components-overflowmenu--default',
Expand All @@ -53,7 +53,7 @@ test.describe('OverflowMenu @avt', () => {
await expect(page).toHaveNoACViolations('OverflowMenu-open');
});

test('accessibility-checker render custom icon open', async ({ page }) => {
test('@avt-advanced-states render custom icon open', async ({ page }) => {
await visitStory(page, {
component: 'OverflowMenu',
id: 'components-overflowmenu--render-custom-icon',
Expand All @@ -73,7 +73,7 @@ test.describe('OverflowMenu @avt', () => {
await expect(page).toHaveNoACViolations('OverflowMenu-custom-icon-open');
});

test('overflow-menu - keyboard nav', async ({ page }) => {
test('@avt-keyboard-nav overflow-menu', async ({ page }) => {
await visitStory(page, {
component: 'OverflowMenu',
id: 'components-overflowmenu--default',
Expand Down
6 changes: 3 additions & 3 deletions e2e/components/Pagination/Pagination-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('Pagination @avt', () => {
test('accessibility-checker default', async ({ page }) => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'Pagination',
id: 'components-pagination--default',
Expand All @@ -22,7 +22,7 @@ test.describe('Pagination @avt', () => {
await expect(page).toHaveNoACViolations('components-pagination--default');
});

test('accessibility-checker multiple-pagination-components', async ({
test('@avt-advanced-states multiple-pagination-components', async ({
page,
}) => {
await visitStory(page, {
Expand All @@ -37,7 +37,7 @@ test.describe('Pagination @avt', () => {
);
});

test('pagination - keyboard nav', async ({ page }) => {
test('@avt-keyboard-nav - pagination', async ({ page }) => {
await visitStory(page, {
component: 'Pagination',
id: 'components-pagination--default',
Expand Down
8 changes: 4 additions & 4 deletions e2e/components/ProgressBar/ProgressBar-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('ProgressBar @avt', () => {
test('accessibility-checker ProgressBar', async ({ page }) => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'ProgressBar',
id: 'components-progressbar--default',
Expand All @@ -22,7 +22,7 @@ test.describe('ProgressBar @avt', () => {
await expect(page).toHaveNoACViolations('ProgressBar');
});

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

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

test('accessibility-checker ProgressBar layer', async ({ page }) => {
test('@avt-advanced-states ProgressBar layer', async ({ page }) => {
await visitStory(page, {
component: 'ProgressBar',
id: 'components-progressbar--with-layer',
Expand Down
Loading

0 comments on commit 1488f59

Please sign in to comment.