-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Is it possible to run playwright for Electron in headless mode ? #2609
Comments
You don't need anything, Docker + xvfb should work just fine. If you already ran Electron in that docker, it means you have all the dependencies in place. |
To clarify, |
Ok thanks a lot @pavelfeldman , let me try and let you know if I have any issue |
Lets us know if it worked please! If it all went fine, we will close the issue! |
Yes I will, I have some issue but I trying to investigate what is the real issue. |
inside my docker , when running the following command to run my application directly
I got the following output:
I suppose my electron application is running correctly . Then I stopped the previous command and then I am trying to run my e2e tests with playwright and I got the following error :
As you can see, it seems that the debugger is connected correctly but the browser crash . My docker file is :
I am running the following docker command line : |
I added --enable-logging as a new parameter
and I got the following error
|
I am wondering if it's not related to the function |
I would try a couple of things:
|
Hey @pavelfeldman , I can't use xvfb-run first because of the order of parameters :
instead of
The second option helps (expose DISPLAY via this.envs) but was not enough.
we end up using :
and then start the e2e tests. it works well. That's being said, xvfb-run was running well with Spectron. I don't know exactly why xvfb-run behave differently with Playwright. Thanks again for your help. We now run our e2e tests on Linux in docker (headless) and on Windows (headfully). |
@atali can you show the Dockerfile you use to run Playwright tests headless? |
I can't get the playwright tests to run in docker. I tried
this is my error log
|
Hi, we are running Our code looks like this: beforeAll(async () => {
electronApp = await _electron.launch({
args: [
"--disable_splash_screen",
"--no-sandbox",
"--enable-logging",
path.join(__dirname, ".."),
],
});
});
afterAll(async () => {
if (electronApp) {
return electronApp.close();
}
}); Any suggestions on how to fix this issue or how to get a more extensive error message? |
@pavelfeldman I tried both things:
I got
I tried checking if |
There is 2 flavours of my project, one running on windows and another one running on linux.
Until now for Linux, we use a docker image to run our e2e with Spectron, we switched recently to Playwright but I am wondering if it's possible to run then on Linux.
Our Docker image uses xvfb, do we need something in particular to run electron with playwright in headless mode inside a docker image ?
The text was updated successfully, but these errors were encountered: