Skip to content
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
20 changes: 17 additions & 3 deletions core/src/components/radio/test/a11y/radio.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
});
});

// TODO(FW-5715): re-enable test
test.skip(title('radio: keyboard navigation'), () => {
test.beforeEach(async ({ page }) => {
test.describe(title('radio: keyboard navigation'), () => {
test.beforeEach(async ({ page, browserName }) => {
await page.setContent(
`
<ion-app>
Expand Down Expand Up @@ -59,6 +58,21 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
`,
config
);

if (browserName === 'webkit') {
const radio = page.locator('#first-group ion-radio').first();
/**
* Sometimes Safari does not focus the first radio.
* This is a workaround to ensure the first radio is focused.
*
* Wait for the first radio to be rendered before tabbing.
* This is necessary because the first radio may not be rendered
* when the page first loads.
*
* This would cause the first radio to be skipped when tabbing.
*/
await radio.waitFor();
}
});

test('tabbing should switch between radio groups', async ({ page, pageUtils }) => {
Expand Down
18 changes: 16 additions & 2 deletions core/src/components/radio/test/legacy/a11y/radio.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,23 @@ import { configs, test } from '@utils/test/playwright';
*/
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe(title('radio: a11y'), () => {
test.beforeEach(async ({ page, skip }) => {
skip.browser('webkit', 'Tabbing is flaky in Safari');
test.beforeEach(async ({ page, browserName }) => {
await page.goto(`/src/components/radio/test/legacy/a11y`, config);

if (browserName === 'webkit') {
const radio = page.locator('#first-group ion-radio').first();
/**
* Sometimes Safari does not focus the first radio.
* This is a workaround to ensure the first radio is focused.
*
* Wait for the first radio to be rendered before tabbing.
* This is necessary because the first radio may not be rendered
* when the page first loads.
*
* This would cause the first radio to be skipped when tabbing.
*/
await radio.waitFor();
}
});
test('tabbing should switch between radio groups', async ({ page, pageUtils }) => {
const firstGroupRadios = page.locator('#first-group ion-radio');
Expand Down