Skip to content

Commit

Permalink
Resolve timing-based CI failure
Browse files Browse the repository at this point in the history
Browser tests periodically fail due to a timing issue:

```
1) [firefox] › functional/frame_tests.js:190:5 › failing to follow a link to a page without a matching frame shows an error and throws an exception

    AssertionError: expected 'Missing frame Missing page Unvisitabl…' to match /Content missing/

      196 |   await page.click("#missing-page-link")
      197 |
    > 198 |   assert.match(await page.innerText("#missing"), /Content missing/)
          |          ^
      199 |
      200 |   assert.exists(error)
      201 |   assert.include(error.message, `The response (404) did not contain the expected <turbo-frame id="missing">`)
```

This commit replaces the `assert`-based assertion with an `expect`-based
Playwright assertion that will utilize retries and timing
synchronization.

[CI failure]: https://github.com/hotwired/turbo/actions/runs/10603228414/job/29387060926?pr=1306#step:11:18
  • Loading branch information
seanpdoyle committed Aug 28, 2024
1 parent c6ec8d3 commit 391452f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tests/functional/frame_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ test("successfully following a link to a page without a matching frame shows an

await page.click("#missing-frame-link")

assert.match(await page.innerText("#missing"), /Content missing/)
await expect(page.locator("#missing")).toHaveText("Content missing")

assert.exists(error)
assert.include(error.message, `The response (200) did not contain the expected <turbo-frame id="missing">`)
Expand Down Expand Up @@ -195,7 +195,7 @@ test("failing to follow a link to a page without a matching frame shows an error

await page.click("#missing-page-link")

assert.match(await page.innerText("#missing"), /Content missing/)
await expect(page.locator("#missing")).toHaveText("Content missing")

assert.exists(error)
assert.include(error.message, `The response (404) did not contain the expected <turbo-frame id="missing">`)
Expand Down

0 comments on commit 391452f

Please sign in to comment.