Skip to content

Commit 26be1ee

Browse files
committed
Fix e2e tests to be more consistent
- We would count the number of panels before we were waiting for the "Panels" button to be visible, which would sometimes be incorrect if the loading spinner had flashed/disappeared - Just count the number of panels right before we click the "Panels" button - deephaven/web-client-ui#2569 should also fix it from UI side, but this fixes the issue on the deephaven-plugins side
1 parent db8747d commit 26be1ee

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

tests/utils.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ export async function gotoPage(
2727
): Promise<void> {
2828
await test.step(`Go to page (${url})`, async () => {
2929
await page.goto(url, options);
30-
// Check the page loaded by waiting for the panels button to be visible
31-
await expect(
32-
page.getByRole('button', {
33-
name: 'Panels',
34-
exact: true,
35-
})
36-
).toBeVisible({ timeout: 30000 });
3730
// Wait for any loading progress bars to disappear
3831
await expect(
3932
page.getByRole('progressbar', { name: 'Loading...', exact: true })
@@ -63,14 +56,16 @@ export async function openPanel(
6356
awaitLoad = true
6457
): Promise<void> {
6558
await test.step(`Open panel (${name})`, async () => {
66-
const panelCount = await page.locator(panelLocator).count();
67-
6859
// open app panels menu
6960
const appPanels = page.getByRole('button', {
7061
name: 'Panels',
7162
exact: true,
7263
});
7364
await expect(appPanels).toBeEnabled();
65+
66+
// Count how many panels are open before opening a new one
67+
const panelCount = await page.locator(panelLocator).count();
68+
7469
await appPanels.click();
7570

7671
// search for the panel in list

0 commit comments

Comments
 (0)