Closed newjs closed 10 years ago
No, I'm afraid nightwatch doesn't support this out of the box.
@newjs Though nightwatch doesn't have a built-in function for this, it can handle multiple browsers if you're willing to script the process a bit. Here's what I did to handle multiple browsers with Saucelabs, you could do something similar if you're running your own selenium server:
I replaced the desiredCapabilities entries with ENV vars as placeholders, allowing me to use it as a sort of template. Then I can run the test runner against a specific browser by setting the proper ENV vars before the command (e.g., SAUCE_BROWSER_NAME=chrome nightwatch -e saucelabs -t smoketest.js
)
Thanks @erickbrower. I did that the old fashion way yesterday. Duplicated the json file, change one for chrome, then just wire them up in one script.
node nightwatch.js --c ./nightwatch_ff.json node nightwatch.js --c ./nightwatch_ch.json
Any plan to support out of box multiple browsers capabilities?
I need multiple browser support too. This feature would make much sense!
+1 Multiple browser support would be awesome. - Thanks @newjs, good substitute while this feature is considered.
We do this through grunt-nigthwatch. Grunt is able to change the config, so we have a task that wraps nw execution and sets the browser configs before each.
I just noticed that nightwatch now supports this natively in the trunk version. how often does nightwatch get pushed to npm?
@jezternz thats good news! I suppose we can build it before its available in npm if trunk is stable.
v0.5.6 is now in npm. Normally it is released on npm quickly whenever there's fixes or features but recently I had some issues with npm publish.
Also some docs here: http://nightwatchjs.org/guide#run-parallel. There are some guides on the Wiki as well about browser specific setup.
awesome, thanks @beatfactor :)
So this is nice, but still lacks.
I have two environments, saucelabs, and default. I want to test multiple browsers in each environment. With the current setup I have to copy my saucelabs environment x amount of time, so sauce-chrome
, sauce-firefox
, etc.. This is kind of sub-par, it would be nice if I could pass an array to desiredCapabilities
, with the different browsers, and those would run in parallel.
You could also create your environments programmatically with Javascript to avoid repetition. You can use a nightwatch.conf.js file instead of nightwatch.json, like I did here: http://nightwatchjs.org/blog/testing-webrtc-apps-with-nightwatch/#adaptingtestsettingsatruntimeperenvironment
On Mon, Feb 9, 2015 at 3:30 PM, Ilya Radchenko notifications@github.com wrote:
So this is nice, but still lacks.
I have two environments, saucelabs, and default. I want to test multiple browsers in each environment. With the current setup I have to copy my saucelabs environment x amount of time, so sauce-chrome, sauce-firefox, etc.. This is kind of sub-par, it would be nice if I could pass an array to desiredCapabilities, with the different browsers, and those would run in parallel.
— Reply to this email directly or view it on GitHub https://github.com/beatfactor/nightwatch/issues/138#issuecomment-73517118 .
@beatfactor thanks for that.
In my case, I need to test different browsers. How do I do that? I basically want to run the same set of test cases on chrome, then Firefox, then Safari.