DevExpress / testcafe-browser-provider-electron

This is the Electron browser provider plugin for TestCafe.
https://testcafe.io
MIT License
49 stars 30 forks source link

ERROR Unable to find the browser. "electron" is not a browser alias or path to an executable file. #31

Closed Nantris closed 4 years ago

Nantris commented 5 years ago

Running from / which contains the following files:

package.json

devDependencies: {
   "electron": "^3.0.6",
   "testcafe-browser-provider-electron": "^0.0.6"
}

.testcafe-electron-rc

{
  "mainWindowUrl": "./app/app.html",
  "appPath": "./"  
}

testcafe electron ./tests/testcafe/test1.js or testcafe "electron:./" ./tests/testcafe/test1.js both lead to:

ERROR Unable to find the browser. "electron" is not a browser alias or path to an executable file.


I have testcafe@0.23.0 installed globally on Windows 7 x64. testcafe -b returns Firefox, IE, and Chrome, but not Electron. Using an absolute path makes no difference.

Nantris commented 5 years ago

I also tried installing the devDependencies as regular dependencies, and even adding testcafe as a local dependency, but electron is never a recognized browser.

Nantris commented 5 years ago

@AndreyBelym any thoughts on this? I'd love to use TestCafe, but so far, no luck. I've tried powershell, cmd and babun terminals, but the same error every time.

AndreyBelym commented 5 years ago

Please, specify your Node.js and NPM/Yarn versions. Try to add testcafe to the devDependencies and try to execute the following commands in a cmd session:

npm cache clean -f
rd /s /q node_modules
npm install --production=false

If it doesn't help, please follow steps from this comment and post your directory structure here.

calumcraig commented 5 years ago

I was facing the same issue on Linux - again TestCafe is installed globally but my Electron app was built as an executable file.

Resolved it by doing yarn add -D testcafe testcafe-browser-provider-electron

testcafe -b electron then returned: Using locally installed version of TestCafe. "electron:${PATH_TO_ELECTRON_APP}"

Then when I tried to run a test it launched my app OK.

pjc0247 commented 4 years ago

Re-installing packages worked for me.

Farfurix commented 4 years ago

@calumcraig @pjc0247

Thank you for sharing your experience with us.

no-response[bot] commented 4 years ago

This issue was automatically closed because there was no response to our request for more information from the original author. Currently, we don't have enough information to take action. Please reach out to us if you find the necessary information and are able to share it. We are also eager to know if you resolved the issue on your own and can share your findings with everyone.