Skip to content

Commit 07e118a

Browse files
committed
Add polling to ensure that tasks complete in the browser tests
1 parent bb17e66 commit 07e118a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

playwright/test.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,19 @@ def lifecycle_03_add_file(page: sync_api.Page, credentials: Credentials, version
156156

157157
logging.info(f"Navigating back to /compose/{TEST_PROJECT}/{version_name}")
158158
go_to_path(page, f"/compose/{TEST_PROJECT}/{version_name}")
159+
160+
logging.info("Extracting latest revision from compose page")
161+
revision_link_locator = page.locator(f'a[href^="/revisions/{TEST_PROJECT}/{version_name}#"]')
162+
sync_api.expect(revision_link_locator).to_be_visible()
163+
revision_href = revision_link_locator.get_attribute("href")
164+
if not revision_href:
165+
raise RuntimeError("Could not find revision link href")
166+
revision = revision_href.split("#", 1)[-1]
167+
logging.info(f"Found revision: {revision}")
168+
169+
logging.info("Polling for task completion after file upload")
170+
poll_for_tasks_completion(page, TEST_PROJECT, version_name, revision)
171+
159172
logging.info(f"Navigation back to /compose/{TEST_PROJECT}/{version_name} completed successfully")
160173

161174

@@ -794,7 +807,6 @@ def test_lifecycle_01_add_draft(page: sync_api.Page, credentials: Credentials) -
794807
lifecycle_01_add_draft(page, credentials, version_name="0.1+candidate")
795808
lifecycle_01_add_draft(page, credentials, version_name="0.1+preview")
796809
lifecycle_01_add_draft(page, credentials, version_name="0.1+release")
797-
raise RuntimeError("Deliberate failure to test CI")
798810

799811

800812
def test_lifecycle_02_check_draft_added(page: sync_api.Page, credentials: Credentials) -> None:

0 commit comments

Comments
 (0)