diff --git a/core/src/components/radio/test/a11y/radio.e2e.ts b/core/src/components/radio/test/a11y/radio.e2e.ts index eaa52c548c3..e5a375bc966 100644 --- a/core/src/components/radio/test/a11y/radio.e2e.ts +++ b/core/src/components/radio/test/a11y/radio.e2e.ts @@ -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( ` @@ -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 }) => { diff --git a/core/src/components/radio/test/legacy/a11y/radio.e2e.ts b/core/src/components/radio/test/legacy/a11y/radio.e2e.ts index af6ccbfeb2b..98ccc80a46c 100644 --- a/core/src/components/radio/test/legacy/a11y/radio.e2e.ts +++ b/core/src/components/radio/test/legacy/a11y/radio.e2e.ts @@ -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');