nemo saucelabs
nemo.js integration with Saucelabs.com
This plugin exposes methods to update the metadata of running Sauce Labs job, e.g. Test Name, Test tags, Build Id and Test result (Pass/Fail) on Sauce Labs dashboard. It also exposes a method to get Job URL to print on your test reports. Once nemo-saucelabs
plugin is registered, you will have nemo.saucelabs
object available.
This is v3
of this plugin, which requires as a peer dependency nemo@^3.0.0-alpha.6
, which in turn required node v6
or later
Installation and usage
Use npm
to install nemo-saucelabs
into your project:
npm install --save-dev nemo-saucelabs@^3.0.0
for Cucumber 2, install >v5.0.0. Mocha is supported as is.
npm install --save-dev nemo-saucelabs@^5.0.1
Then, define the nemo-saucelabs
plugin in your config/config.json
under plugins
section and specify Sauce Labs username
and accessKey
under serverCaps
section:
"plugins": {
"saucelabs": {
"module": "nemo-saucelabs"
}
},
"driver": {
"browser": "chrome",
"server": "http://sauce-username:8ab3d84c-859c-41fb-3266-cff489be9862@ondemand.saucelabs.com:80/wd/hub",
"serverCaps": {
"username": "sauce-username",
"accessKey": "sauce-access-key", // not a real access key
"platform": "MAC",
"version": "27.0"
}
}
Methods
updateJob(data)
1. Update Sauce Labs Job: request fields:
name: string update the job namecucumber_tags: scenario nemo-saucelabs will traverse cucumber tags and get tag names to update the job tagstags: list of strings array of tags to update the job tagsbuild: int The build number being testedcustom-data: JSON a set of key-value pairs with any extra info that a user would like to add to the job Max 64KB
example:
var options = name: scenario cucumber_tags: scenario build: build_id custom-data: testInfo: 'information about test or cause of test failure...' ; nemosaucelabs ;
isJobPassed(isPassed)
2. Update Sauce Labs Job Result: request fields:
passed: boolean
example:
var isPassed = test;nemosaucelabs ;
getJobUrl()
3. Get Sauce Labs Job URL: example:
nemosaucelabs ;// example saucelabs url: https://saucelabs.com/tests/153a38fac7ab48869e7b3b9c3c567665