Skip to content

Commit 0115c29

Browse files
committed
feat: add xterm.focus check in CodeServer
1 parent 9cc8604 commit 0115c29

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/e2e/models/CodeServer.ts

+13
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ export class CodeServer {
6363
const isTerminalVisible = await this.page.isVisible("#terminal")
6464
if (isTerminalVisible) {
6565
await this.page.keyboard.press(`Control+Backquote`)
66+
// Wait for terminal to receive focus
67+
await this.page.waitForSelector("div.terminal.xterm.focus")
68+
// Sometimes the terminal reloads
69+
// which is why we wait for it twice
70+
await this.page.waitForSelector("div.terminal.xterm.focus")
6671
return
6772
}
6873
// Open using the manu
@@ -76,6 +81,14 @@ export class CodeServer {
7681
// Click text=Terminal
7782
await this.page.hover("text=Terminal")
7883
await this.page.click("text=Terminal")
84+
85+
// Wait for terminal to receive focus
86+
// Sometimes the terminal reloads once or twice
87+
// which is why we wati for it to have the focus class
88+
await this.page.waitForSelector("div.terminal.xterm.focus")
89+
// Sometimes the terminal reloads
90+
// which is why we wait for it twice
91+
await this.page.waitForSelector("div.terminal.xterm.focus")
7992
}
8093

8194
/**

0 commit comments

Comments
 (0)