Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { remote } from 'webdriverio'
import webdriverPkg from 'webdriver/package.json'
import ultradumbBenchmarkScript from './scripts/benchmark'
import userAgentScript from './scripts/userAgent'
import speedoPkg from '../package.json'
import { getMetricParams, getThrottleNetworkParam } from './utils'
import { MOBILE_DEVICES, JANKINESS_COMMAND } from './constants'
const MAX_RETRIES = 3
const speedoUserAgent = `webdriver/${webdriverPkg.version} (Speedo/${speedoPkg.version})`
/**
* script that runs performance test on Sauce Labs
*
* @param {String} username name of user account
* @param {String} accessKey access key of user account
* @param {Object} argv command line arguments
* @param {String} name name of the test
* @param {String} build name of the build
* @param {String} logDir path to directory to store logs
* @return {Object} containing result and detail information of performance test
*/
export default async function runPerformanceTest(
username, accessKey, argv, name, build, logDir, checkJankiness, retryCnt = 0
) {
const { site, platformName, browserVersion, tunnelIdentifier, parentTunnel, crmuxdriverVersion } = argv