Closed jansepke closed 8 years ago
@pateketrueke Even after looking at the conversation in the pull request, I still don't understand how to define multiple targets.
My configuration for the grunt-nightwatch
task looks like this:
var optionsFor = function (options) {
return {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
chromeOptions: {
binary: 'dist/electron/' +
'<%= package.projectName %>-' + options.platform + '-' + options.arch + '/' +
'<%= package.projectName %>.app/Contents/MacOS/Electron'
}
}
};
};
module.exports = {
options: {
src_folders: ['tests/integration'],
standalone: true
},
darwin32: optionsFor({platform: 'darwin', arch: 'ia32'}),
darwin64: optionsFor({platform: 'darwin', arch: 'x64'})
};
So basically I want to run the same tests with the same options, but changing the browser binary for each target.
Running grunt nightwatch:darwin32:darwin64 --verbose
gives the following:
Running tasks: nightwatch:darwin32:darwin64
Running "nightwatch:darwin32:darwin64" (nightwatch) task
>> Task options
{"standalone":true,"jar_path":null,"jar_url":"http://selenium-release.storage.googleapis.com/{x}.{y}/selenium-server-standalone-{x}.{y}.{z}.jar","jar_version":"2.45.0","config_path":null}
>> Using already downloaded Selenium from .../node_modules/grunt-nightwatch/selenium-server-standalone-2.45.0.jar
>> Settings (darwin32, darwin64)
{"src_folders":["tests/integration"],"output_folder":"reports","selenium":{"start_process":true,"server_path":".../node_modules/grunt-nightwatch/selenium-server-standalone-2.45.0.jar"}}
>> Test settings
{"default":{"silent":true,"output":true}}
>> .../node_modules/grunt-nightwatch/node_modules/nightwatch/lib/runner/cli/clirunner.js:378
>> throw new Error('Invalid testing environment specified: ' + envs[i]);
>> ^
Fatal error: Cannot read property '1' of null
Why are those final test settings empty, if the settings for darwin32
and darwin64
are there?
After investigating I've found this:
grunt.initConfig({
nightwatch: {
options: {
test_settings: {
a: {},
b: {}
}
}
}
});
Run grunt nightwatch:a:b
to execute in parallel...
It seems to be broken to me.
Edit: please don't execute that; I've found what happened and I'm working/fixing a new release asap. :bomb:
Any update? This causes failure when I upgrade from v0.4.6 to v0.4.8
Targets were fixed on 0.5.0
, please update and test.
Verified it's good now
How to I override options for a specific target? I have the following in my Gruntfile:
if I run
grunt nightwatch
my 2 tests will run if I rungrunt nightwatch:google
also both tests runHow should I define targets to override properties?