Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Fix e2e test flakiness by waiting for element to appear (#6217)

Adrian Gruntkowski0035b46cdd61
diff --git a/e2e/tests/dashboard/top-stats.spec.ts b/e2e/tests/dashboard/top-stats.spec.ts
index 98dc8a8d5e..424e27fdc1 100644
--- a/e2e/tests/dashboard/top-stats.spec.ts
+++ b/e2e/tests/dashboard/top-stats.spec.ts
@@ -248,6 +248,7 @@ test('different graph time intervals are available', async ({
const intervalOptions = page.getByTestId('graph-interval')
await expect(intervalButton).toHaveText('Days')
await intervalButton.click()
+ await expect(intervalOptions).toHaveCount(2)
const intervalOptions28Days = await intervalOptions.allTextContents()
expect(intervalOptions28Days.indexOf('Days') > -1).toBeTruthy()