Skip to content

Commit

Permalink
Test: Attempt to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chakflying committed Nov 9, 2021
1 parent d32871d commit 6c4e6a4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]");
Expand All @@ -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", {
Expand Down Expand Up @@ -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 });
});
});

Expand Down

0 comments on commit 6c4e6a4

Please sign in to comment.