wdio.conf.js
function getScreenshotName(basePath) {
    return function(context) {
        var testName = context.test.title.replace(/\s+/g, '-');
        var browserName = context.browser.name;
        var browserVersion = parseInt(context.browser.version, 10);
        var subDir = browserName + '_v' + browserVersion;
        var fileName = testName + '.png';

        return path.join(basePath, subDir, fileName);
    };
}
function getScreenshotName(basePath) {
    return function(context) {
        var testName = context.test.title.replace(/\s+/g, '-');
        var browserName = context.browser.name;
        var browserVersion = parseInt(context.browser.version, 10);
        var subDir = browserName + '_v' + browserVersion;
        var fileName = testName + '.png';

        return path.join(basePath, subDir, fileName);
    };
}
function getScreenshotName ( basePath ) { return function ( context ) { var testName = context . test . title . replace ( / \s+ / g , '-' ) ; var browserName = context . browser . name ; var browserVersion = parseInt ( context . browser . version , 10 ) ; var subDir = browserName + '_v' + browserVersion ; var fileName = testName + '.png' ; return path . join ( basePath , subDir , fileName ) ; } ; }
Returns the screenshot name
@param {String} basePath - base path
@returns {String}
Returns the screenshot name