-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment is ignored if tags and environment both are used #22
Comments
Hi @sharadJay . Hmm... Could you try the following examples? I want to know the result of |
Nope I did not find any success. Following is my gulpfile
and I have environment setup like this in my nightwatch config:-
I was hoping test with tag sample starts on chrome as on US environment but tests are started on default i.e. phantomjs |
Um, I've run gulp task using your nightwatch.json, gulpfile.js. and the test worked fine. Of course on Chrome. gulpfile.js var gulp = require('gulp');
var nightwatch = require('gulp-nightwatch');
gulp.task('SampleTest',function(){
gulp.src('')
.pipe(nightwatch({
configFile: 'nightwatch.json',
cliArgs: [ '--env US', '--tag sample' ]
}));
}); tests/google.com.js module.exports = {
tags: [ 'sample' ],
'Demo google test': function(browser) {
browser
.url('https://google.com')
.assert.title('Google')
.end();
}
}; nightwatch.json {
"src_folders" : [ "tests" ],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : false,
"server_path" : "",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "",
"webdriver.ie.driver" : ""
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://www.google.com",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : "/screenshots"
},
"end_session_on_fail":true,
"desiredCapabilities": {
"browserName": "phantomjs",
"javascriptEnabled": true,
"acceptSslCerts": true,
"phantomjs.binary.path" : "node_modules/resources/phantomjs/bin/phantomjs",
"phantomjs.cli.args": "--webdriver=5558 --webdriver-selenium-grid-hub=http://localhost:4444"
}
},
"US" : {
"launch_url" : "http://www.google.com",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : true,
"path" : "/screenshots"
},
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true
}
}
}
} And, command line outputs. $ gulp SampleTest
[22:02:19] Using gulpfile ~/tmp/sandbox/gulpfile.js
[22:02:19] Starting 'SampleTest'...
[22:02:19] Finished 'SampleTest' after 5.95 ms
[22:02:19] log file
[22:02:19] Starting nightwatch...
[Google Com] Test Suite
=======================
Running: Demo google test
✔ Testing if the page title equals "Google".
OK. 1 assertions passed. (2.795s)
$ What version of gulp-nightwach are you using? I need a little more information. |
I am using 0.2.2 version for gulp-nightwatch. |
I see that environment used is default if tag is provided in cli arguments section. I have tried running same combination using nightwatch and it runs perfectly fine.
The text was updated successfully, but these errors were encountered: