Skip to content

Commit 07fc1ab

Browse files
authored
Merge pull request #1 from dragid10/fix-playwright-tests
2 parents 5bf3807 + 90e624c commit 07fc1ab

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tests/test.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import time
2-
31
import pytest
42
from playwright.sync_api import Page, expect
53

@@ -14,13 +12,6 @@
1412
]
1513

1614

17-
# Add a delay to each test to help with playwright race conditions
18-
@pytest.fixture(autouse=True)
19-
def slow_down_tests():
20-
yield
21-
time.sleep(1)
22-
23-
2415
@pytest.mark.parametrize("url", routes)
2516
def test_destination(
2617
page: Page,
@@ -29,7 +20,8 @@ def test_destination(
2920
"""Test that the destinations page loads with seeded data"""
3021
# Create a destination
3122
response = page.goto(f"{live_server_url}/{url}")
32-
page.on("response", lambda response: expect(response.status).to_equal(200))
23+
24+
assert response.status == 200 # Check that the page loaded successfully
3325
assert response.url.endswith(f"/{url}/") # Load the index.html
3426

3527

0 commit comments

Comments
 (0)