test: make cli test more robust (#199)
This commit is contained in:
+2
-4
@@ -136,9 +136,7 @@ Deno.test({
|
|||||||
// verify the island is revived.
|
// verify the island is revived.
|
||||||
const browser = await puppeteer.launch({ args: ["--no-sandbox"] });
|
const browser = await puppeteer.launch({ args: ["--no-sandbox"] });
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
|
await page.goto("http://localhost:8000", { waitUntil: "networkidle2" });
|
||||||
await page.goto("http://localhost:8000");
|
|
||||||
await delay(500);
|
|
||||||
const counter = await page.$("body > div > div > p");
|
const counter = await page.$("body > div > div > p");
|
||||||
let counterValue = await counter?.evaluate((el) => el.textContent);
|
let counterValue = await counter?.evaluate((el) => el.textContent);
|
||||||
assert(counterValue === "3");
|
assert(counterValue === "3");
|
||||||
@@ -148,7 +146,7 @@ Deno.test({
|
|||||||
|
|
||||||
counterValue = await counter?.evaluate((el) => el.textContent);
|
counterValue = await counter?.evaluate((el) => el.textContent);
|
||||||
assert(counterValue === "4");
|
assert(counterValue === "4");
|
||||||
|
await page.close();
|
||||||
await browser.close();
|
await browser.close();
|
||||||
|
|
||||||
await lines.cancel();
|
await lines.cancel();
|
||||||
|
|||||||
Reference in New Issue
Block a user