test(searchbar): flaky searchbar screenshot capture (#26428)

This commit is contained in:
Sean Perkins
2022-12-07 11:35:57 -05:00
committed by GitHub
parent e0e9dc7be6
commit 47369fadd4

View File

@@ -8,6 +8,16 @@ test.describe('searchbar: basic', () => {
test('should not have visual regressions', async ({ page }) => {
await page.setIonViewport();
/**
* The searchbar test template is rendering an ion-searchbar
* that is animated. This requires the searchbar to render,
* before the cancel button can be positioned correctly.
*
* We wait for changes to ensure the searchbar has rendered
* correctly before capturing the screenshot.
*/
await page.waitForChanges();
expect(await page.screenshot({ animations: 'disabled' })).toMatchSnapshot(
`searchbar-diff-${page.getSnapshotSettings()}.png`
);