test: hydrate demand workspace after release reloads
Some checks failed
CI / lint (pull_request) Successful in 3m56s
CI / build-release (pull_request) Successful in 7s
CI / browser-journey (pull_request) Failing after 7m16s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy 2026-08-27 12:22:42 +00:00
parent 8909bedd78
commit 4a99f54f12
3 changed files with 10 additions and 1 deletions

View File

@ -127,6 +127,8 @@ def test_release_artifact_reopens_human_gates_with_one_fresh_mobile_snapshot(
popup.close() popup.close()
page.reload(wait_until="networkidle") page.reload(wait_until="networkidle")
hydrate_workspace(page)
page.wait_for_load_state("networkidle")
page.evaluate("document.querySelector('#open-human-gates').click()") page.evaluate("document.querySelector('#open-human-gates').click()")
expect(page.locator("#human-gates")).to_be_visible() expect(page.locator("#human-gates")).to_be_visible()
expect(page.locator('[data-gate-checklist="exact_hash"]')).to_be_checked() expect(page.locator('[data-gate-checklist="exact_hash"]')).to_be_checked()
@ -148,6 +150,8 @@ def test_release_artifact_reopens_human_gates_with_one_fresh_mobile_snapshot(
assert len(decision_requests) == 1 assert len(decision_requests) == 1
page.reload(wait_until="networkidle") page.reload(wait_until="networkidle")
hydrate_workspace(page)
page.wait_for_load_state("networkidle")
page.evaluate("document.querySelector('#open-human-gates').click()") page.evaluate("document.querySelector('#open-human-gates').click()")
expect(page.locator("#human-gates")).to_be_visible() expect(page.locator("#human-gates")).to_be_visible()
expect(page.locator("#human-gate-detail")).to_contain_text("Decision outcome unknown") expect(page.locator("#human-gate-detail")).to_contain_text("Decision outcome unknown")
@ -246,6 +250,7 @@ def test_release_artifact_reviews_live_human_gate_history_and_receipt_on_phone(t
page.locator("#submit-sign-in").click() page.locator("#submit-sign-in").click()
page.wait_for_url(origin + "/", wait_until="networkidle") page.wait_for_url(origin + "/", wait_until="networkidle")
hydrate_workspace(page) hydrate_workspace(page)
page.wait_for_load_state("networkidle")
page.evaluate("document.querySelector('#open-human-gates').click()") page.evaluate("document.querySelector('#open-human-gates').click()")
expect(page.locator("#human-gates")).to_be_visible() expect(page.locator("#human-gates")).to_be_visible()
cached_before = page.evaluate("Object.keys(localStorage).sort()") cached_before = page.evaluate("Object.keys(localStorage).sort()")

View File

@ -282,6 +282,7 @@ def test_release_artifact_files_one_mobile_issue_exactly_once_after_offline_relo
assert fake.created_issues == [] assert fake.created_issues == []
page.reload(wait_until="domcontentloaded") page.reload(wait_until="domcontentloaded")
hydrate_workspace(page)
expect(page.locator('[data-mobile-task="new"]')).to_be_visible() expect(page.locator('[data-mobile-task="new"]')).to_be_visible()
durable_after_reload = indexed_issue_records(page) durable_after_reload = indexed_issue_records(page)
assert [(item["title"], item["body"]) for item in durable_after_reload] == [(TITLE, BODY)] assert [(item["title"], item["body"]) for item in durable_after_reload] == [(TITLE, BODY)]

View File

@ -12,7 +12,7 @@ pytest.importorskip("playwright.sync_api")
from playwright.sync_api import expect, sync_playwright from playwright.sync_api import expect, sync_playwright
from fake_gitea import FakeGiteaServer from fake_gitea import FakeGiteaServer
from test_mobile_offline_issue_release import ACCESS_TOKEN, ROOT, release_server from test_mobile_offline_issue_release import ACCESS_TOKEN, ROOT, hydrate_workspace, release_server
def open_today_action(page, selector: str): def open_today_action(page, selector: str):
@ -269,6 +269,7 @@ def test_release_artifact_plans_hands_off_and_opens_next_mobile_issue(tmp_path:
localStorage.setItem(prefix + 'broken', '{not-json'); localStorage.setItem(prefix + 'broken', '{not-json');
}""") }""")
page.reload(wait_until="networkidle") page.reload(wait_until="networkidle")
hydrate_workspace(page)
expect(page.locator("#my-work-status")).to_contain_text("2") expect(page.locator("#my-work-status")).to_contain_text("2")
expect(page.locator("#today-sync-status")).to_have_text( expect(page.locator("#today-sync-status")).to_have_text(
"Today queue recovered · discarded 1 unreadable device record." "Today queue recovered · discarded 1 unreadable device record."
@ -446,6 +447,7 @@ def test_release_artifact_pauses_today_across_mobile_work_and_insights_detours(t
return timer.entries[timer.active_identity].running === false && timer.detour_interruption?.reason === 'insights'; return timer.entries[timer.active_identity].running === false && timer.detour_interruption?.reason === 'insights';
}""") }""")
page.reload(wait_until="networkidle") page.reload(wait_until="networkidle")
hydrate_workspace(page)
restored_pause = page.locator("#insights-sheet > [data-today-detour]") restored_pause = page.locator("#insights-sheet > [data-today-detour]")
expect(restored_pause).to_be_visible() expect(restored_pause).to_be_visible()
expect(restored_pause).to_contain_text("Today paused · Ship mobile capture") expect(restored_pause).to_contain_text("Today paused · Ship mobile capture")
@ -562,6 +564,7 @@ def test_release_artifact_recovers_admitted_blocker_after_reload_and_opens_next_
})); }));
}""") }""")
page.reload(wait_until="networkidle") page.reload(wait_until="networkidle")
hydrate_workspace(page)
expect(page.locator("#my-work-status")).to_contain_text("2") expect(page.locator("#my-work-status")).to_contain_text("2")
if page.locator("#issue-sheet").get_attribute("class") == "issue-sheet open": if page.locator("#issue-sheet").get_attribute("class") == "issue-sheet open":
page.locator("#close-issue-sheet").click() page.locator("#close-issue-sheet").click()