From 391452f650629445e58c3946bfd60bbef7cb5f6c Mon Sep 17 00:00:00 2001 From: Sean Doyle Date: Wed, 28 Aug 2024 15:56:18 -0400 Subject: [PATCH] Resolve timing-based CI failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 `) ``` 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 --- src/tests/functional/frame_tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/functional/frame_tests.js b/src/tests/functional/frame_tests.js index 3b0770c39..30381a52c 100644 --- a/src/tests/functional/frame_tests.js +++ b/src/tests/functional/frame_tests.js @@ -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 `) @@ -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 `)