Skip to content

Commit

Permalink
Add wait for sidebar to load before E2E tests run
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-grace committed Mar 13, 2024
1 parent a2984a5 commit 2b03e85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/e2e/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface BrowserDownload {
data: Buffer;
}

const defaultWaitForOptions = { timeout: 5_000 };
const defaultWaitForOptions = { timeout: 10_000 };

const baseUrl = "http://localhost:3000";
const reportsPath = "reports/e2e/";
Expand Down Expand Up @@ -942,6 +942,8 @@ export class App {
this.page = this.createPage();
page = await this.page;
await page.goto(this.url);
// Wait for side bar to load
await page.waitForSelector('[data-testid="scrollable-panel"]');
}

/**
Expand Down Expand Up @@ -1032,7 +1034,10 @@ export class App {
const button = await document.findByRole("link", {
name: linkName,
});
return button.click();
await button.click();

// Wait for side bar to load
await document.waitForSelector('[data-testid="scrollable-panel"]');
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/e2e/edits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ describe("edits", () => {

await app.reloadPage();

await app.findVisibleEditorContents(/A change/, {
timeout: 2_000,
});
await app.findVisibleEditorContents(/A change/);
});
});

0 comments on commit 2b03e85

Please sign in to comment.