microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
63.84k stars 3.46k forks source link

[BUG] Cannot load extension to chromium in headful mode inside Github actions #19555

Closed elilutsky closed 2 months ago

elilutsky commented 1 year ago

Context:

Code Snippet

I'm loading the extension as in the official documentation:

extensionContext: async ({ exe_path }, use) => {
  const pathToExtension = path.join(__dirname, '..', 'build');
  const extensionContext = await chromium.launch({
    headless: false,
    args: [
      `--disable-extensions-except=${pathToExtension}`,
      `--load-extension=${pathToExtension}`,
    ],
    executablePath: exe_path,
  });
  await use(await extensionContext.newContext());
  await extensionContext.close();
},

I'm running the system test inside Github actions using a Makefile, the target runs the next command:

xvfb-run --auto-servernum --server-args='-screen 0, 1920x1080x24' yarn run test --project=${BROWSER}

The setup is as follows (Also from the Makefile):

yarn install --frozen-lockfile
yarn run playwright install --with-deps

Describe the bug

When I run the above code, chromium.launch hangs and the test fails after the 30s timeout. When I remove the --disable=extensions=except flag launch succeeds, but the extension is not loaded (although the --load-extension flag remains).

Is there a working example on how to test extensions in headful mode inside any CI/CD framework (preferably Github actions)?

Thanks

pavelfeldman commented 1 year ago

Leaving it open in case someone has an advice for you.

elilutsky commented 1 year ago

Anyone? 😞

This is a pretty standard usecase for playwright.

DoctorDerek commented 1 year ago

Bump? I'm seeing the same behavior when using what's given in the docs: --headless=chrome, // the new headless arg

Headless mode just times out without the browser being able to load the extension.

3runo commented 12 months ago

Any news ?

pavelfeldman commented 2 months ago

Why was this issue closed?

Thank you for your contribution to our project. This issue has been closed due to its limited upvotes and recent activity, and insufficient feedback for us to effectively act upon. Our priority is to focus on bugs that reflect higher user engagement and have actionable feedback, to ensure our bug database stays manageable.

Should you feel this closure was in error, please create a new issue and reference this one. We're open to revisiting it given increased support or additional clarity. Your understanding and cooperation are greatly appreciated.