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

Report session timeouts in e2e tests #10445

Merged
merged 1 commit into from
Mar 15, 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
15 changes: 13 additions & 2 deletions packages/e2e-tests/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ export async function mapLocators<T>(
);
}

export async function getExpectedErrorDetails(page: Page) {
if (await page.locator('[data-test-id="ExpectedError"]').isVisible()) {
return await page.locator('[data-test-name="ErrorDetails"]').innerText();
}
return null;
}

export async function getSupportFormErrorDetails(page: Page) {
if (await page.locator('[data-test-id="UnexpectedErrorDetails"]').isVisible()) {
try {
Expand Down Expand Up @@ -120,14 +127,18 @@ export async function waitForRecordingToFinishIndexing(page: Page): Promise<void

const timelineCapsuleLocator = page.locator('[data-test-id="Timeline-Capsule"]');

let supportFormErrorDetails: string | null = null;
await waitFor(
async () => {
supportFormErrorDetails = await getSupportFormErrorDetails(page);
const supportFormErrorDetails = await getSupportFormErrorDetails(page);
if (supportFormErrorDetails) {
throw new UnrecoverableError(`Session failed: ${supportFormErrorDetails}`);
}

const expectedErrorDetails = await getExpectedErrorDetails(page);
if (expectedErrorDetails) {
throw new UnrecoverableError(`Session failed: ${expectedErrorDetails}`);
}

if (await timelineCapsuleLocator.isVisible()) {
expect(
await timelineCapsuleLocator.getAttribute("data-test-progress"),
Expand Down
Loading