Has anyone got any thoughts on naming tests within SauceLabs, currently I've got the name set in the desiredCapabilities in the nightwatch.json file:
"saucelabs" : {
"selenium_port" : 80,
"username" : "SAUCE-USERNAME",
"access_key" : "SAUCE-KEY",
"use_ssl" : false,
"silent" : true,
"output" : true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"name" : "TestName",
"browserName": "firefox"
},
All tests are coming through named 'TestName' -> not really useful should I need to investigate a specific test failure.
I can't see anyway to change the name within the settings after finishing each test, so that the next test session on Sauce will have a relevant name. I've attempted using the Node.js framework for the Sauce API (
https://github.com/holidayextras/node-saucelabs) this works up to a point.
In the global teardown I pass the name of the test as a variable and then using the API getJobs method I can grab the ID for the last test run. After that I can pass that along with a test name to the updateJob method and it will update the test name.
tearDown : function(browser, testName) {
sauce.getJobs(function(err,res){
sauce.updateJob(res[0].id, {"name": testName}, function(err, res) {
});
});
This works fine if I'm only running one test, however if I try to run a series of tests it will update the very last test only. It seems that the getJobs and updateJobs methods only run once all tests are finished, rather than during the tearDown on each test. I'm absolutely sure that I'm doing something wrong but any assistance or advice would be great.
- Rob