Skip to content

Commit

Permalink
test: Update collection revision e2e test timeout (#6052)
Browse files Browse the repository at this point in the history
  • Loading branch information
tihuan authored Oct 23, 2023
1 parent 7dd965e commit 1f8b142
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions frontend/tests/features/collection/revision.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ describe("Collection Revision @loggedIn", () => {
});
});

/**
* (thuang): Wait for 1 min instead of the default 3 minutes, so we fail faster
*/
const WAIT_FOR_MIN_USABLE_COLLECTION_TIMEOUT_MS = 1 * 60 * 1000; // 1 minute

async function startRevision(page: Page): Promise<string> {
const MIN_USABLE_COLLECTION_COUNT = 4;

Expand All @@ -183,16 +188,23 @@ async function startRevision(page: Page): Promise<string> {
{ page }
);
} catch {
await page
.getByTestId(COLLECTION_ROW_WRITE_REVISION_ID)
.first()
.getByTestId(COLLECTION_VIEW_REVISION)
.click();
await deleteRevision(page);
const hasAnyRevision =
(await page.getByTestId(COLLECTION_ROW_WRITE_REVISION_ID).count()) >
0;

if (hasAnyRevision) {
await page
.getByTestId(COLLECTION_ROW_WRITE_REVISION_ID)
.first()
.getByTestId(COLLECTION_VIEW_REVISION)
.click();
await deleteRevision(page);
}

throw new Error("No available collection");
}
},
{ page }
{ page, timeoutMs: WAIT_FOR_MIN_USABLE_COLLECTION_TIMEOUT_MS }
);

// (thuang): We randomly select a collection row to start a revision
Expand Down

0 comments on commit 1f8b142

Please sign in to comment.