Skip to content

Commit a229855

Browse files
authored
test(site): e2e: improve webTerminal test (#9659)
1 parent 4ebf490 commit a229855

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

site/e2e/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ export default defineConfig({
3434
use: {
3535
baseURL: `http://localhost:${port}`,
3636
video: "retain-on-failure",
37+
launchOptions: {
38+
args: ["--disable-webgl"],
39+
},
3740
},
3841
webServer: {
3942
url: `http://localhost:${port}/api/v2/deployment/config`,

site/e2e/tests/webTerminal.spec.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,18 @@ test("web terminal", async ({ context, page }) => {
4141
const terminal = await pagePromise;
4242
await terminal.waitForLoadState("domcontentloaded");
4343

44+
const xtermRows = await terminal.waitForSelector("div.xterm-rows", {
45+
state: "visible",
46+
});
47+
4448
// Ensure that we can type in it
45-
await terminal.keyboard.type("echo hello");
49+
await terminal.keyboard.type("echo he${justabreak}llo");
4650
await terminal.keyboard.press("Enter");
4751

48-
const locator = terminal.locator("text=hello");
52+
// Check if "echo" command was executed
53+
await xtermRows.waitForSelector('div:text-matches("hello")', {
54+
state: "visible",
55+
});
4956

50-
for (let i = 0; i < 10; i++) {
51-
const items = await locator.all();
52-
// Make sure the text came back
53-
if (items.length === 2) {
54-
break;
55-
}
56-
await new Promise((r) => setTimeout(r, 250));
57-
}
5857
await stopAgent(agent);
5958
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy