-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(accordion): migrate tests to Playwright (#25524)
- Loading branch information
1 parent
50d806e
commit ab63623
Showing
83 changed files
with
129 additions
and
556 deletions.
There are no files selected for viewing
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,42 @@ | ||
import { expect } from '@playwright/test'; | ||
import { test } from '@utils/test/playwright'; | ||
|
||
test.describe('accordion: a11y', () => { | ||
test('accordions should be keyboard navigable', async ({ page, browserName }) => { | ||
// TODO(FW-1764): remove skip once issue is resolved | ||
test.skip(browserName === 'firefox', 'https://github.com/ionic-team/ionic-framework/issues/25529'); | ||
|
||
await page.goto(`/src/components/accordion/test/a11y`); | ||
const tabKey = browserName === 'webkit' ? 'Alt+Tab' : 'Tab'; | ||
|
||
const personalInfoHeader = page.locator('ion-accordion:first-child > ion-item'); | ||
const billingAddressHeader = page.locator('ion-accordion:nth-child(2) > ion-item'); | ||
const shippingAddressHeader = page.locator('ion-accordion:nth-child(3) > ion-item'); | ||
const addressInput = page.locator('#address1 input'); | ||
|
||
await page.keyboard.press(tabKey); | ||
await expect(personalInfoHeader).toBeFocused(); | ||
|
||
await page.keyboard.press('ArrowDown'); | ||
await expect(billingAddressHeader).toBeFocused(); | ||
|
||
await page.keyboard.press('ArrowDown'); | ||
await expect(shippingAddressHeader).toBeFocused(); | ||
|
||
await page.keyboard.press('ArrowDown'); | ||
await expect(personalInfoHeader).toBeFocused(); | ||
|
||
await page.keyboard.press('ArrowUp'); | ||
await expect(shippingAddressHeader).toBeFocused(); | ||
|
||
// open Shipping Address accordion and move focus to the input inside it | ||
await page.keyboard.press('Enter'); | ||
await page.waitForChanges(); | ||
await page.keyboard.press(tabKey); | ||
await expect(addressInput).toBeFocused(); | ||
|
||
// ensure keyboard interaction doesn't move focus from body | ||
await page.keyboard.press('ArrowDown'); | ||
await expect(addressInput).toBeFocused(); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
import { expect } from '@playwright/test'; | ||
import { test } from '@utils/test/playwright'; | ||
|
||
test.describe('accordion: basic', () => { | ||
test('should not have visual regressions', async ({ page }) => { | ||
await page.goto(`/src/components/accordion/test/basic`); | ||
|
||
await page.setIonViewport(); | ||
|
||
expect(await page.screenshot()).toMatchSnapshot(`accordion-basic-${page.getSnapshotSettings()}.png`); | ||
}); | ||
}); |
Binary file added
BIN
+275 KB
...asic/accordion.e2e.ts-snapshots/accordion-basic-ios-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+88.4 KB
...sic/accordion.e2e.ts-snapshots/accordion-basic-ios-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+244 KB
...asic/accordion.e2e.ts-snapshots/accordion-basic-ios-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+275 KB
...asic/accordion.e2e.ts-snapshots/accordion-basic-ios-rtl-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+88 KB
...sic/accordion.e2e.ts-snapshots/accordion-basic-ios-rtl-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+244 KB
...asic/accordion.e2e.ts-snapshots/accordion-basic-ios-rtl-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+255 KB
...basic/accordion.e2e.ts-snapshots/accordion-basic-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85 KB
...asic/accordion.e2e.ts-snapshots/accordion-basic-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+229 KB
...basic/accordion.e2e.ts-snapshots/accordion-basic-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+255 KB
...basic/accordion.e2e.ts-snapshots/accordion-basic-md-rtl-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.6 KB
...asic/accordion.e2e.ts-snapshots/accordion-basic-md-rtl-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+229 KB
...basic/accordion.e2e.ts-snapshots/accordion-basic-md-rtl-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.