Open IhsenBouallegue opened 1 year ago
Hey @lifeiscontent, I see you have added playwright support. Maybe you have some insight on how to fix this basic issue.
@IhsenBouallegue I wanted this to work differently, but the way it was merged you have to first build the project to run in order for the tests to work, which in my opinion seems like an unnecessary step because it should be using vite under the hood you should be able to run both the production version and the development version e2e but currently I'm not sure how to do that, this is what I was trying to explain to @caoxiemeihao but I don't think he understood the explanation and just merged the PR.
Hey @lifeiscontent after a lot of investigation and confusion. I found out that it is because of these 3 lines in the main process of Electron:
if (!app.requestSingleInstanceLock()) {
app.quit()
process.exit(0)
}
They prevent another instance from launching and as the E2E tests are parallel, it throws an error. I discovered this a bit too late. I completely migrated to Electron Forge and had to change the whole config, which led to me discovering this. I find it weird how no one tried to start more than one E2E test.
Possible solutions:
I will leave it up to you if you want to solve this or close the issue.
@IhsenBouallegue I wanted this to work differently, but the way it was merged you have to first build the project to run in order for the tests to work, which in my opinion seems like an unnecessary step because it should be using vite under the hood you should be able to run both the production version and the development version e2e but currently I'm not sure how to do that, this is what I was trying to explain to @caoxiemeihao but I don't think he understood the explanation and just merged the PR.
Did this problem get resolved or not yet?
@adnanlah not yet
I used the template and ran one test. It passes no problems, but running multiple ones fails with this error
Error: electron.launch: Process failed to launch!
. I prepared a simple repo which has the same test duplicated. Here is a test snippet:Link to the GitHub repository with the repro https://github.com/IhsenBouallegue/electron-pw
Steps
Expected
All tests run and pass
Actual
A test is failing because of electron.launch()