From 6c4e6a4a5d3bc638165a6fe3c0c0c21f55e684c5 Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Tue, 9 Nov 2021 19:31:14 +0800 Subject: [PATCH] Test: Attempt to fix tests --- test/e2e.spec.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/e2e.spec.js b/test/e2e.spec.js index aaa5ad8739..a98459c3b2 100644 --- a/test/e2e.spec.js +++ b/test/e2e.spec.js @@ -97,7 +97,6 @@ describe("Init", () => { it("Change Theme", async () => { await page.goto(baseURL + "/settings/appearance"); - await page.waitForSelector(".btn[for=btncheck2]"); // Dark await click(page, ".btn[for=btncheck2]"); @@ -112,14 +111,11 @@ describe("Init", () => { it("Change Heartbeat Bar Style", async () => { await page.goto(baseURL + "/settings/appearance"); - await page.waitForSelector(".btn[for=btncheck5]"); // Bottom await click(page, ".btn[for=btncheck5]"); await page.waitForSelector("div.hp-bar-big"); - await page.waitForSelector(".btn[for=btncheck6]"); - // None await click(page, ".btn[for=btncheck6]"); await page.waitForSelector("div.hp-bar-big", { @@ -235,7 +231,10 @@ describe("Init", () => { await page.goto(baseURL + "/settings/monitor-history"); await click(page, "#clearAllStats-btn"); await click(page, ".btn.btn-danger"); - await page.waitForXPath("//span[contains(text(), '0%')]", { timeout: 3000 }); + await page.waitForFunction(() => { + const badge = document.querySelector("span.badge"); + return badge && badge.innerText == "0%"; + }, { timeout: 3000 }); }); });