From a5c7abe61e03338742717ba3370702ced5594f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Sun, 5 Dec 2021 21:21:15 +0100 Subject: [PATCH] Enable testcafe dev mode to pinpoint testcafe errors --- docker-compose.testcafe.yml | 2 ++ tests/tests/variables.ts | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docker-compose.testcafe.yml b/docker-compose.testcafe.yml index 9c7d5115..33eb55a6 100644 --- a/docker-compose.testcafe.yml +++ b/docker-compose.testcafe.yml @@ -3,6 +3,8 @@ services: testcafe: build: tests/ working_dir: /project/tests + command: + - --dev # Run as root to have the right to access /var/run/docker.sock user: root environment: diff --git a/tests/tests/variables.ts b/tests/tests/variables.ts index 7edfb072..6f95873e 100644 --- a/tests/tests/variables.ts +++ b/tests/tests/variables.ts @@ -154,7 +154,11 @@ test("Test that variables storage works", async (t: TestController) => { }).after(async t => { if (!t.ctx.passed) { console.log("Test failed. Browser logs:") - console.log(await t.getBrowserConsoleMessages()); + try { + console.log(await t.getBrowserConsoleMessages()); + } catch (e) { + console.error('Error while fetching browser logs (maybe linked to a closed iframe?)', e); + } } });