Hi @inanc
Here we are -
All ran as headless: false,
and only
await Promise.all([page.click('button#loginButton')]);
- With
slowMo: '100ms'
and sleep(2)
after page.click:
ERRO[0049] Uncaught (in promise) GoError: getting text content of ".body-container #page-header h2": timed out after 30s
running at reflect.methodValueCall (native)
default at _callee$ (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:29:41(131))
at call (native)
at tryCatch (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(9))
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(101)
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(5)
at asyncGeneratorStep (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(6))
at _next (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(10)) executor=per-vu-iterations
scenario=default
When ran as headless: true
– the test passes and is able to assert for the header.textContent()
- Ran with
slowMo: '100ms'
without sleep(2)
:
ERRO[0120] communicating with browser: websocket: close 1006 (abnormal closure): unexpected EOF category=cdp elapsed="0 ms" goroutine=114
ERRO[0120] process with PID 85373 unexpectedly ended: signal: killed category=browser elapsed="2 ms" goroutine=63
ERRO[0120] Uncaught (in promise) GoError: disposing browser context: disposing browser context ID BA0D09523CB19EDC6BD61961990D22C0: websocket: close 1006 (abnormal closure): unexpected EOF
default at github.com/grafana/xk6-browser/api.Page.Close-fm (native)
at _callee$ (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:33:14(150))
at call (native)
at tryCatch (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(9))
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(101)
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(5)
at asyncGeneratorStep (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(6))
at _next (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(10)) executor=per-vu-iterations
scenario=default
Tried running as headless:true
- also failing but different error
ERRO[0013] Uncaught (in promise) GoError: getting text content of ".body-container #page-header h2": execution context changed; most likely because of a navigation
default at reflect.methodValueCall (native)
at _callee$ (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:29:41(125))
at call (native)
at tryCatch (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(9))
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(101)
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(5)
at asyncGeneratorStep (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(6))
at _next (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(10)) executor=per-vu-iterations
scenario=default
- With
sleep(2)
but without slowMo: '100ms'
. Error is
ERRO[0049] Uncaught (in promise) GoError: getting text content of ".body-container #page-header h2": timed out after 30s
running at reflect.methodValueCall (native)
default at _callee$ (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:29:41(129))
at call (native)
at tryCatch (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(9))
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(101)
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(5)
at asyncGeneratorStep (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(6))
at _next (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(10)) executor=per-vu-iterations
scenario=default
Ran as headless: true
and the test passed for header.textContent()
!
- Finally, without
sleep
and without slowMo
. Got an error
ERRO[0120] communicating with browser: websocket: close 1006 (abnormal closure): unexpected EOF category=cdp elapsed="0 ms" goroutine=113
ERRO[0120] process with PID 85872 unexpectedly ended: signal: killed category=browser elapsed="1 ms" goroutine=75
ERRO[0120] Uncaught (in promise) GoError: disposing browser context: disposing browser context ID B9542BBB81877BF4B6AB6BF001B2A845: websocket: close 1006 (abnormal closure): unexpected EOF
default at github.com/grafana/xk6-browser/api.Page.Close-fm (native)
at _callee$ (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:33:14(148))
at call (native)
at tryCatch (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(9))
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(101)
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(5)
at asyncGeneratorStep (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(6))
at _next (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(10)) executor=per-vu-iterations
scenario=default
running (02m00.0s), 0/1 VUs, 1 complete and 0 interrupted iterations
When set to headless: true
, got an error but different from the one in non-headless:
ERRO[0014] Uncaught (in promise) GoError: getting text content of ".body-container #page-header h2": execution context changed; most likely because of a navigation
default at reflect.methodValueCall (native)
at _callee$ (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:29:41(123))
at call (native)
at tryCatch (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(9))
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(101)
at webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(5)
at asyncGeneratorStep (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(6))
at _next (webpack://@automation-k6-platforms/./src/example/feSample.test.ts:2:0(10)) executor=per-vu-iterations
scenario=default
running (00m14.2s), 0/1 VUs, 1 complete and 0 interrupted iterations
Hope this helps