Verify live game panels and leaderboard API contents

This commit is contained in:
2026-10-19 21:46:36 +02:00
parent 8155f394bd
commit 213cb833ef
+10 -10
View File
@@ -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):