grunt-saucelabs icon indicating copy to clipboard operation
grunt-saucelabs copied to clipboard

Dynamic 'testname' option

Open wintondeshong opened this issue 11 years ago • 2 comments

I noticed that if you do not set the options.testname optional parameter, the output will include the proper operating system and browser (http://cl.ly/image/0e3I3D3Q3j19) while rendering the web-based output's 'session' column with "unnamed job" (http://cl.ly/image/1A2M1d0f3n3Q). Is there a way to add that as a variable to be interpolated by saucelabs (Example: "My Project: #{TEST_ENVIRONMENT}") while maintaining both the console output and web-based session column?

wintondeshong avatar Jan 13 '14 14:01 wintondeshong

How about setting the 'testname' parameter to optionally accept a function. The test runner will pass in a configuration object, and whatever the function returns will be the name of the test. Like so:

testname: function(config){
  return "My Project: " + config.platform + " : " + config.framework;
}

Work for you?

Jonahss avatar Jan 13 '14 17:01 Jonahss

That would be perfect!

wintondeshong avatar Jan 14 '14 01:01 wintondeshong