tests: improve playwright test readability (#5149)

This commit is contained in:
artshllaku
2024-10-03 11:20:27 +02:00
committed by GitHub
parent 0071775525
commit a309cf0e2c
3 changed files with 40 additions and 46 deletions

View File

@@ -95,7 +95,7 @@ test.describe("Status Page", () => {
await expect(page.getByTestId("powered-by")).toHaveCount(0);
await expect(page.getByTestId("update-countdown-text")).toContainText("00:");
const updateCountdown = Number((await page.getByTestId("update-countdown-text").textContent()).match(/(\d+):(\d+)/)[2]) ;
const updateCountdown = Number((await page.getByTestId("update-countdown-text").textContent()).match(/(\d+):(\d+)/)[2]);
expect(updateCountdown).toBeGreaterThanOrEqual(refreshInterval); // cant be certain when the timer will start, so ensure it's within expected range
expect(updateCountdown).toBeLessThanOrEqual(refreshInterval + 10);