Skip to content

Commit 1a0c4ce

Browse files
committed
test(item-sliding): improve visibility check
1 parent 324394f commit 1a0c4ce

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

core/src/components/item-sliding/test/hue/item-sliding.e2e.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,13 @@ configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screens
6565
config
6666
);
6767

68-
// Wait for web components to hydrate
69-
await page.waitForFunction(() => customElements.get('ion-item-sliding') !== undefined);
70-
7168
await page.evaluate(() => {
7269
const items = document.querySelectorAll('ion-item-sliding');
7370
items.forEach((item: any) => item.open('start'));
7471
});
7572

7673
// Wait for options to be visible
77-
await page.waitForTimeout(500);
74+
await page.waitForSelector('ion-item-options:visible', { state: 'visible' });
7875

7976
await expect(page.locator('ion-list')).toHaveScreenshot(screenshot('item-option-hue-subtle'));
8077
});
@@ -141,16 +138,13 @@ configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screens
141138
config
142139
);
143140

144-
// Wait for web components to hydrate
145-
await page.waitForFunction(() => customElements.get('ion-item-sliding') !== undefined);
146-
147141
await page.evaluate(() => {
148142
const items = document.querySelectorAll('ion-item-sliding');
149143
items.forEach((item: any) => item.open('start'));
150144
});
151145

152146
// Wait for options to be visible
153-
await page.waitForTimeout(500);
147+
await page.waitForSelector('ion-item-options:visible', { state: 'visible' });
154148

155149
await expect(page.locator('ion-list')).toHaveScreenshot(screenshot('item-option-hue-bold'));
156150
});

0 commit comments

Comments
 (0)