Skip to content

Commit

Permalink
update to leaderboard test to account for inconsistent Playwright beh…
Browse files Browse the repository at this point in the history
…avior
  • Loading branch information
briangregoryholmes committed Dec 12, 2023
1 parent 108f263 commit 2acd262
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test.describe("leaderboard and dimension table sorting", () => {
startRuntimeForEachTest();

test("leaderboard and dimension table sorting", async ({ page }) => {
test.setTimeout(60000);
test.setTimeout(30000);
await page.goto("/");
// disable animations
await page.addStyleTag({
Expand Down Expand Up @@ -93,9 +93,14 @@ test.describe("leaderboard and dimension table sorting", () => {
await page.getByRole("button", { name: "Select a context column" }).click();
await page.getByRole("menuitem", { name: "Percent change" }).click();

// need a slight delay for the rankings to update
await page.waitForTimeout(1000);

// Broader selectors using RegEx to account for some Playwright runs triggering the display
// of the starting value on hover
await assertAAboveB(
page.getByRole("button", { name: "Google 116 4%" }),
page.getByRole("button", { name: "Facebook 283 -4%" })
page.getByRole("button", { name: /^Google/ }),
page.getByRole("button", { name: /^Facebook/ })
);

// toggle sort by pct change
Expand Down

0 comments on commit 2acd262

Please sign in to comment.