nightwatchjs / nightwatch-schematics

Add Nightwatchjs to an Angular CLI project
https://www.npmjs.com/package/@nightwatch/schematics
MIT License
8 stars 8 forks source link

Browser Driver executable missing after adding schematics #27

Open vaibhavsingh97 opened 1 year ago

vaibhavsingh97 commented 1 year ago

In the last few releases, the first test run fails after adding Nightwatch schematics in Angular Projects because the browser driver executable is missing. This is because we are installing browser drivers, but the post-install step doesn't run after the package is installed.

How to reproduce?

image

marcin-wosinek commented 1 year ago

Looks downgrading the GeckoDriver to previous version works OK:

npm i geckodriver@3

The Nightwatch peer dependencies look to be too flexible—they take whatever is the newest version, including major release:

  "peerDependencies": {
    "@cucumber/cucumber": "*",
    "chromedriver": "*",
    "geckodriver": "*"
  },
marcin-wosinek commented 1 year ago

It looks like an issue in node-geckodriver. The doc over there says:

Once installed you can start Geckodriver via:

npx geckodriver --port=4444

and it's not true in with version 4.

I've registered https://github.com/webdriverio-community/node-geckodriver/issues/123

marcin-wosinek commented 1 year ago

The Geckodriver issue is gone in version 4.0.4. Newly generated project works as expected, as soon as I update nightwatch.conf.js with:

    firefox: {
    ....  
       webdriver: {
         start_process: true,
-        server_path: '',
+        server_path: "./node_modules/.bin/geckodriver",