From 1e7612cb0a68c3e0b423a0f964457f829913d1ae Mon Sep 17 00:00:00 2001 From: Nikkel Mollenhauer <57323886+NikkelM@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:14:35 +0100 Subject: [PATCH] Updated browser initialization --- .github/workflows/compatibilityTest.yml | 2 +- test/compatibility.headless.test.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compatibilityTest.yml b/.github/workflows/compatibilityTest.yml index 62568952..09c90742 100644 --- a/.github/workflows/compatibilityTest.yml +++ b/.github/workflows/compatibilityTest.yml @@ -60,7 +60,7 @@ jobs: # TODO: Find way to run headful tests in GitHub Actions - name: Run compatibility tests - uses: nikkelm/puppeteer-headful@v1.0.0 + uses: nikkelm/puppeteer-headful@master env: CI: "true" with: diff --git a/test/compatibility.headless.test.js b/test/compatibility.headless.test.js index ca0a85ae..ce0f9f4e 100644 --- a/test/compatibility.headless.test.js +++ b/test/compatibility.headless.test.js @@ -23,7 +23,11 @@ describe("compatibility", function () { let browser, page; beforeEach(async () => { - browser = await puppeteer.launch({ headless: true }); + browser = await puppeteer.launch({ + headless: true, // Extensions only work in head-full mode + args: ['--no-sandbox'], + executablePath: process.env.PUPPETEER_EXEC_PATH, // set by docker container + }); page = await browser.newPage(); // Set the SOCS cookie for YouTube (cookie banner) @@ -148,7 +152,11 @@ describe("compatibility", function () { let browser, page; beforeEach(async () => { - browser = await puppeteer.launch({ headless: true }); + browser = await puppeteer.launch({ + headless: true, // Extensions only work in head-full mode + args: ['--no-sandbox'], + executablePath: process.env.PUPPETEER_EXEC_PATH, // set by docker container + }); page = await browser.newPage(); // Set the SOCS cookie for YouTube (cookie banner)