nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.83k stars 1.32k forks source link

Need some more update on documentation using nightwatchJs with safari #2073

Closed saranyamohandas closed 5 years ago

saranyamohandas commented 5 years ago

Hi I appreciate some more update on safari documentation for NightwatchJs.

I am trying to automate UI to run in safari. With so much search on stackoverflow and google nightwatch forum still couldn't find any solution. I am using nightwatch version "^1.0.19". I was able to setup automation for safari successfully in past using selenium webdriverio by enabling and setting up remote automation. Also, NightwatchJs is working fine with chrome when documentation is followed. Also need some documentation on running for standalone usage. Please find the below configuration and error I get. Thank you!

Issue

Below is my nightwatch.json configuration -

 {
    "src_folders" : ["tests"],
    "webdriver" : {
      "start_process": true,
      "server_path": "/usr/bin/safaridriver",
      "port": 4444
    },
    "test_settings" : {
      "default" : {
        "desiredCapabilities": {
          "browserName": "safari"
        }
      }
    },
    "safari": {
        "launch_url": "localhost",
        "desiredCapabilities": {
          "browserName":"safari"
        },
        "use_legacy_jsonwire" : false,
        "globals": {
          "env": "dev"
        }
      }
    }

I get below error -


> nightwatch

   SafariDriver process exited with code: 1
   safaridriver: unrecognized option `--legacy'

       at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
 safaridriver: unrecognized option `--legacy'

npm ERR! Test failed.  See above for more details.
beatfactor commented 5 years ago

What's your safari version? Did you run the command safaridriver --enable?

saranyamohandas commented 5 years ago

safari version is 11.1.2. I have enabled it and it is running with selenium webdriver io.

beatfactor commented 5 years ago

Try v1.1.9, it should be fixed. Check also https://github.com/nightwatchjs/nightwatch-website-tests/blob/master/nightwatch.conf.js#L33.