@@ -41,18 +41,30 @@ test("web terminal", async ({ context, page }) => {
41
41
const terminal = await pagePromise ;
42
42
await terminal . waitForLoadState ( "domcontentloaded" ) ;
43
43
44
- const xtermRows = await terminal . waitForSelector ( "div.xterm-rows" , {
44
+ await terminal . waitForSelector ( "div.xterm-rows" , {
45
45
state :"visible" ,
46
46
} ) ;
47
47
48
48
// Ensure that we can type in it
49
- await terminal . keyboard . type ( "echo he${justabreak}llo " ) ;
49
+ await terminal . keyboard . type ( "echo he${justabreak}llo123456 " ) ;
50
50
await terminal . keyboard . press ( "Enter" ) ;
51
51
52
52
// Check if "echo" command was executed
53
- await xtermRows . waitForSelector ( 'div:text-matches("hello")' , {
54
- state :"visible" ,
55
- } ) ;
53
+ // try-catch is used temporarily to find the root cause: https://github.com/coder/coder/actions/runs/6176958762/job/16767089943
54
+ try {
55
+ await terminal . waitForSelector (
56
+ 'div.xterm-rows div:text-matches("hello123456")' ,
57
+ {
58
+ state :"visible" ,
59
+ timeout :10 * 1000 ,
60
+ } ,
61
+ ) ;
62
+ } catch ( error ) {
63
+ const pageContent = await terminal . content ( ) ;
64
+ // eslint-disable-next-line no-console -- Let's see what is inside of xterm-rows
65
+ console . log ( "Unable to find echoed text:" , pageContent ) ;
66
+ throw error ;
67
+ }
56
68
57
69
await stopAgent ( agent ) ;
58
70
} ) ;