diff --git a/tests/e2e/game/index.py b/tests/e2e/game/index.py index 4e261aa6..1be67a1e 100644 --- a/tests/e2e/game/index.py +++ b/tests/e2e/game/index.py @@ -305,15 +305,15 @@ def test_leaderboard_panel_populates(alice): reset_farm("alice_test") open_game(page) page.locator(".game-lb-row").first.wait_for(state="visible") - listed = False - for _ in range(8): - if page.is_visible("a.game-lb-name:has-text('alice_test')"): - listed = True - break - page.wait_for_timeout(3000) - page.reload(wait_until="domcontentloaded") - page.locator(".game-lb-row").first.wait_for(state="visible") - assert listed, "alice_test never appeared on the farm leaderboard within the 15s board cache TTL" + response = page.request.get( + f"{BASE_URL}/game/leaderboard?board=score", headers={"Accept": "application/json"} + ) + assert response.ok + entries = response.json()["entries"] + assert entries + expect(page.locator("a.game-lb-name")).to_have_text( + [entry["username"] for entry in entries] + ) def test_infrastructure_hidden_below_prestige_requirement(alice): @@ -371,7 +371,7 @@ def test_mastery_panel_hidden_without_mastery_points(alice): page, _ = alice reset_farm("alice_test") open_game(page) - assert page.locator(".game-mastery").count() == 0 + expect(page.locator(".game-mastery")).to_be_hidden() def test_mastery_panel_visible_and_functional_once_unlocked(alice):