Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix e2e helper waitForRecordingToFinishIndexing() #10394

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions packages/e2e-tests/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ export async function mapLocators<T>(
}

export async function getSupportFormErrorDetails(page: Page) {
if (await page.locator('[data-test-id="SupportForm"]').isVisible()) {
let details: string = "";
if (await page.locator('[data-test-id="UnexpectedErrorDetails"]').isVisible()) {
try {
const errorDetailsLocator = page.locator('[data-test-id="UnexpectedErrorDetails"]');
if (await errorDetailsLocator.isVisible()) {
details = await errorDetailsLocator.innerText();
const expandableLocator = page.locator('[data-test-name="ExpandablePreview"]');
if (await expandableLocator.isVisible()) {
await expandableLocator.click();
return await page.locator('[data-test-name="ErrorDetails"]').innerText();
}
} catch (err) {
// Ignore locator errors.
console.error(`ERROR:`, err);
}
return details || "(support form is visible)";
return "(unexpected error modal is visible)";
}
return null;
}
Expand Down Expand Up @@ -128,10 +128,14 @@ export async function waitForRecordingToFinishIndexing(page: Page): Promise<void
throw new UnrecoverableError(`Session failed: ${supportFormErrorDetails}`);
}

expect(
await timelineCapsuleLocator.getAttribute("data-test-progress"),
"Recording did not finish processing"
).toBe("100");
if (await timelineCapsuleLocator.isVisible()) {
expect(
await timelineCapsuleLocator.getAttribute("data-test-progress"),
"Recording did not finish loading"
).toBe("100");
} else {
throw new Error("Recording did not finish processing");
}
},
{
retryInterval: 1_000,
Expand Down
Loading