From 00c3a4431af9c1c1f1841a18a9059a308a855dcf Mon Sep 17 00:00:00 2001 From: Shawn Taylor Date: Thu, 2 Nov 2023 15:02:12 -0400 Subject: [PATCH] test(picker-internal): reduce flakiness of picker internal screenshot test (#28456) Issue number: N/A --------- Sometimes the screenshot gets captured as ![actual](https://github.com/ionic-team/ionic-framework/assets/14926794/dd596788-f871-45b8-ad0b-f8d3682404e4) when it should be ![expected](https://github.com/ionic-team/ionic-framework/assets/14926794/4807e447-3a02-44e5-95a3-04f1ee742072) - Hopefully the screenshot will be more consistent. - [ ] Yes - [x] No --- .../picker-internal/test/basic/picker-internal.e2e.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/components/picker-internal/test/basic/picker-internal.e2e.ts b/core/src/components/picker-internal/test/basic/picker-internal.e2e.ts index 63e079e59c..13847442e6 100644 --- a/core/src/components/picker-internal/test/basic/picker-internal.e2e.ts +++ b/core/src/components/picker-internal/test/basic/picker-internal.e2e.ts @@ -9,6 +9,14 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { test('inline pickers should not have visual regression', async ({ page }) => { await page.goto(`/src/components/picker-internal/test/basic`, config); + const fullStack = page.locator('#inline button[data-value="full-stack"]'); + const onion = page.locator('#inline button[data-value="onion"]'); + + await expect(fullStack).toHaveClass(/picker-item-active/); + await expect(onion).toHaveClass(/picker-item-active/); + + await page.waitForChanges(); + await expect(page.locator('#inline')).toHaveScreenshot(screenshot(`picker-internal-inline-diff`)); }); });