From 3ef6504e93b088028444962f4b99195bd8c25623 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 20 May 2022 16:04:46 +0200 Subject: [PATCH] test: make cli test more robust (#199) --- tests/cli_test.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/cli_test.ts b/tests/cli_test.ts index f494ab94..74e2d622 100644 --- a/tests/cli_test.ts +++ b/tests/cli_test.ts @@ -136,9 +136,7 @@ Deno.test({ // verify the island is revived. const browser = await puppeteer.launch({ args: ["--no-sandbox"] }); const page = await browser.newPage(); - - await page.goto("http://localhost:8000"); - await delay(500); + await page.goto("http://localhost:8000", { waitUntil: "networkidle2" }); const counter = await page.$("body > div > div > p"); let counterValue = await counter?.evaluate((el) => el.textContent); assert(counterValue === "3"); @@ -148,7 +146,7 @@ Deno.test({ counterValue = await counter?.evaluate((el) => el.textContent); assert(counterValue === "4"); - + await page.close(); await browser.close(); await lines.cancel();