Skip to content

Commit d9eb400

Browse files
committed
test(toolbar): fix flaky tests for toolbar
1 parent 0f2c698 commit d9eb400

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

core/src/components/toolbar/test/basic/toolbar.e2e.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ configs({ modes: ['ios', 'md', 'ionic-md'], palettes: ['light', 'dark'] }).forEa
8686
await expect(header).toHaveScreenshot(screenshot(`toolbar-basic-icon-buttons`));
8787
});
8888

89-
test('should not have visual regressions with buttons with icons and text', async ({ page }) => {
89+
test('should not have visual regressions with buttons with icons and text', async ({ page, skip }) => {
90+
skip.browser('webkit', 'Safari does not consistently render overflowing text in a toolbar with icons and text.');
91+
9092
await page.setContent(
9193
`
9294
<ion-header>
@@ -216,6 +218,10 @@ configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ ti
216218
config
217219
);
218220

221+
// Wait for images to be visible
222+
await page.locator('img').first().waitFor({ state: 'visible' });
223+
await page.locator('ion-img').first().waitFor({ state: 'visible' });
224+
219225
const header = page.locator('ion-header');
220226
await expect(header).toHaveScreenshot(screenshot(`toolbar-basic-slotted-images`));
221227
});
@@ -238,6 +244,10 @@ configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ ti
238244
config
239245
);
240246

247+
// Wait for images to be visible
248+
await page.locator('img').first().waitFor({ state: 'visible' });
249+
await page.locator('ion-img').first().waitFor({ state: 'visible' });
250+
241251
const header = page.locator('ion-header');
242252
await expect(header).toHaveScreenshot(screenshot(`toolbar-basic-nested-slotted-images`));
243253
});

0 commit comments

Comments
 (0)