diff --git a/src/core/drive/visit.js b/src/core/drive/visit.js index 3adad253c..ec7565979 100644 --- a/src/core/drive/visit.js +++ b/src/core/drive/visit.js @@ -136,11 +136,11 @@ export class Visit { complete() { if (this.state == VisitState.started) { this.recordTimingMetric(TimingMetric.visitEnd) + this.adapter.visitCompleted(this) this.state = VisitState.completed this.followRedirect() if (!this.followedRedirect) { - this.adapter.visitCompleted(this) this.delegate.visitCompleted(this) } } diff --git a/src/tests/functional/navigation_tests.js b/src/tests/functional/navigation_tests.js index cdbc90e22..e1aa7e757 100644 --- a/src/tests/functional/navigation_tests.js +++ b/src/tests/functional/navigation_tests.js @@ -379,6 +379,7 @@ test("following a redirection", async ({ page }) => { await nextBody(page) assert.equal(pathname(page.url()), "/src/tests/fixtures/one.html") assert.equal(await visitAction(page), "replace") + await waitUntilNoSelector(page, ".turbo-progress-bar") }) test("clicking the back button after redirection", async ({ page }) => {