Skip to content
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

fix: Enhance test stability in drive_tests.js #993

Merged
merged 3 commits into from
Sep 14, 2023
Merged
Changes from all commits
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
7 changes: 4 additions & 3 deletions src/tests/functional/drive_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.beforeEach(async ({ page }) => {
})

test("test drive enabled by default; click normal link", async ({ page }) => {
page.click("#drive_enabled")
await page.click("#drive_enabled")
await nextBody(page)
assert.equal(pathname(page.url()), path)
})
Expand All @@ -19,16 +19,17 @@ test("test drive to external link", async ({ page }) => {
await route.fulfill({ body: "Hello from the outside world" })
})

page.click("#drive_enabled_external")
await page.click("#drive_enabled_external")
await nextBody(page)

assert.equal(await page.evaluate(() => window.location.href), "https://example.com/")
assert.equal(await page.textContent("body"), "Hello from the outside world")
})

test("test drive enabled by default; click link inside data-turbo='false'", async ({ page }) => {
page.click("#drive_disabled")
await page.click("#drive_disabled")
await nextBody(page)
AfolabiOlaoluwa marked this conversation as resolved.
Show resolved Hide resolved

assert.equal(pathname(page.url()), path)
assert.equal(await visitAction(page), "load")
})