Skip to content

Commit 049e766

Browse files
committed
fix(e2e): wait for select to be enabled in screenshot generator
Match the logic in servers.spec.ts - wait for select to be enabled (servers connected) instead of just visible.
1 parent ff0ae1a commit 049e766

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

tests/e2e/generate-grid-screenshots.spec.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* integration-server is excluded (it's for E2E testing, same UI as basic-server-react).
1111
*/
1212

13-
import { test, type Page } from "@playwright/test";
13+
import { test, expect, type Page } from "@playwright/test";
1414
import * as path from "path";
1515
import * as fs from "fs";
1616
import sharp from "sharp";
@@ -95,12 +95,9 @@ async function waitForAppLoad(page: Page) {
9595
*/
9696
async function loadServer(page: Page, serverName: string) {
9797
await page.goto("/");
98-
await page
99-
.locator("select")
100-
.nth(0)
101-
.waitFor({ state: "visible", timeout: 30000 });
102-
await page.waitForTimeout(500);
103-
await page.locator("select").nth(0).selectOption({ label: serverName });
98+
// Wait for servers to connect (select becomes enabled when servers are ready)
99+
await expect(page.locator("select").first()).toBeEnabled({ timeout: 30000 });
100+
await page.locator("select").first().selectOption({ label: serverName });
104101
await page.click('button:has-text("Call Tool")');
105102
await waitForAppLoad(page);
106103
}

0 commit comments

Comments
 (0)