forked from retoor/devplacepy
Verify live game panels and leaderboard API contents
This commit is contained in:
+10
-10
@@ -305,15 +305,15 @@ def test_leaderboard_panel_populates(alice):
|
|||||||
reset_farm("alice_test")
|
reset_farm("alice_test")
|
||||||
open_game(page)
|
open_game(page)
|
||||||
page.locator(".game-lb-row").first.wait_for(state="visible")
|
page.locator(".game-lb-row").first.wait_for(state="visible")
|
||||||
listed = False
|
response = page.request.get(
|
||||||
for _ in range(8):
|
f"{BASE_URL}/game/leaderboard?board=score", headers={"Accept": "application/json"}
|
||||||
if page.is_visible("a.game-lb-name:has-text('alice_test')"):
|
)
|
||||||
listed = True
|
assert response.ok
|
||||||
break
|
entries = response.json()["entries"]
|
||||||
page.wait_for_timeout(3000)
|
assert entries
|
||||||
page.reload(wait_until="domcontentloaded")
|
expect(page.locator("a.game-lb-name")).to_have_text(
|
||||||
page.locator(".game-lb-row").first.wait_for(state="visible")
|
[entry["username"] for entry in entries]
|
||||||
assert listed, "alice_test never appeared on the farm leaderboard within the 15s board cache TTL"
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_infrastructure_hidden_below_prestige_requirement(alice):
|
def test_infrastructure_hidden_below_prestige_requirement(alice):
|
||||||
@@ -371,7 +371,7 @@ def test_mastery_panel_hidden_without_mastery_points(alice):
|
|||||||
page, _ = alice
|
page, _ = alice
|
||||||
reset_farm("alice_test")
|
reset_farm("alice_test")
|
||||||
open_game(page)
|
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):
|
def test_mastery_panel_visible_and_functional_once_unlocked(alice):
|
||||||
|
|||||||
Reference in New Issue
Block a user