Skip to content

Commit

Permalink
Update async page tests
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed May 29, 2024
1 parent c52a7d2 commit 3d8d4f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/browser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func TestBrowserCrashErr(t *testing.T) {
vu.SetVar(t, "browser", jsMod.Browser)
_, err := vu.RunAsync(t, `
const p = await browser.newPage();
p.close();
await p.close();
`)
assert.ErrorContains(t, err, "launching browser: Invalid devtools server port")
}
Expand Down
2 changes: 1 addition & 1 deletion tests/browser_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestBrowserTypeLaunchToConnect(t *testing.T) {
vu.SetVar(t, "browser", jsMod.Browser)
_, err := vu.RunAsync(t, `
const p = await browser.newPage();
p.close();
await p.close();
`)
require.NoError(t, err)

Expand Down
6 changes: 3 additions & 3 deletions tests/page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ func TestPageEvaluateMappingError(t *testing.T) {
vu.SetVar(t, "p", &goja.Object{})
_, err := vu.RunAsync(t, `
p = await browser.newPage()
p.evaluate(%s)
await p.evaluate(%s)
`, tt.script)
assert.ErrorContains(t, err, tt.wantErr)

// Test script as string input
_, err = vu.RunAsync(t, `
p.evaluate("%s")
await p.evaluate("%s")
`, tt.script)
assert.ErrorContains(t, err, tt.wantErr)
})
Expand Down Expand Up @@ -1731,7 +1731,7 @@ func TestShadowDOMAndDocumentFragment(t *testing.T) {

got := vu.RunPromise(t, `
const p = await browser.newPage()
p.goto("%s/%s/shadow_and_doc_frag.html")
await p.goto("%s/%s/shadow_and_doc_frag.html")
const s = p.locator('%s')
await s.waitFor({
Expand Down

0 comments on commit 3d8d4f2

Please sign in to comment.