Skip to content

test(site): e2e: improve webTerminal test #9659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test
  • Loading branch information
mtojek committed Sep 13, 2023
commit ad43665721e0540c1440f031afa0f0092ef41852
2 changes: 1 addition & 1 deletion site/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineConfig({
baseURL: `http://localhost:${port}`,
video: "retain-on-failure",
launchOptions: {
args: ["--use-angle=egl"],
args: ["--disable-gpu"],
},
},
webServer: {
Expand Down
8 changes: 6 additions & 2 deletions site/e2e/tests/webTerminal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ test("web terminal", async ({ context, page }) => {
const terminal = await pagePromise;
await terminal.waitForLoadState("domcontentloaded");

// FIXME Wait until $ is present.
const xtermRows = await terminal.waitForSelector("div.xterm-rows", {
state: "visible",
});

// Ensure that we can type in it
await terminal.keyboard.type("echo he${justabreak}llo");
await terminal.keyboard.press("Enter");

// Check if "echo" command was executed
await terminal.waitForSelector("text=hello"); // FIXME it is canvas, it won't work
await xtermRows.waitForSelector('div:text-matches("hello")', {
state: "visible",
});

await stopAgent(agent);
});