test(picker-internal): reduce flakiness of picker internal screenshot test (#28456)

Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

<!-- Please describe the current behavior that you are modifying. -->

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)

<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Hopefully the screenshot will be more consistent.

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
This commit is contained in:
Shawn Taylor
2023-11-02 15:02:12 -04:00
committed by Liam DeBeasi
parent ed040b09e9
commit 00c3a4431a

View File

@ -9,6 +9,14 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test('inline pickers should not have visual regression', async ({ page }) => { test('inline pickers should not have visual regression', async ({ page }) => {
await page.goto(`/src/components/picker-internal/test/basic`, config); 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`)); await expect(page.locator('#inline')).toHaveScreenshot(screenshot(`picker-internal-inline-diff`));
}); });
}); });