From 0d3d08bf027483450b82a5c2e71995eb063f06cf Mon Sep 17 00:00:00 2001 From: "Ross A. Wollman" Date: Wed, 1 Jun 2022 10:07:44 -0400 Subject: [PATCH] test: unflake test_assertions_page_to_have_{title,url} Fixes #1275 --- tests/async/test_assertions.py | 22 +++++++++++----------- tests/sync/test_assertions.py | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/async/test_assertions.py b/tests/async/test_assertions.py index 17e24dbd1..224568f3a 100644 --- a/tests/async/test_assertions.py +++ b/tests/async/test_assertions.py @@ -27,16 +27,16 @@ async def test_assertions_page_to_have_title(page: Page, server: Server) -> None await expect(page).to_have_title("new title") await expect(page).to_have_title(re.compile("new title")) with pytest.raises(AssertionError): - await expect(page).to_have_title("not the current title", timeout=100) + await expect(page).to_have_title("not the current title", timeout=750) with pytest.raises(AssertionError): await expect(page).to_have_title( - re.compile("not the current title"), timeout=100 + re.compile("not the current title"), timeout=750 ) with pytest.raises(AssertionError): - await expect(page).not_to_have_title(re.compile("new title"), timeout=100) + await expect(page).not_to_have_title(re.compile("new title"), timeout=750) with pytest.raises(AssertionError): - await expect(page).not_to_have_title("new title", timeout=100) - await expect(page).not_to_have_title("great title", timeout=100) + await expect(page).not_to_have_title("new title", timeout=750) + await expect(page).not_to_have_title("great title", timeout=750) await page.evaluate( """ setTimeout(() => { @@ -53,9 +53,9 @@ async def test_assertions_page_to_have_url(page: Page, server: Server) -> None: await expect(page).to_have_url(server.EMPTY_PAGE) await expect(page).to_have_url(re.compile(r".*/empty\.html")) with pytest.raises(AssertionError): - await expect(page).to_have_url("nooooo", timeout=100) + await expect(page).to_have_url("nooooo", timeout=750) with pytest.raises(AssertionError): - await expect(page).to_have_url(re.compile("not-the-url"), timeout=100) + await expect(page).to_have_url(re.compile("not-the-url"), timeout=750) await page.evaluate( """ setTimeout(() => { @@ -64,13 +64,13 @@ async def test_assertions_page_to_have_url(page: Page, server: Server) -> None: """ ) await expect(page).to_have_url(server.PREFIX + "/grid.html") - await expect(page).not_to_have_url(server.EMPTY_PAGE, timeout=100) + await expect(page).not_to_have_url(server.EMPTY_PAGE, timeout=750) with pytest.raises(AssertionError): - await expect(page).not_to_have_url(re.compile(r".*/grid\.html"), timeout=100) + await expect(page).not_to_have_url(re.compile(r".*/grid\.html"), timeout=750) with pytest.raises(AssertionError): - await expect(page).not_to_have_url(server.PREFIX + "/grid.html", timeout=100) + await expect(page).not_to_have_url(server.PREFIX + "/grid.html", timeout=750) await expect(page).to_have_url(re.compile(r".*/grid\.html")) - await expect(page).not_to_have_url("**/empty.html", timeout=100) + await expect(page).not_to_have_url("**/empty.html", timeout=750) async def test_assertions_page_to_have_url_with_base_url( diff --git a/tests/sync/test_assertions.py b/tests/sync/test_assertions.py index bd582abef..b52700dc0 100644 --- a/tests/sync/test_assertions.py +++ b/tests/sync/test_assertions.py @@ -27,14 +27,14 @@ def test_assertions_page_to_have_title(page: Page, server: Server) -> None: expect(page).to_have_title("new title") expect(page).to_have_title(re.compile("new title")) with pytest.raises(AssertionError): - expect(page).to_have_title("not the current title", timeout=100) + expect(page).to_have_title("not the current title", timeout=750) with pytest.raises(AssertionError): - expect(page).to_have_title(re.compile("not the current title"), timeout=100) + expect(page).to_have_title(re.compile("not the current title"), timeout=750) with pytest.raises(AssertionError): - expect(page).not_to_have_title(re.compile("new title"), timeout=100) + expect(page).not_to_have_title(re.compile("new title"), timeout=750) with pytest.raises(AssertionError): - expect(page).not_to_have_title("new title", timeout=100) - expect(page).not_to_have_title("great title", timeout=100) + expect(page).not_to_have_title("new title", timeout=750) + expect(page).not_to_have_title("great title", timeout=750) page.evaluate( """ setTimeout(() => { @@ -51,9 +51,9 @@ def test_assertions_page_to_have_url(page: Page, server: Server) -> None: expect(page).to_have_url(server.EMPTY_PAGE) expect(page).to_have_url(re.compile(r".*/empty\.html")) with pytest.raises(AssertionError): - expect(page).to_have_url("nooooo", timeout=100) + expect(page).to_have_url("nooooo", timeout=750) with pytest.raises(AssertionError): - expect(page).to_have_url(re.compile("not-the-url"), timeout=100) + expect(page).to_have_url(re.compile("not-the-url"), timeout=750) page.evaluate( """ setTimeout(() => { @@ -62,13 +62,13 @@ def test_assertions_page_to_have_url(page: Page, server: Server) -> None: """ ) expect(page).to_have_url(server.PREFIX + "/grid.html") - expect(page).not_to_have_url(server.EMPTY_PAGE, timeout=100) + expect(page).not_to_have_url(server.EMPTY_PAGE, timeout=750) with pytest.raises(AssertionError): - expect(page).not_to_have_url(re.compile(r".*/grid\.html"), timeout=100) + expect(page).not_to_have_url(re.compile(r".*/grid\.html"), timeout=750) with pytest.raises(AssertionError): - expect(page).not_to_have_url(server.PREFIX + "/grid.html", timeout=100) + expect(page).not_to_have_url(server.PREFIX + "/grid.html", timeout=750) expect(page).to_have_url(re.compile(r".*/grid\.html")) - expect(page).not_to_have_url("**/empty.html", timeout=100) + expect(page).not_to_have_url("**/empty.html", timeout=750) def test_assertions_page_to_have_url_with_base_url(