function(opts) {
		opts.accesskey = opts.accesskey || opts.password;
		delete opts.password;
		if (opts.selenium.hostname.match(/ondemand.saucelabs.com/)) {
			opts.SAUCE_USERNAME = opts.SAUCE_USERNAME || opts.username;
			opts.SAUCE_ACCESSKEY = opts.SAUCE_ACCESSKEY || opts.accesskey;
			if (typeof opts.SAUCE_USERNAME !== 'undefined' && typeof opts.SAUCE_ACCESSKEY !== 'undefined') {
				opts.selenium.auth = opts.SAUCE_USERNAME + ':' + opts.SAUCE_ACCESSKEY;
				delete opts.SAUCE_ACCESSKEY;
				delete opts.SAUCE_USERNAME;
			}
		} else if (opts.selenium.hostname.match(/hub.browserstack.com/)) {
			opts.BROWSERSTACK_USERNAME = opts.BROWSERSTACK_USERNAME || opts.username;
			opts.BROWSERSTACK_KEY = opts.BROWSERSTACK_KEY || opts.accesskey;
			if (typeof opts.BROWSERSTACK_USERNAME !== 'undefined') {
				opts.browsers.forEach(function(browser) {
					browser['browserstack.user'] = opts.BROWSERSTACK_USERNAME;
					browser['browserstack.key'] = opts.BROWSERSTACK_KEY;
				});
				delete opts.BROWSERSTACK_USERNAME;
				delete opts.BROWSERSTACK_KEY;
				delete opts.selenium.user;
				delete opts.selenium.pwd;
			}
		}

		delete opts.username;
		delete opts.password;
		return opts;
	}
function(opts) {
		opts.accesskey = opts.accesskey || opts.password;
		delete opts.password;
		if (opts.selenium.hostname.match(/ondemand.saucelabs.com/)) {
			opts.SAUCE_USERNAME = opts.SAUCE_USERNAME || opts.username;
			opts.SAUCE_ACCESSKEY = opts.SAUCE_ACCESSKEY || opts.accesskey;
			if (typeof opts.SAUCE_USERNAME !== 'undefined' && typeof opts.SAUCE_ACCESSKEY !== 'undefined') {
				opts.selenium.auth = opts.SAUCE_USERNAME + ':' + opts.SAUCE_ACCESSKEY;
				delete opts.SAUCE_ACCESSKEY;
				delete opts.SAUCE_USERNAME;
			}
		} else if (opts.selenium.hostname.match(/hub.browserstack.com/)) {
			opts.BROWSERSTACK_USERNAME = opts.BROWSERSTACK_USERNAME || opts.username;
			opts.BROWSERSTACK_KEY = opts.BROWSERSTACK_KEY || opts.accesskey;
			if (typeof opts.BROWSERSTACK_USERNAME !== 'undefined') {
				opts.browsers.forEach(function(browser) {
					browser['browserstack.user'] = opts.BROWSERSTACK_USERNAME;
					browser['browserstack.key'] = opts.BROWSERSTACK_KEY;
				});
				delete opts.BROWSERSTACK_USERNAME;
				delete opts.BROWSERSTACK_KEY;
				delete opts.selenium.user;
				delete opts.selenium.pwd;
			}
		}

		delete opts.username;
		delete opts.password;
		return opts;
	}
function ( opts ) { opts . accesskey = opts . accesskey || opts . password ; delete opts . password ; if ( opts . selenium . hostname . match ( / ondemand.saucelabs.com / ) ) { opts . SAUCE_USERNAME = opts . SAUCE_USERNAME || opts . username ; opts . SAUCE_ACCESSKEY = opts . SAUCE_ACCESSKEY || opts . accesskey ; if ( typeof opts . SAUCE_USERNAME !== 'undefined' && typeof opts . SAUCE_ACCESSKEY !== 'undefined' ) { opts . selenium . auth = opts . SAUCE_USERNAME + ':' + opts . SAUCE_ACCESSKEY ; delete opts . SAUCE_ACCESSKEY ; delete opts . SAUCE_USERNAME ; } } else if ( opts . selenium . hostname . match ( / hub.browserstack.com / ) ) { opts . BROWSERSTACK_USERNAME = opts . BROWSERSTACK_USERNAME || opts . username ; opts . BROWSERSTACK_KEY = opts . BROWSERSTACK_KEY || opts . accesskey ; if ( typeof opts . BROWSERSTACK_USERNAME !== 'undefined' ) { opts . browsers . forEach ( function ( browser ) { browser [ 'browserstack.user' ] = opts . BROWSERSTACK_USERNAME ; browser [ 'browserstack.key' ] = opts . BROWSERSTACK_KEY ; } ) ; delete opts . BROWSERSTACK_USERNAME ; delete opts . BROWSERSTACK_KEY ; delete opts . selenium . user ; delete opts . selenium . pwd ; } } delete opts . username ; delete opts . password ; return opts ; }
username and accesskey or password
username and accesskey or password