@testim/testim-cli 3.302.0 → 3.303.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +1 -1
- package/cli.js.map +2 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ Testim had missing write access to ${l||s}
|
|
|
17
17
|
`).filter(y=>!t(y)&&!e(y)&&!s(y)&&!r(y)&&!n(y)&&!a(y)&&!i(y)&&!o(y)&&!c(y)&&!l(y)&&!d(y)&&!m(y)&&!p(y)&&!f(y)).join(`
|
|
18
18
|
`))},Uv=(s,e)=>{let t=e?`Please use ${e} instead.`:"";console.log(ef.default.yellow(`
|
|
19
19
|
WARNING: ${s} is deprecated. ${t}
|
|
20
|
-
`))},Fl=["clover","html","json-summary","json","lcov","lcovonly","teamcity","text-lcov","text-summary","text"],{env:zo,argv:Bl,stdout:Fv,exit:Ho,cwd:St}=global.process,jv=["trace","debug","info","warn","error","silent"];Rc(Bl,new Set(["run","connect","agent","tunneld","start","init","install-lazy-deps"]));jl.description("Testim.io CLI").option("--run [file-glob-pattern]","codeful test files to run",Ae,[]).option("-h --help","output usage information",sf).option("-o --options-file [options-file.json]","").option("-c --config-file [config-file.js]","").option("--test-config [test-config]","test config name to override for all tests in current execution",Ae,[]).option("--test-config-id [test-config-id]","test config ID to override for all tests in current execution",Ae,[]).option("--params-file [params-file.json]","").option("--params [params-json-string]","").option("-t, --testId [test-id]","test ID to run",Ae,[]).option("-w, --webpackConfig [webpack-configuration]","webpack configuration used to build the code based project").option("--test-id [test-id]","test ID to run",Ae,[]).option("-l, --label [label]","labels to search test by",Ae,[]).option("-n, --name [test-name]","test name to run",Ae,[]).option("--project [project-id]","project ID").option("-r, --report-file [report junit xml path]","where to save junit xml results file").option("--urls","add step urls to the junit report").option("--override-report-file-classname [override-report-file-classname]","custom junit class name for the junit reporter").option("--reporters [names]","report types",Dv).option("-h, --host [host-name]","host name or ip containing the selenium grid").option("-p, --port [host-port]","host port").option("-g, --grid [grid-name]","grid name").option("--path [grid-path]","grid path").option("--protocol [grid-protocol]","grid protocol http or https").option("--grid-username [grid-username]","grid http basic auth username").option("--grid-password [grid-password]","grid http basic auth password").option("-gi --grid-id [grid-id]","grid ID").option("-b, --browser [browser-type]","browser type (chrome/firefox)").option("-h, --headless [headless]","run in headless mode").option("-m, --mode [runner-mode]","use extension or selenium mode (extension/selenium/appium)").option("--branch [branch]","branch name",void 0).option("--base-url [base-url]","change base-url to a specified url for all tests in current execution").option("--token [token]","identification token to testim").option("--is-regression-baseline-run","save doms and run results as regression baseline data").option("--parallel [number-of-tests]","number of tests to run in parallel").option("--before-parallel [number-of-tests]","number of tests to run in parallel during the before phase of a test plan").option("--after-parallel [number-of-tests]","number of tests to run in parallel during the after phase of a test plan").option("--canary [canary-mode]","enable canary mode",!1).option("--test-plan [test-plan-name]","test plan to run",Ae,[]).option("--test-plan-id [test-plan-id]","test plan to run",Ae,[]).option("--suite [suite-name]","suite to run",Ae,[]).option("--suite-id [suite-id]","suite ID to run",Ae,[]).option("--rerun-failed-by-run-id [run-id]","allows re-running failed tests from a specific run ID").option("--disable-grid-check [boolean]","disable checking if selenium grid is available",!1).option("--disable-native-events [boolean]","pass nativeEvents=false capability to the selenium browser (in selenium mode)",!1).option("--disable-timeout-retry [boolean]","disable retry after test pass test timeout",!1).option("--ca-file [ca-file-location]","ca certificate file location").option("--proxy [proxy-url]","proxy url to all requests").option("--proxy-for-grid [proxy-for-grid]","used together with --proxy to also router grid traffic through a proxy").option("--result-label [result-label]","result label",Ae,[]).option("-oen --override-execution-name [execution-name]","override the default execution name","").option("--retries [max_num_of_retries]","number of retries on test failure, defaults to 0 (no retries)","0").option("--set-retention [retention-in-days]","set the number of days for results retention").option("--user [user-id]","user ID for local Testim-CLI").option("--pass-zero-tests","don't fail the run if no tests were found").option("--device-model [device-model]","The device model to use, iPhone 12, Nexus 5X, SM-G900P etc....").option("--device-udid [device-udid]","the device unique id").option("--os-version [os-version]","The operating system version number").option("--app-id [app-id]","The application id from app library on Testim Editor App").option("--appium-log-level [appium-log-level]","Level of logging verbosity").option("-rad --reset-app-data [reset-app-data]","set noReset appium capability to true, default value true!",!1).option("-fr --full-reset [full-reset]","set fullReset appium capability to true to reinstall application on session start and session end").option("-roso --reset-on-session-start-only [reset-on-session-start-only]","set resetOnSessionStartOnly appium capability to true to avoid uninstall app on session end (ios run only)",!1).option("-str --suppress-tms-reporting [suppress-tms-reporting]","disable test management reporting",!1).option("-tsr --tms-suppress-reporting [tms-suppress-reporting]","disable test management reporting",!1).option("-tid --tms-run-id [tms-run-id]","update existing result in test management","").option("-tff --tms-field-file [tms-field-file.json]","pass field file location to add custom result field to the tms result report","").option("--disable-file-cache","disable internal CLI file caching").option("--file-cache-location [directory]"," internal CLI file caching location").option("--test-start-timeout [test-start-timeout]","The time to wait for a test to start after getting a browser session",Number,Number(zo.TESTIM_TEST_START_TIMEOUT)||2*60*1e3).option("--timeout [test-timeout]","Test run timeout in milliseconds",Number).option("--browser-timeout [open-browser-timeout]","Get browser from grid timeout in milliseconds",Number).option("--new-browser-wait-timeout [max-wait-to-browser]","Maximum get browser wait in minutes",Number).option("--get-browser-timeout [get-browser-timeout]","Timeout for a single attempt to get browser from the grid configured in the project's plan",Number).option("--get-browser-retries [get-browser-retries]","Number of attempts to get browser from the grid configured in the project's plan",Number).option("--get-session-timeout [get-session-timeout]",'Timeout for "/session" request to the selenium server',Number,(0,Ml.default)("90s")).option("--get-session-retries [get-session-retries]",'Retries for "/session" request to the selenium server',Number,3).option("--driver-request-timeout [driver-request-timeout]","Timeout for any WebDriver request to the grid server",Number,(0,Ml.default)("90s")).option("--driver-request-retries [driver-request-retries]","Retries for any WebDriver request to the grid server",Number,3).option("--use-local-chrome-driver [use-local-chrome-driver]","use a local ChromeDriver instance instead of a selenium grid").option("--chrome-binary-location [chrome-binary-location]","Chrome binary location").option("--use-chrome-launcher","use a local Chrome installation without selenium").option("-mnh --mock-network-har","use the HAR file configured in the Testim editor to mock network traffic").option("-mnp --mock-network-pattern [local file location path]","use a JSON rule file to mock network traffic (Rule file schema: https://help.testim.io/page/mocking-network-traffic)").option("-omf --override-mapping-file [local file location path]","pass map file location to override mock network (see schema: https://help.testim.io/page/mocking-network-traffic)").option("-dmn --disable-mock-network","Disable mock mode for the entire CLI run").option("--run-quarantined-tests","Run quarantine tests").option("--collect-code-coverage","collect code coverage for all js files under base url").option("--code-coverage-url-filter [url pattern]","collect code coverage for all js files matching url filter (url including asterisk)").option("--code-coverage-report-path [path]","where to save coverage report (default ./coverage)").option("--code-coverage-source-map-path [path]","path of source code").option("--code-coverage-reporter [reporter]",`set code coverage reporter (default html and text), options: ${Fl.join("/")}`,Ae,[]).option("--code-coverage-include [pattern]","set selecting files for coverage (default src/**)",Ae,[]).option("--sauce-user [sauce-lab-user]","user to connect to sauce labs").option("--sauce-key [sauce-lab-key]","key to use when connecting to sauce labs").option("--sauce-options [sauce-options]","json file of browser and os options for sauce").option("--browserstack-user [browserstack-user]","user to connect to browserStack").option("--browserstack-key [browserstack-key]","key to use when connecting to browserStack").option("--browserstack-options [browserstack-options]","json file of browser and os options for browserStack").option("--perfecto-token [perfecto-token]","security token to use when connecting to perfecto").option("--perfecto-options [perfecto-options]","json file of browser and os options for perfecto").option("--experitest-token [experitest-token]","security token to use when connecting to experitest").option("--testobject-key [testobject-key]","api key to use when connecting to testobject").option("--testobject-options [testobject-options]","json file of options for testobject").option("--ext [extension src path]","use extension from path (default it '/..')").option("--extension-path [path to extension archived file]","override the used extension").option("--install-custom-extension [chrome extension zipped file url or local path]","chrome extension to be installed in the browser").option("--player-path [path to player file]").option("--player-require-path [path to unminified player - development only]").option("--init [init]","Path for an initial test app").option("--inspect [port]","Opens node inspector at given port",Number).option("--login","Log in to Testim").option("--require-credentials","Log in to Testim if not already logged in").option("--tunneld","run a tunnel daemon only").option("--tunnel [tunnel]","enable tunnel").option("--tunnel-routes [routes]","tunnel routes for cloudflare tunnels").option("--tunnel-port [tunnel-port]","tunnel port address").option("--tunnel-host-header [tunnel-host-header]","tunnel host header").option("--tunnel-region [tunnel-region]","ngrok tunnel region").option("--tunnel-diagnostics","collect ngrok tunnel diagnostics").option("--tunnel-use-http-address [tunnel-use-http-address]","use http:// address instead of https://",!1).option("--external-lambdatest-tunnel-id [tunnel-id]","use existing lambdatest tunnel ID").option("--external-lambdatest-use-wss","use wss instead of ssh for LT",!1).option("--external-lambdatest-disable-automation-tunneling","don't tunnel Testim calls in LT tunnel",!0).option("--external-lambdatest-mitm","Turn on LT Man in the middle",!1).option("--w3c-capabilities [enable-w3c-caps-mode]","enable/disable w3c capabilities format (default enable)",JSON.parse,!0).option("--old-capabilities [enable-old-caps-mode]","enable/disable old capabilities format (default enable)",JSON.parse,!0).option("--disable-sockets","Disable CLI sockets",!1).option("--executionId [execution-id]","","").option("--remoteRunId [remote-run-id]","","").option("--schedulerId [scheduler-id]","","").option("--source [source]","","cli").option("--resultId [result-id]","","").option("--connect, --agent [enable-agent-mode]","enable Testim CLI agent mode",!1).option("--start [enable-start]","Connect to testim and open the editor in a standalone browser",!1).option("--download-browser","when used with the start option, downloads a fixed version to run Testim editor in",!1).option("--agent-port [agent-port]","set agent port",Number,42543).option("--agent-bind [agent-host-bind]","set agent host bind","127.0.0.1").option("--chrome-extra-prefs [chrome-extra-prefs]","add extra chrome preferences","").option("--chrome-extra-args [chrome-extra-args]","add extra chrome arguments separated by ','","").option("--chrome-block-location [chrome-block-location]","block chrome geolocation",!1).option("--chrome-user-data-dir [chrome-user-data-dir]","use custom chrome user date dir",!1).option("--disable-cookies-same-site-none-requires-secure [disable-same-site-none-requires-secure]","Disable cookies without SameSite must be secure",!1).option("--selenium-caps-file [selenium-caps-file.json]","json file to merge into Testim selenium desired capabilities").option("--version [version]","print the current version of the Testim CLI and exit",!1).option("--monitor-performance","collect test playback performance data").option("--high-speed","DEPRECATED: use --turbo-mode instead").option("--turbo-mode","run in turbo mode").option("--lightweight-mode [settings]","run lightweight mode").option("--create-prefeched-data [location]","prefetch data into local cache file").option("--use-prefeched-data [location]","use prefetched data from local cache file, and force using only cached data").option("--save-rca-locally [path]","save root cause analysis assets locally").option("--exit-code-ignore-failing-tests","return exit code of zero when tests fail. non zero exit code will mean a real error occurred").option("--intersect-with-label [label]","Out of the execution's test list, run only those tests that have the specified label",Ae,[]).option("--intersect-with-suite [suiteName]","Out of the execution's test list, run only those tests that are included in the specified suite (by suite name)",Ae,[]).option("--intersect-with-suite-id [suiteId]","Out of the execution's test list, run only those tests that are included in the specified suite (by suite ID)",Ae,[]).option("--install-lazy-deps [install-lazy-deps]","Install all lazy dependencies from package.json",!1).parse(Bl);u=jl.opts(),Bv=()=>{u.grid||u.gridId||(u.host||(u.host="ondemand.saucelabs.com"),u.port||(u.port=80))},$v=()=>{u.grid||u.gridId||(u.host||(u.host="hub-cloud.browserstack.com"),u.port||(u.port=80))},Wv=async()=>{var g,y,w,C,b,v,I,k,D;u.inspect&&require("inspector").open(u.inspect);let s={},e={},t=[],r={};if(!Bl.slice(2).length)throw sf(),new fr;if(u.requireCredentials){let S=await Promise.resolve().then(()=>(fs(),En)),_=await S.getProjectId(),P=await S.getToken();(!_||!P)&&await S.doLogin()}if(u.login)return await(await Promise.resolve().then(()=>(fs(),En))).doLogin(),{loginMode:!0};if(u.init)return{initCodimMode:!0,initTestProject:u.init};if(u.version){let S="Testim CLI Version: ";zo.npm_package_version&&(console.log(S,zo.npm_package_version),Ho(0));let _=nt();_&&(console.log(S,_),Ho(0)),console.log("Could not find version, please check the package.json manually"),Ho(0)}if(u.installLazyDeps)return{installLazyDepsMode:!0};u.disableFileCache&&sm();let n=u.fileCacheLocation||u.usePrefechedData||u.createPrefechedData;if(n){let S=Ne.resolve(n);tm(S)}if(u.usePrefechedData&&nm(),u.playerRequirePath){let S=Ne.resolve(u.playerRequirePath);console.log("Using Local Clickim for Player Require Path =",S);let _=Ne.join(S,"tsconfig.node.json"),L=require("ts-node").register({project:_,ignore:[/node_modules/,new RegExp(`^${mt.escapeRegExp(Ne.relative(St(),__dirname))}`)],transpileOnly:!0});require("tsconfig-paths").register({paths:L.config.options.paths,baseUrl:L.config.options.baseUrl}),(Ee(),G(_r)).options.playerPath=S;let V=require("module"),Y=V.prototype.require;V.prototype.require=function(fe){return fe==="rox-alias"?Y.call(this,"rox-node"):Y.apply(this,arguments)}}if(u.caFile&&(global.caFileContent=Ul.readFileSync(u.caFile)),u.proxy&&(global.proxyUri=u.proxy,global.SuperagentProxy=require("superagent-proxy"),global.ProxyAgent=require("proxy-agent"),global.HttpsProxyAgent=require("https-proxy-agent")),u.proxyForGrid&&!u.proxy)throw new R("missing --proxy option");if(zm(u))return Km(u);try{let S={};u.configFile?S=require(Ne.join(St(),u.configFile)).config:u.optionsFile&&(S=require(Ne.join(St(),u.optionsFile))),S&&typeof S.then=="function"&&(S=await S),Object.keys(S).forEach(_=>{let P=Nv(_);u[P]=Mv(u[P],S[_])})}catch(S){throw S.message=`Unable to read options file: ${S.message}`,S}if(u.tunneld)return{tunnel:!0,tunnelPort:u.tunnelPort,tunnelRoutes:u.tunnelRoutes,tunnelRoutesOutput:u.tunnelRoutesOutput,tunnelHostHeader:u.tunnelHostHeader,tunnelRegion:u.tunnelRegion,tunnelDiagnostics:u.tunnelDiagnostics,tunnelUseHttpAddress:u.tunnelUseHttpAddress,tunnelOnlyMode:!0,token:u.token,project:u.project};let o=((g=u.testConfig)==null?void 0:g.length)||((y=u.testConfigId)==null?void 0:y.length),i=((w=u.testPlan)==null?void 0:w.length)||((C=u.testPlanId)==null?void 0:C.length),a=((b=u.suite)==null?void 0:b.length)||((v=u.suiteId)==null?void 0:v.length);if(u.seleniumCapsFile)try{r=require(Ne.join(St(),u.seleniumCapsFile))}catch(S){throw new R(`Failed to parse selenium caps file file error: ${S.message}`)}if((I=u.reporters)!=null&&I.includes("junit")&&!u.reportFile&&console.log("Warning: please define --report-file option for JUnit reporter"),!u.tunnel&&u.externalLambdatestTunnelId)throw new R("missing --tunnel parameter");if(!u.tunnel&&u.externalLambdatestUseWss)throw new R("missing --tunnel parameter");if(!u.tunnel&&[u.tunnelPort,u.tunnelHostHeader,u.tunnelRegion,u.tunnelDiagnostics].some(Boolean))throw new R("missing --tunnel parameter");if(u.chromeExtraPrefs)try{e=require(Ne.join(St(),u.chromeExtraPrefs))}catch(S){throw new R(`Failed to read/open chrome extra prefs file error: ${S.message}`)}if(u.chromeExtraArgs){let S=u.chromeExtraArgs.split(",");for(let _ of S){let[P]=_.split("=");Zm.includes(P)||u.useLocalChromeDriver||u.useChromeLauncher?(t.push(_),P==="proxy-server"&&t.push("proxy-bypass-list=*.testim.io;*.coralogix.com;*.cloudinary.com;*.rollout.io")):console.warn(`Ignoring an unsupported chrome arg (${P}), allowed values: ${JSON.stringify(Zm)}`)}}if(u.paramsFile)try{s=Object.assign({},s,require(Ne.join(St(),u.paramsFile)))}catch(S){throw new R(`Failed to read/open params file error: ${S.message}`)}if(u.params)try{s=Object.assign({},s,JSON.parse(u.params))}catch(S){throw new R(`Failed to parse params string error: ${S.message}`)}if(u.sauceUser&&!u.sauceKey||!u.sauceUser&&u.sauceKey)throw new R("missing --sauce-user <sauce-user> or --sauce-key <sauce-key>");if(u.sauceUser&&u.sauceKey&&(Bv(),u.saucelabs={},u.saucelabs.username=u.sauceUser,u.saucelabs.accessKey=u.sauceKey),u.sauceOptions)try{let S=require(Ne.join(St(),u.sauceOptions)),_=S.platformName&&["ios","android"].includes(S.platformName.toLowerCase());if(S.browserName){let L=S.browserName.toLowerCase();switch(L){case"microsoftedge":u.browser="edge";break;default:u.browser=L}}u.browser==="edge"&&parseFloat(S.version)>=oo&&(u.browser="edge-chromium");let P=parseFloat(S.version)<50&&!["dev","beta"].includes(S.version);if(!_&&u.browser==="chrome"&&P)throw new R("The minimum chrome supported version is 50.0");u.saucelabs=Object.assign({},u.saucelabs,S)}catch(S){throw new R(`Failed to parse saucelabs options file error: ${S.message}`)}if(u.browserstackUser&&!u.browserstackKey||!u.browserstackUser&&u.browserstackKey)throw new R("missing --browserstack-user <browserstack-user> or --browserstack-key <browserstack-key>");if(u.browserstackUser&&u.browserstackKey&&($v(),u.browserstack={},u.browserstack["browserstack.user"]=u.browserstackUser,u.browserstack["browserstack.key"]=u.browserstackKey),u.browserstackOptions)try{let S=require(Ne.join(St(),u.browserstackOptions)),_=S.platform&&["mac","android"].includes(S.platform.toLowerCase());if(S.browserName&&(u.browser=S.browserName.toLowerCase()),u.browser==="edge"&&parseFloat(S.browser_version)>=oo&&(u.browser="edge-chromium"),!_&&parseFloat(S.browser_version)<50&&u.browser==="chrome")throw new R("The minimum chrome supported version is 50.0");u.browserstack=Object.assign({},u.browserstack,S)}catch(S){throw new R(`Failed to parse browserstack options file error: ${S.message}`)}if(u.perfecto={},u.perfectoToken&&(u.perfecto.securityToken=u.perfectoToken),u.perfectoOptions)try{let S=require(Ne.join(St(),u.perfectoOptions)),_={location:"US East",securityToken:u.perfectoToken};u.perfecto=Object.assign({},_,S)}catch(S){throw new R(`Failed to parse perfecto options file error: ${S.message}`)}if(u.testobjectSauce={},u.testobjectKey&&(u.testobjectSauce.testobjectApiKey=u.testobjectKey),u.testobjectOptions)try{let S=require(Ne.join(St(),u.testobjectOptions)),_={testobjectApiKey:u.testobjectKey};u.testobjectSauce=Object.assign({},_,S)}catch(S){throw new R(`Failed to parse test object options file error: ${S.message}`)}if(!u.project){let _=await(await Promise.resolve().then(()=>(fs(),En))).getProjectId();if(_)u.project=_;else throw new R("missing project-id info, either --login to provide new credentials or use --project <project-id>")}u.mode||(u.mode=u.run.length?"selenium":"extension"),u.testConfig&&(u.testConfig=[u.testConfig].flat()),u.testConfigId&&(u.testConfigId=[u.testConfigId].flat()),u.retries=!u.retries||typeof u.retries=="boolean"?1:Number(u.retries)+1,u.browserTimeout=!u.browserTimeout||typeof u.browserTimeout=="boolean"?60*1e3:u.browserTimeout,u.newBrowserWaitTimeout=!u.newBrowserWaitTimeout||typeof u.newBrowserWaitTimeout=="boolean"?10*60*1e3:u.newBrowserWaitTimeout*60*1e3,u.getBrowserTimeout||(u.getBrowserTimeout=u.browserTimeout),u.getBrowserRetries||(u.getBrowserRetries=Math.round(u.newBrowserWaitTimeout/u.browserTimeout)),u.getSessionTimeout=u.browserTimeout<u.getSessionTimeout?u.getSessionTimeout:u.browserTimeout,u.driverRequestTimeout=u.browserTimeout<u.driverRequestTimeout?u.driverRequestTimeout:u.browserTimeout;let c=Boolean(u.timeout);if(u.timeout=!u.timeout||typeof u.timeout=="boolean"?10*60*1e3:u.timeout,u.beforeParallel=!u.beforeParallel||typeof u.beforeParallel=="boolean"?1:Number(u.beforeParallel),u.parallel=!u.parallel||typeof u.parallel=="boolean"?1:Number(u.parallel),u.afterParallel=!u.afterParallel||typeof u.afterParallel=="boolean"?1:Number(u.afterParallel),u.parallel>1&&u.run&&!u.gridId&&!u.grid&&(!u.testPlan||u.testPlan.length===0)&&!((k=u.testPlanId)!=null&&k.length)&&Fv.isTTY&&!u.headless&&!zo.TERM&&((await require("prompts")({type:"toggle",name:"isSure",message:"Running in parallel without --headless flag will open several browsers on your computer. Are you sure?",initial:!1,active:"yes",inactive:"no"})).isSure||Ho(0)),u.tunnelPort=!u.tunnelPort||typeof u.tunnelPort=="boolean"?"80":u.tunnelPort,u.port&&(u.port=Number(u.port)),u.retries<=0||Number.isNaN(u.retries))throw new R("test failure retry count could not be a negative number or string, --retries <max_num_of_retries>");if(u.retries>21)throw new R("Max number of retries exceeded. Number cannot be greater than 20, --retries <max_num_of_retries>");if(!u.token){let _=await(await Promise.resolve().then(()=>(fs(),En))).getToken();if(_)u.token=_;else throw new R("missing Testim Access Token, either --login to provide new credentials or use --token <testim-access-token>, contact info@testim.io if you need a new one.")}if(u.browserTimeout<=0||Number.isNaN(u.browserTimeout))throw new R("get browser timeout could not be a negative number, --browser-timeout <get-browser-timeout>");if(u.newBrowserWaitTimeout<=0||Number.isNaN(u.newBrowserWaitTimeout))throw new R("max new browser wait timeout could not be a negative number, --new-browser-wait-timeout <max-wait-to-browser>");if(u.timeout<=0||Number.isNaN(u.timeout))throw new R("test run timeout could not be a negative number, --timeout <run-timeout>");if(u.beforeParallel<=0||Number.isNaN(u.beforeParallel))throw new R("before-parallel could not be a negative number or not number, --before-parallel <number-of-tests>");if(u.parallel<=0||Number.isNaN(u.parallel))throw new R("parallel could not be a negative number or not number, --parallel <number-of-tests>");if(u.afterParallel<=0||Number.isNaN(u.afterParallel))throw new R("after-parallel could not be a negative number or not number, --after-parallel <number-of-tests>");if(![Q.EXTENSION,Q.SELENIUM,Q.APPIUM].includes(u.mode))throw new R(`runner mode <${u.mode}> is not supported`);if(u.mode!==Q.SELENIUM&&u.disableNativeEvents)throw new R("disable-native-events is only applicable in selenium mode");if(!u.browser&&!o&&!i&&(u.browser="chrome"),u.appiumLogLevel||(u.appiumLogLevel="silent"),!jv.includes(u.appiumLogLevel))throw new R(`runner appium-log-level <${u.appiumLogLevel}> is not supported`);if(u.testPlan&&u.testPlan.length===0&&u.testPlanId&&u.testPlanId.length===0){if(typeof u.host!="string"&&typeof u.grid!="string"&&typeof u.gridId!="string"&&u.run.length===0&&!u.useLocalChromeDriver&&!u.useChromeLauncher&&!u.createPrefechedData)throw new R("missing remote grid address parameter, specify --host <host-name-or-ip> or --grid <grid-name> or --grid-id <grid-id>")}else if(u.testId.length||u.label.length||u.name.length||o||u.browser||a||u.useLocalChromeDriver||u.useChromeLauncher)throw new R("cannot set --testId, --label, --name, --browser, --test-config, --test-config-id, --use-local-chrome-driver --use-chrome-launcher or --suite with --test-plan option");if(!i&&(u.beforeParallel!==1||u.afterParallel!==1))throw new R("cannot set --before-parallel or --after-parallel without --test-plan option");if((u.testId.length||i||u.label.length||u.name.length||a)&&u.file)throw new R("Cannot pass codeful automation tests with --testId --label --name or --suite");if([u.host,u.grid,u.gridId].filter(Boolean).length>1)throw new R("please define exactly one of --grid or --grid-id or --host");if((D=u.host)!=null&&D.includes("/")&&(/^(f|ht)tps?:\/\//i.test(u.host)||(u.host=`http://${u.host}`),u.host=tf.parse(u.host).hostname),u.resultLabel.length){u.resultLabel=u.resultLabel.map(_=>_.trim()).filter(Boolean);let S=u.resultLabel.filter(_=>_.length>=250).filter(Boolean);if(u.branch==="auto-detect"&&u.resultLabel.includes("auto-detect-branch")&&Ir()&&u.resultLabel.unshift(Ir()),S.length)throw new R("A result label cannot exceed 250 characters")}let d=$m(u),m=$o(u);if(!u.w3cCapabilities&&!u.oldCapabilities)throw new R("cannot set --w3c-capabilities and --old-capabilities options as false");if(u.protocol||(u.protocol=u.port===443?"https":"http"),!["http","https"].includes(u.protocol))throw new R("invalid --protocol value, allow --protocol http or https");if(u.rerunFailedByRunId&&u.branch)throw new R("It is not possible to use --branch with --rerun-failed-by-run-id. Tests will automatically run on the same branch that was used in the original run");if(u.rerunFailedByRunId&&(a||u.name.length||u.testId.length||u.label.length||i))throw new R("Re-running failed tests is not possible when suite (--suite), label (--label), plan (--test-plan), or other test flags (--test) are provided. Please remove these flags and try again");if(u.run.length){let S=require("glob");if(u.files=mt.flatMap(u.run,_=>S.sync(_)),u.files.length===0)throw new R(`No files found at path '${u.run}'.`)}else u.files=[];if(u.setRetention&&!mt.inRange(mt.parseInt(u.setRetention),1,11))throw new R("Please provide the number of days that the test results will be retained for (--set-retention must be a whole number between 1 to 10)");u.setRetention&&(u.setRetention=Number(u.setRetention));let p="is no longer supported, please use --override-mapping-file";if(u.mockNetworkHar)throw new R(`--mock-network-har ${p}`);if(u.mockNetworkPattern)throw new R(`--mock-network-pattern ${p}`);if(u.disableMockNetwork&&u.overrideMappingFile)throw new R("You can either use --disable-mock-network or --override-mapping-file");if(!u.collectCodeCoverage&&u.codeCoverageSourceMapPath)throw new R("cannot set --code-coverage-source-map-path without passing --collect-code-coverage");if(!u.collectCodeCoverage&&u.codeCoverageReporter.length)throw new R("cannot set --code-coverage-reporter without passing --collect-code-coverage");if(!u.collectCodeCoverage&&u.codeCoverageInclude.length)throw new R("cannot set --code-coverage-include without passing --collect-code-coverage");if(u.collectCodeCoverage&&u.codeCoverageReporter&&mt.difference(u.codeCoverageReporter,Fl).length){let S=mt.difference(u.codeCoverageReporter,Fl);throw new R(`invalid --code-coverage-reporter parameters ${S.join("/")}`)}u.codeCoverageReporter=u.codeCoverageReporter.length===0?["html","text"]:u.codeCoverageReporter,u.codeCoverageInclude=u.codeCoverageInclude.length===0?["src/**"]:u.codeCoverageInclude;let f={mockNetworkHar:"--mock-network-har",mockNetworkPattern:"--mock-network-pattern",overrideMappingFile:"--override-mapping-file",codeCoverageUrlFilter:"--code-coverage-url-filter",collectCodeCoverage:"--collect-code-coverage",disableMockNetwork:"--disable-mock-network",useChromeLauncher:"--use-chrome-launcher"},h=Object.keys(f).filter(S=>Boolean(u[S]));if(u.mode!==Q.EXTENSION&&h.length){let S=h.length>1?"are":"is";throw new R(`${h.map(_=>f[_]).join(" and ")} ${S} only applicable in extension mode`)}if(u.tmsFieldFile)try{let S=Ul.readFileSync(u.tmsFieldFile);u.tmsCustomFields=JSON.parse(S)}catch(S){throw new R(`failed to parse field file error: ${S.message}`)}if(u.highSpeed&&(Uv("--high-speed"," --turbo-mode"),u.turboMode=!0),u.deviceUdid&&(u.deviceModel||u.osVersion))throw new R("It is not possible to use --osVersion or --deviceModel with --device-udid. device-udid is unique and cannot be combined with another flag");if(u.resetAppData&&u.fullReset)throw new R("It is not possible to set both --reset-app-data and --full-reset capabilities to true at the same time!");if(u.resetOnSessionStartOnly&&!u.fullReset&&console.warn("Ignoring --reset-on-session-start-only flag, should be used when --full-reset is provided for ios runs"),u.lightweightMode)try{let S={general:!0,disableLabs:!0,disableFeatureFlags:!0,disableAssets:!0,disablePixelValidation:!0,disableResults:!0,disableStepDelay:!0,disableRemoteStep:!0,assumePreloadedSharedSteps:!0,disableVisibilityCheck:!1,disableLocators:!1,bypassSetup:!1,disableAutoImprove:!0,disableQuotaBlocking:!0,onlyTestIdsNoSuite:!0,uploadAssetsAndResultsOnFailure:!0,preloadTests:!0,disableProjectDefaults:!0,type:"lightweight"},_=typeof u.lightweightMode=="string"?JSON.parse(u.lightweightMode):{};u.lightweightMode=Object.assign({},S,_)}catch(S){throw new R(`failed to parse lightweightMode settings error: ${S.message}`)}else u.turboMode&&u.mode===Q.EXTENSION&&(u.lightweightMode={general:!0,disableLabs:!1,disableFeatureFlags:!1,disableAssets:!0,disablePixelValidation:!1,disableResults:!0,disableStepDelay:!0,disableRemoteStep:!1,assumePreloadedSharedSteps:!1,disableVisibilityCheck:!1,disableLocators:!1,bypassSetup:!1,disableQuotaBlocking:!1,disableAutoImprove:!1,onlyTestIdsNoSuite:!1,uploadAssetsAndResultsOnFailure:!0,preloadTests:!1,disableProjectDefaults:!1,type:"turboMode"});if(typeof u.baseUrl=="boolean")throw new R("base url cannot be used as a flag, and must contain a string value");return{testId:[u.testId].flat(),name:[u.name].flat(),label:[u.label].flat(),suites:[u.suite].flat(),suiteIds:[u.suiteId].flat(),testPlan:[u.testPlan].flat(),testPlanIds:[u.testPlanId].flat(),files:[u.files].flat(),webpackConfig:u.webpackConfig,reportFile:u.reportFile,urls:u.urls,reportFileClassname:u.overrideReportFileClassname,reporters:u.reporters,project:u.project,host:u.host,headless:u.headless,useLocalChromeDriver:u.useLocalChromeDriver,chromeBinaryLocation:u.chromeBinaryLocation,useChromeLauncher:u.useChromeLauncher,port:u.port,grid:u.grid,gridId:u.gridId,disableNativeEvents:u.disableNativeEvents,saucelabs:u.saucelabs,browserstack:u.browserstack,baseUrl:u.baseUrl,branch:(u.branch==="auto-detect"?Ir():u.branch)||"master",autoDetect:u.branch==="auto-detect",token:u.token,userParamsData:s,mode:u.mode,isRegressionBaselineRun:u.isRegressionBaselineRun,browser:u.browser,beforeParallel:u.beforeParallel,parallel:u.parallel,afterParallel:u.afterParallel,canary:u.canary,rerunFailedByRunId:u.rerunFailedByRunId,disableGridCheck:u.disableGridCheck,disableTimeoutRetry:u.disableTimeoutRetry,resultLabels:u.resultLabel,path:u.path,protocol:u.protocol,perfecto:u.perfecto,experitestToken:u.experitestToken,testobjectSauce:u.testobjectSauce,gridUsername:u.gridUsername,gridPassword:u.gridPassword,overrideExecutionName:u.overrideExecutionName,tmsSuppressReporting:Boolean(u.suppressTmsReporting)||Boolean(u.tmsSuppressReporting),tmsRunId:u.tmsRunId,tmsCustomFields:u.tmsCustomFields,proxyForGrid:u.proxyForGrid,retentionDays:u.setRetention,passZeroTests:Boolean(u.passZeroTests),runQuarantinedTests:Boolean(u.runQuarantinedTests),deviceModel:u.deviceModel,deviceUdid:u.deviceUdid,osVersion:u.osVersion,appId:u.appId,appiumLogLevel:u.appiumLogLevel,resetAppData:u.resetAppData,fullReset:u.fullReset,resetOnSessionStartOnly:u.resetOnSessionStartOnly,ext:u.ext,extensionLocation:[u.extensionPath||d].flat(),extensionPath:u.extensionPath,playerLocation:u.playerPath||m,playerPath:u.playerPath,playerRequirePath:u.playerRequirePath,tunnel:u.tunnel,tunnelPort:u.tunnelPort,tunnelRoutes:u.tunnelRoutes,tunnelRoutesOutput:u.tunnelRoutesOutput,tunnelHostHeader:u.tunnelHostHeader,tunnelRegion:u.tunnelRegion,tunnelDiagnostics:u.tunnelDiagnostics,tunnelUseHttpAddress:u.tunnelUseHttpAddress,externalLambdatestTunnelId:u.externalLambdatestTunnelId,externalLambdatestUseWss:u.externalLambdatestUseWss||!1,externalLambdatestDisableAutomationTunneling:Boolean(u.externalLambdatestDisableAutomationTunneling),externalLambdatestMitm:Boolean(u.externalLambdatestMitm),beforeTest:u.beforeTest,afterTest:u.afterTest,beforeSuite:u.beforeSuite,afterSuite:u.afterSuite,timeout:u.timeout,timeoutWasGiven:c,browserTimeout:u.browserTimeout,newBrowserWaitTimeout:u.newBrowserWaitTimeout,getBrowserTimeout:u.getBrowserTimeout,getBrowserRetries:u.getBrowserRetries,getSessionTimeout:u.getSessionTimeout,getSessionRetries:u.getSessionRetries,driverRequestTimeout:u.driverRequestTimeout,driverRequestRetries:u.driverRequestRetries,testStartTimeout:u.testStartTimeout,testConfigNames:u.testConfig,testConfigIds:u.testConfigId,overrideMappingFile:u.overrideMappingFile,disableMockNetwork:u.disableMockNetwork,codeCoverageUrlFilter:u.codeCoverageUrlFilter,collectCodeCoverage:u.collectCodeCoverage,codeCoverageReportPath:u.codeCoverageReportPath,codeCoverageSourceMapPath:u.codeCoverageSourceMapPath,codeCoverageReporter:u.codeCoverageReporter,codeCoverageInclude:u.codeCoverageInclude,executionId:u.executionId,remoteRunId:u.remoteRunId,schedulerId:u.schedulerId,source:u.source,resultId:u.resultId,installCustomExtension:u.installCustomExtension,w3cCapabilities:u.w3cCapabilities,oldCapabilities:u.oldCapabilities,chromeBlockLocation:u.chromeBlockLocation,chromeUserDataDir:u.chromeUserDataDir,retries:u.retries,chromeExtraPrefs:e,chromeExtraArgs:t,disableCookiesSameSiteNoneRequiresSecure:u.disableCookiesSameSiteNoneRequiresSecure,seleniumCapsFileContent:r,shouldMonitorPerformance:u.monitorPerformance,user:u.user,lightweightMode:u.lightweightMode,createPrefechedData:u.createPrefechedData,saveRCALocally:u.saveRcaLocally,exitCodeIgnoreFailingTests:u.exitCodeIgnoreFailingTests,disableSockets:u.disableSockets,intersections:{labels:u.intersectWithLabel.length?[u.intersectWithLabel].flat():void 0,suiteNames:u.intersectWithSuite.length?[u.intersectWithSuite].flat():void 0,suiteIds:u.intersectWithSuiteId.length?[u.intersectWithSuiteId].flat():void 0},downloadBrowser:u.downloadBrowser}}});var qv={};var hs,af,cf,Ko,Gv,lf=T(()=>{"use strict";hs=E(require("path")),af=require("fs"),cf=require("child_process"),Ko=hs.resolve(__filename),Gv=!Ko.includes("node_modules")&&hs.dirname(Ko).endsWith("src");Gv&&!(0,af.existsSync)(hs.resolve(Ko,"..","..","..","webdriverio","build","index.js"))&&(console.log("Hi developer, we're initializing the runner dev env for the first time for you \u2764\uFE0F"),(0,cf.execSync)("yarn workspace @testim/webdriverio build",{cwd:hs.resolve(Ko,"..","..")}))});var $l={};$($l,{installAllLazyDependencies:()=>zv,lazyRequire:()=>ge});async function ge(s,e={}){let t=Lc(s);if(t)return t;let r;e.silent||(r=(0,uf.default)(`Installing ${s} before first usage...`).start());try{let n=await Hv(s);return r&&r.succeed(),n}catch(n){Vv.warn("failed to install dependency lazily",{dependency:s,err:n});let o=pf(s),i=`${s}@${o}`,c=process.argv.includes("npx")?"":"-g ",l=`Installation of ${s} failed. This typically means you are running an out-of-date version of Node.js or NPM.Please manually install by running the following command: npm install ${c}${i}`;throw r&&r.fail(l),n}}async function Hv(s){return gs.has(s)||(gs.set(s,df(s)),gs.get(s).catch(()=>{gs.delete(s)})),gs.get(s)}async function df(s){let e=Lc(s);if(e)return e;let t=pf(s),r=`${s}@${t}`;return await Io(lt(),r),Vt(s)}async function zv(){let s=Object.keys(qa);for(let e of s)await df(e)}function pf(s){let e=Object.entries(qa).find(([t])=>t===s);if(!e)throw new Error("The given package name is not lazyDependencies");return e[1]}var uf,Vv,gs,ft=T(()=>{"use strict";uf=E(require("ora"));ln();j();F();io();cn();Vv=x("lazy-require"),gs=new Map});var gf={};$(gf,{init:()=>Jv});async function Jv(s){var w,C;let e=typeof s=="string"?s:"";(typeof s!="string"||!s.trim())&&(e=(await(0,Gl.default)({type:"text",name:"project",message:"Please enter Project name",validate:v=>String(v).length>3})).project);let t=Kt.resolve(e);Jt.existsSync(t)&&Jt.readdirSync(t).length!==0&&(console.log(`${t} is not empty. Quitting...`),process.exit(1));let r=t.substr(Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"))+1),n=(0,ff.default)(r);if(!n.validForNewPackages){let b=`The name '${r}' is not a valid package name:`;throw console.log(Jo.default.red(b)),n.errors&&n.errors.forEach(v=>console.log(Jo.default.red(v))),n.warnings&&n.warnings.forEach(v=>console.log(Jo.default.yellowBright(`warning: ${v}`))),new R(`${b}
|
|
20
|
+
`))},Fl=["clover","html","json-summary","json","lcov","lcovonly","teamcity","text-lcov","text-summary","text"],{env:zo,argv:Bl,stdout:Fv,exit:Ho,cwd:St}=global.process,jv=["trace","debug","info","warn","error","silent"];Rc(Bl,new Set(["run","connect","agent","tunneld","start","init","install-lazy-deps"]));jl.description("Testim.io CLI").option("--run [file-glob-pattern]","codeful test files to run",Ae,[]).option("-h --help","output usage information",sf).option("-o --options-file [options-file.json]","").option("-c --config-file [config-file.js]","").option("--test-config [test-config]","test config name to override for all tests in current execution",Ae,[]).option("--test-config-id [test-config-id]","test config ID to override for all tests in current execution",Ae,[]).option("--params-file [params-file.json]","").option("--params [params-json-string]","").option("-t, --testId [test-id]","test ID to run",Ae,[]).option("-w, --webpackConfig [webpack-configuration]","webpack configuration used to build the code based project").option("--test-id [test-id]","test ID to run",Ae,[]).option("-l, --label [label]","labels to search test by",Ae,[]).option("-n, --name [test-name]","test name to run",Ae,[]).option("--project [project-id]","project ID").option("-r, --report-file [report junit xml path]","where to save junit xml results file").option("--urls","add step urls to the junit report").option("--override-report-file-classname [override-report-file-classname]","custom junit class name for the junit reporter").option("--reporters [names]","report types",Dv).option("-h, --host [host-name]","host name or ip containing the selenium grid").option("-p, --port [host-port]","host port").option("-g, --grid [grid-name]","grid name").option("--path [grid-path]","grid path").option("--protocol [grid-protocol]","grid protocol http or https").option("--grid-username [grid-username]","grid http basic auth username").option("--grid-password [grid-password]","grid http basic auth password").option("-gi --grid-id [grid-id]","grid ID").option("-b, --browser [browser-type]","browser type (chrome/firefox)").option("-h, --headless [headless]","run in headless mode").option("-m, --mode [runner-mode]","use extension or selenium mode (extension/selenium/appium)").option("--branch [branch]","branch name",void 0).option("--base-url [base-url]","change base-url to a specified url for all tests in current execution").option("--token [token]","identification token to testim").option("--is-regression-baseline-run","save doms and run results as regression baseline data").option("--parallel [number-of-tests]","number of tests to run in parallel").option("--before-parallel [number-of-tests]","number of tests to run in parallel during the before phase of a test plan").option("--after-parallel [number-of-tests]","number of tests to run in parallel during the after phase of a test plan").option("--canary [canary-mode]","enable canary mode",!1).option("--test-plan [test-plan-name]","test plan to run",Ae,[]).option("--test-plan-id [test-plan-id]","test plan to run",Ae,[]).option("--suite [suite-name]","suite to run",Ae,[]).option("--suite-id [suite-id]","suite ID to run",Ae,[]).option("--rerun-failed-by-run-id [run-id]","allows re-running failed tests from a specific run ID").option("--disable-grid-check [boolean]","disable checking if selenium grid is available",!1).option("--disable-native-events [boolean]","pass nativeEvents=false capability to the selenium browser (in selenium mode)",!1).option("--disable-timeout-retry [boolean]","disable retry after test pass test timeout",!1).option("--ca-file [ca-file-location]","ca certificate file location").option("--proxy [proxy-url]","proxy url to all requests").option("--proxy-for-grid [proxy-for-grid]","used together with --proxy to also router grid traffic through a proxy").option("--result-label [result-label]","result label",Ae,[]).option("-oen --override-execution-name [execution-name]","override the default execution name","").option("--retries [max_num_of_retries]","number of retries on test failure, defaults to 0 (no retries)",Number,0).option("--set-retention [retention-in-days]","set the number of days for results retention").option("--user [user-id]","user ID for local Testim-CLI").option("--pass-zero-tests","don't fail the run if no tests were found").option("--device-model [device-model]","The device model to use, iPhone 12, Nexus 5X, SM-G900P etc....").option("--device-udid [device-udid]","the device unique id").option("--os-version [os-version]","The operating system version number").option("--app-id [app-id]","The application id from app library on Testim Editor App").option("--appium-log-level [appium-log-level]","Level of logging verbosity").option("-rad --reset-app-data [reset-app-data]","set noReset appium capability to true, default value true!",!1).option("-fr --full-reset [full-reset]","set fullReset appium capability to true to reinstall application on session start and session end").option("-roso --reset-on-session-start-only [reset-on-session-start-only]","set resetOnSessionStartOnly appium capability to true to avoid uninstall app on session end (ios run only)",!1).option("-str --suppress-tms-reporting [suppress-tms-reporting]","disable test management reporting",!1).option("-tsr --tms-suppress-reporting [tms-suppress-reporting]","disable test management reporting",!1).option("-tid --tms-run-id [tms-run-id]","update existing result in test management","").option("-tff --tms-field-file [tms-field-file.json]","pass field file location to add custom result field to the tms result report","").option("--disable-file-cache","disable internal CLI file caching").option("--file-cache-location [directory]"," internal CLI file caching location").option("--test-start-timeout [test-start-timeout]","The time to wait for a test to start after getting a browser session",Number,Number(zo.TESTIM_TEST_START_TIMEOUT)||2*60*1e3).option("--timeout [test-timeout]","Test run timeout in milliseconds",Number).option("--browser-timeout [open-browser-timeout]","Get browser from grid timeout in milliseconds",Number).option("--new-browser-wait-timeout [max-wait-to-browser]","Maximum get browser wait in minutes",Number).option("--get-browser-timeout [get-browser-timeout]","Timeout for a single attempt to get browser from the grid configured in the project's plan",Number).option("--get-browser-retries [get-browser-retries]","Number of attempts to get browser from the grid configured in the project's plan",Number).option("--get-session-timeout [get-session-timeout]",'Timeout for "/session" request to the selenium server',Number,(0,Ml.default)("90s")).option("--get-session-retries [get-session-retries]",'Retries for "/session" request to the selenium server',Number,3).option("--driver-request-timeout [driver-request-timeout]","Timeout for any WebDriver request to the grid server",Number,(0,Ml.default)("90s")).option("--driver-request-retries [driver-request-retries]","Retries for any WebDriver request to the grid server",Number,3).option("--use-local-chrome-driver [use-local-chrome-driver]","use a local ChromeDriver instance instead of a selenium grid").option("--chrome-binary-location [chrome-binary-location]","Chrome binary location").option("--use-chrome-launcher","use a local Chrome installation without selenium").option("-mnh --mock-network-har","use the HAR file configured in the Testim editor to mock network traffic").option("-mnp --mock-network-pattern [local file location path]","use a JSON rule file to mock network traffic (Rule file schema: https://help.testim.io/page/mocking-network-traffic)").option("-omf --override-mapping-file [local file location path]","pass map file location to override mock network (see schema: https://help.testim.io/page/mocking-network-traffic)").option("-dmn --disable-mock-network","Disable mock mode for the entire CLI run").option("--run-quarantined-tests","Run quarantine tests").option("--collect-code-coverage","collect code coverage for all js files under base url").option("--code-coverage-url-filter [url pattern]","collect code coverage for all js files matching url filter (url including asterisk)").option("--code-coverage-report-path [path]","where to save coverage report (default ./coverage)").option("--code-coverage-source-map-path [path]","path of source code").option("--code-coverage-reporter [reporter]",`set code coverage reporter (default html and text), options: ${Fl.join("/")}`,Ae,[]).option("--code-coverage-include [pattern]","set selecting files for coverage (default src/**)",Ae,[]).option("--sauce-user [sauce-lab-user]","user to connect to sauce labs").option("--sauce-key [sauce-lab-key]","key to use when connecting to sauce labs").option("--sauce-options [sauce-options]","json file of browser and os options for sauce").option("--browserstack-user [browserstack-user]","user to connect to browserStack").option("--browserstack-key [browserstack-key]","key to use when connecting to browserStack").option("--browserstack-options [browserstack-options]","json file of browser and os options for browserStack").option("--perfecto-token [perfecto-token]","security token to use when connecting to perfecto").option("--perfecto-options [perfecto-options]","json file of browser and os options for perfecto").option("--experitest-token [experitest-token]","security token to use when connecting to experitest").option("--testobject-key [testobject-key]","api key to use when connecting to testobject").option("--testobject-options [testobject-options]","json file of options for testobject").option("--ext [extension src path]","use extension from path (default it '/..')").option("--extension-path [path to extension archived file]","override the used extension").option("--install-custom-extension [chrome extension zipped file url or local path]","chrome extension to be installed in the browser").option("--player-path [path to player file]").option("--player-require-path [path to unminified player - development only]").option("--init [init]","Path for an initial test app").option("--inspect [port]","Opens node inspector at given port",Number).option("--login","Log in to Testim").option("--require-credentials","Log in to Testim if not already logged in").option("--tunneld","run a tunnel daemon only").option("--tunnel [tunnel]","enable tunnel").option("--tunnel-routes [routes]","tunnel routes for cloudflare tunnels").option("--tunnel-port [tunnel-port]","tunnel port address").option("--tunnel-host-header [tunnel-host-header]","tunnel host header").option("--tunnel-region [tunnel-region]","ngrok tunnel region").option("--tunnel-diagnostics","collect ngrok tunnel diagnostics").option("--tunnel-use-http-address [tunnel-use-http-address]","use http:// address instead of https://",!1).option("--external-lambdatest-tunnel-id [tunnel-id]","use existing lambdatest tunnel ID").option("--external-lambdatest-use-wss","use wss instead of ssh for LT",!1).option("--external-lambdatest-disable-automation-tunneling","don't tunnel Testim calls in LT tunnel",!0).option("--external-lambdatest-mitm","Turn on LT Man in the middle",!1).option("--w3c-capabilities [enable-w3c-caps-mode]","enable/disable w3c capabilities format (default enable)",JSON.parse,!0).option("--old-capabilities [enable-old-caps-mode]","enable/disable old capabilities format (default enable)",JSON.parse,!0).option("--disable-sockets","Disable CLI sockets",!1).option("--executionId [execution-id]","","").option("--remoteRunId [remote-run-id]","","").option("--schedulerId [scheduler-id]","","").option("--source [source]","","cli").option("--resultId [result-id]","","").option("--connect, --agent [enable-agent-mode]","enable Testim CLI agent mode",!1).option("--start [enable-start]","Connect to testim and open the editor in a standalone browser",!1).option("--download-browser","when used with the start option, downloads a fixed version to run Testim editor in",!1).option("--agent-port [agent-port]","set agent port",Number,42543).option("--agent-bind [agent-host-bind]","set agent host bind","127.0.0.1").option("--chrome-extra-prefs [chrome-extra-prefs]","add extra chrome preferences","").option("--chrome-extra-args [chrome-extra-args]","add extra chrome arguments separated by ','","").option("--chrome-block-location [chrome-block-location]","block chrome geolocation",!1).option("--chrome-user-data-dir [chrome-user-data-dir]","use custom chrome user date dir",!1).option("--disable-cookies-same-site-none-requires-secure [disable-same-site-none-requires-secure]","Disable cookies without SameSite must be secure",!1).option("--selenium-caps-file [selenium-caps-file.json]","json file to merge into Testim selenium desired capabilities").option("--version [version]","print the current version of the Testim CLI and exit",!1).option("--monitor-performance","collect test playback performance data").option("--high-speed","DEPRECATED: use --turbo-mode instead").option("--turbo-mode","run in turbo mode").option("--lightweight-mode [settings]","run lightweight mode").option("--create-prefeched-data [location]","prefetch data into local cache file").option("--use-prefeched-data [location]","use prefetched data from local cache file, and force using only cached data").option("--save-rca-locally [path]","save root cause analysis assets locally").option("--exit-code-ignore-failing-tests","return exit code of zero when tests fail. non zero exit code will mean a real error occurred").option("--intersect-with-label [label]","Out of the execution's test list, run only those tests that have the specified label",Ae,[]).option("--intersect-with-suite [suiteName]","Out of the execution's test list, run only those tests that are included in the specified suite (by suite name)",Ae,[]).option("--intersect-with-suite-id [suiteId]","Out of the execution's test list, run only those tests that are included in the specified suite (by suite ID)",Ae,[]).option("--install-lazy-deps [install-lazy-deps]","Install all lazy dependencies from package.json",!1).parse(Bl);u=jl.opts(),Bv=()=>{u.grid||u.gridId||(u.host||(u.host="ondemand.saucelabs.com"),u.port||(u.port=80))},$v=()=>{u.grid||u.gridId||(u.host||(u.host="hub-cloud.browserstack.com"),u.port||(u.port=80))},Wv=async()=>{var g,y,w,C,b,v,I,k,D;u.inspect&&require("inspector").open(u.inspect);let s={},e={},t=[],r={};if(!Bl.slice(2).length)throw sf(),new fr;if(u.requireCredentials){let S=await Promise.resolve().then(()=>(fs(),En)),_=await S.getProjectId(),P=await S.getToken();(!_||!P)&&await S.doLogin()}if(u.login)return await(await Promise.resolve().then(()=>(fs(),En))).doLogin(),{loginMode:!0};if(u.init)return{initCodimMode:!0,initTestProject:u.init};if(u.version){let S="Testim CLI Version: ";zo.npm_package_version&&(console.log(S,zo.npm_package_version),Ho(0));let _=nt();_&&(console.log(S,_),Ho(0)),console.log("Could not find version, please check the package.json manually"),Ho(0)}if(u.installLazyDeps)return{installLazyDepsMode:!0};u.disableFileCache&&sm();let n=u.fileCacheLocation||u.usePrefechedData||u.createPrefechedData;if(n){let S=Ne.resolve(n);tm(S)}if(u.usePrefechedData&&nm(),u.playerRequirePath){let S=Ne.resolve(u.playerRequirePath);console.log("Using Local Clickim for Player Require Path =",S);let _=Ne.join(S,"tsconfig.node.json"),L=require("ts-node").register({project:_,ignore:[/node_modules/,new RegExp(`^${mt.escapeRegExp(Ne.relative(St(),__dirname))}`)],transpileOnly:!0});require("tsconfig-paths").register({paths:L.config.options.paths,baseUrl:L.config.options.baseUrl}),(Ee(),G(_r)).options.playerPath=S;let V=require("module"),Y=V.prototype.require;V.prototype.require=function(fe){return fe==="rox-alias"?Y.call(this,"rox-node"):Y.apply(this,arguments)}}if(u.caFile&&(global.caFileContent=Ul.readFileSync(u.caFile)),u.proxy&&(global.proxyUri=u.proxy,global.SuperagentProxy=require("superagent-proxy"),global.ProxyAgent=require("proxy-agent"),global.HttpsProxyAgent=require("https-proxy-agent")),u.proxyForGrid&&!u.proxy)throw new R("missing --proxy option");if(zm(u))return Km(u);try{let S={};u.configFile?S=require(Ne.join(St(),u.configFile)).config:u.optionsFile&&(S=require(Ne.join(St(),u.optionsFile))),S&&typeof S.then=="function"&&(S=await S),Object.keys(S).forEach(_=>{let P=Nv(_);u[P]=Mv(u[P],S[_])})}catch(S){throw S.message=`Unable to read options file: ${S.message}`,S}if(u.tunneld)return{tunnel:!0,tunnelPort:u.tunnelPort,tunnelRoutes:u.tunnelRoutes,tunnelRoutesOutput:u.tunnelRoutesOutput,tunnelHostHeader:u.tunnelHostHeader,tunnelRegion:u.tunnelRegion,tunnelDiagnostics:u.tunnelDiagnostics,tunnelUseHttpAddress:u.tunnelUseHttpAddress,tunnelOnlyMode:!0,token:u.token,project:u.project};let o=((g=u.testConfig)==null?void 0:g.length)||((y=u.testConfigId)==null?void 0:y.length),i=((w=u.testPlan)==null?void 0:w.length)||((C=u.testPlanId)==null?void 0:C.length),a=((b=u.suite)==null?void 0:b.length)||((v=u.suiteId)==null?void 0:v.length);if(u.seleniumCapsFile)try{r=require(Ne.join(St(),u.seleniumCapsFile))}catch(S){throw new R(`Failed to parse selenium caps file file error: ${S.message}`)}if((I=u.reporters)!=null&&I.includes("junit")&&!u.reportFile&&console.log("Warning: please define --report-file option for JUnit reporter"),!u.tunnel&&u.externalLambdatestTunnelId)throw new R("missing --tunnel parameter");if(!u.tunnel&&u.externalLambdatestUseWss)throw new R("missing --tunnel parameter");if(!u.tunnel&&[u.tunnelPort,u.tunnelHostHeader,u.tunnelRegion,u.tunnelDiagnostics].some(Boolean))throw new R("missing --tunnel parameter");if(u.chromeExtraPrefs)try{e=require(Ne.join(St(),u.chromeExtraPrefs))}catch(S){throw new R(`Failed to read/open chrome extra prefs file error: ${S.message}`)}if(u.chromeExtraArgs){let S=u.chromeExtraArgs.split(",");for(let _ of S){let[P]=_.split("=");Zm.includes(P)||u.useLocalChromeDriver||u.useChromeLauncher?(t.push(_),P==="proxy-server"&&t.push("proxy-bypass-list=*.testim.io;*.coralogix.com;*.cloudinary.com;*.rollout.io")):console.warn(`Ignoring an unsupported chrome arg (${P}), allowed values: ${JSON.stringify(Zm)}`)}}if(u.paramsFile)try{s=Object.assign({},s,require(Ne.join(St(),u.paramsFile)))}catch(S){throw new R(`Failed to read/open params file error: ${S.message}`)}if(u.params)try{s=Object.assign({},s,JSON.parse(u.params))}catch(S){throw new R(`Failed to parse params string error: ${S.message}`)}if(u.sauceUser&&!u.sauceKey||!u.sauceUser&&u.sauceKey)throw new R("missing --sauce-user <sauce-user> or --sauce-key <sauce-key>");if(u.sauceUser&&u.sauceKey&&(Bv(),u.saucelabs={},u.saucelabs.username=u.sauceUser,u.saucelabs.accessKey=u.sauceKey),u.sauceOptions)try{let S=require(Ne.join(St(),u.sauceOptions)),_=S.platformName&&["ios","android"].includes(S.platformName.toLowerCase());if(S.browserName){let L=S.browserName.toLowerCase();switch(L){case"microsoftedge":u.browser="edge";break;default:u.browser=L}}u.browser==="edge"&&parseFloat(S.version)>=oo&&(u.browser="edge-chromium");let P=parseFloat(S.version)<50&&!["dev","beta"].includes(S.version);if(!_&&u.browser==="chrome"&&P)throw new R("The minimum chrome supported version is 50.0");u.saucelabs=Object.assign({},u.saucelabs,S)}catch(S){throw new R(`Failed to parse saucelabs options file error: ${S.message}`)}if(u.browserstackUser&&!u.browserstackKey||!u.browserstackUser&&u.browserstackKey)throw new R("missing --browserstack-user <browserstack-user> or --browserstack-key <browserstack-key>");if(u.browserstackUser&&u.browserstackKey&&($v(),u.browserstack={},u.browserstack["browserstack.user"]=u.browserstackUser,u.browserstack["browserstack.key"]=u.browserstackKey),u.browserstackOptions)try{let S=require(Ne.join(St(),u.browserstackOptions)),_=S.platform&&["mac","android"].includes(S.platform.toLowerCase());if(S.browserName&&(u.browser=S.browserName.toLowerCase()),u.browser==="edge"&&parseFloat(S.browser_version)>=oo&&(u.browser="edge-chromium"),!_&&parseFloat(S.browser_version)<50&&u.browser==="chrome")throw new R("The minimum chrome supported version is 50.0");u.browserstack=Object.assign({},u.browserstack,S)}catch(S){throw new R(`Failed to parse browserstack options file error: ${S.message}`)}if(u.perfecto={},u.perfectoToken&&(u.perfecto.securityToken=u.perfectoToken),u.perfectoOptions)try{let S=require(Ne.join(St(),u.perfectoOptions)),_={location:"US East",securityToken:u.perfectoToken};u.perfecto=Object.assign({},_,S)}catch(S){throw new R(`Failed to parse perfecto options file error: ${S.message}`)}if(u.testobjectSauce={},u.testobjectKey&&(u.testobjectSauce.testobjectApiKey=u.testobjectKey),u.testobjectOptions)try{let S=require(Ne.join(St(),u.testobjectOptions)),_={testobjectApiKey:u.testobjectKey};u.testobjectSauce=Object.assign({},_,S)}catch(S){throw new R(`Failed to parse test object options file error: ${S.message}`)}if(!u.project){let _=await(await Promise.resolve().then(()=>(fs(),En))).getProjectId();if(_)u.project=_;else throw new R("missing project-id info, either --login to provide new credentials or use --project <project-id>")}u.mode||(u.mode=u.run.length?"selenium":"extension"),u.testConfig&&(u.testConfig=[u.testConfig].flat()),u.testConfigId&&(u.testConfigId=[u.testConfigId].flat()),u.retries=!u.retries||typeof u.retries=="boolean"?1:Number(u.retries)+1,u.browserTimeout=!u.browserTimeout||typeof u.browserTimeout=="boolean"?60*1e3:u.browserTimeout,u.newBrowserWaitTimeout=!u.newBrowserWaitTimeout||typeof u.newBrowserWaitTimeout=="boolean"?10*60*1e3:u.newBrowserWaitTimeout*60*1e3,u.getBrowserTimeout||(u.getBrowserTimeout=u.browserTimeout),u.getBrowserRetries||(u.getBrowserRetries=Math.round(u.newBrowserWaitTimeout/u.browserTimeout)),u.getSessionTimeout=u.browserTimeout<u.getSessionTimeout?u.getSessionTimeout:u.browserTimeout,u.driverRequestTimeout=u.browserTimeout<u.driverRequestTimeout?u.driverRequestTimeout:u.browserTimeout;let c=Boolean(u.timeout);if(u.timeout=!u.timeout||typeof u.timeout=="boolean"?10*60*1e3:u.timeout,u.beforeParallel=!u.beforeParallel||typeof u.beforeParallel=="boolean"?1:Number(u.beforeParallel),u.parallel=!u.parallel||typeof u.parallel=="boolean"?1:Number(u.parallel),u.afterParallel=!u.afterParallel||typeof u.afterParallel=="boolean"?1:Number(u.afterParallel),u.parallel>1&&u.run&&!u.gridId&&!u.grid&&(!u.testPlan||u.testPlan.length===0)&&!((k=u.testPlanId)!=null&&k.length)&&Fv.isTTY&&!u.headless&&!zo.TERM&&((await require("prompts")({type:"toggle",name:"isSure",message:"Running in parallel without --headless flag will open several browsers on your computer. Are you sure?",initial:!1,active:"yes",inactive:"no"})).isSure||Ho(0)),u.tunnelPort=!u.tunnelPort||typeof u.tunnelPort=="boolean"?"80":u.tunnelPort,u.port&&(u.port=Number(u.port)),u.retries<=0||Number.isNaN(u.retries))throw new R("test failure retry count could not be a negative number or string, --retries <max_num_of_retries>");if(u.retries>21)throw new R("Max number of retries exceeded. Number cannot be greater than 20, --retries <max_num_of_retries>");if(!u.token){let _=await(await Promise.resolve().then(()=>(fs(),En))).getToken();if(_)u.token=_;else throw new R("missing Testim Access Token, either --login to provide new credentials or use --token <testim-access-token>, contact info@testim.io if you need a new one.")}if(u.browserTimeout<=0||Number.isNaN(u.browserTimeout))throw new R("get browser timeout could not be a negative number, --browser-timeout <get-browser-timeout>");if(u.newBrowserWaitTimeout<=0||Number.isNaN(u.newBrowserWaitTimeout))throw new R("max new browser wait timeout could not be a negative number, --new-browser-wait-timeout <max-wait-to-browser>");if(u.timeout<=0||Number.isNaN(u.timeout))throw new R("test run timeout could not be a negative number, --timeout <run-timeout>");if(u.beforeParallel<=0||Number.isNaN(u.beforeParallel))throw new R("before-parallel could not be a negative number or not number, --before-parallel <number-of-tests>");if(u.parallel<=0||Number.isNaN(u.parallel))throw new R("parallel could not be a negative number or not number, --parallel <number-of-tests>");if(u.afterParallel<=0||Number.isNaN(u.afterParallel))throw new R("after-parallel could not be a negative number or not number, --after-parallel <number-of-tests>");if(![Q.EXTENSION,Q.SELENIUM,Q.APPIUM].includes(u.mode))throw new R(`runner mode <${u.mode}> is not supported`);if(u.mode!==Q.SELENIUM&&u.disableNativeEvents)throw new R("disable-native-events is only applicable in selenium mode");if(!u.browser&&!o&&!i&&(u.browser="chrome"),u.appiumLogLevel||(u.appiumLogLevel="silent"),!jv.includes(u.appiumLogLevel))throw new R(`runner appium-log-level <${u.appiumLogLevel}> is not supported`);if(u.testPlan&&u.testPlan.length===0&&u.testPlanId&&u.testPlanId.length===0){if(typeof u.host!="string"&&typeof u.grid!="string"&&typeof u.gridId!="string"&&u.run.length===0&&!u.useLocalChromeDriver&&!u.useChromeLauncher&&!u.createPrefechedData)throw new R("missing remote grid address parameter, specify --host <host-name-or-ip> or --grid <grid-name> or --grid-id <grid-id>")}else if(u.testId.length||u.label.length||u.name.length||o||u.browser||a||u.useLocalChromeDriver||u.useChromeLauncher)throw new R("cannot set --testId, --label, --name, --browser, --test-config, --test-config-id, --use-local-chrome-driver --use-chrome-launcher or --suite with --test-plan option");if(!i&&(u.beforeParallel!==1||u.afterParallel!==1))throw new R("cannot set --before-parallel or --after-parallel without --test-plan option");if((u.testId.length||i||u.label.length||u.name.length||a)&&u.file)throw new R("Cannot pass codeful automation tests with --testId --label --name or --suite");if([u.host,u.grid,u.gridId].filter(Boolean).length>1)throw new R("please define exactly one of --grid or --grid-id or --host");if((D=u.host)!=null&&D.includes("/")&&(/^(f|ht)tps?:\/\//i.test(u.host)||(u.host=`http://${u.host}`),u.host=tf.parse(u.host).hostname),u.resultLabel.length){u.resultLabel=u.resultLabel.map(_=>_.trim()).filter(Boolean);let S=u.resultLabel.filter(_=>_.length>=250).filter(Boolean);if(u.branch==="auto-detect"&&u.resultLabel.includes("auto-detect-branch")&&Ir()&&u.resultLabel.unshift(Ir()),S.length)throw new R("A result label cannot exceed 250 characters")}let d=$m(u),m=$o(u);if(!u.w3cCapabilities&&!u.oldCapabilities)throw new R("cannot set --w3c-capabilities and --old-capabilities options as false");if(u.protocol||(u.protocol=u.port===443?"https":"http"),!["http","https"].includes(u.protocol))throw new R("invalid --protocol value, allow --protocol http or https");if(u.rerunFailedByRunId&&u.branch)throw new R("It is not possible to use --branch with --rerun-failed-by-run-id. Tests will automatically run on the same branch that was used in the original run");if(u.rerunFailedByRunId&&(a||u.name.length||u.testId.length||u.label.length||i))throw new R("Re-running failed tests is not possible when suite (--suite), label (--label), plan (--test-plan), or other test flags (--test) are provided. Please remove these flags and try again");if(u.run.length){let S=require("glob");if(u.files=mt.flatMap(u.run,_=>S.sync(_)),u.files.length===0)throw new R(`No files found at path '${u.run}'.`)}else u.files=[];if(u.setRetention&&!mt.inRange(mt.parseInt(u.setRetention),1,11))throw new R("Please provide the number of days that the test results will be retained for (--set-retention must be a whole number between 1 to 10)");u.setRetention&&(u.setRetention=Number(u.setRetention));let p="is no longer supported, please use --override-mapping-file";if(u.mockNetworkHar)throw new R(`--mock-network-har ${p}`);if(u.mockNetworkPattern)throw new R(`--mock-network-pattern ${p}`);if(u.disableMockNetwork&&u.overrideMappingFile)throw new R("You can either use --disable-mock-network or --override-mapping-file");if(!u.collectCodeCoverage&&u.codeCoverageSourceMapPath)throw new R("cannot set --code-coverage-source-map-path without passing --collect-code-coverage");if(!u.collectCodeCoverage&&u.codeCoverageReporter.length)throw new R("cannot set --code-coverage-reporter without passing --collect-code-coverage");if(!u.collectCodeCoverage&&u.codeCoverageInclude.length)throw new R("cannot set --code-coverage-include without passing --collect-code-coverage");if(u.collectCodeCoverage&&u.codeCoverageReporter&&mt.difference(u.codeCoverageReporter,Fl).length){let S=mt.difference(u.codeCoverageReporter,Fl);throw new R(`invalid --code-coverage-reporter parameters ${S.join("/")}`)}u.codeCoverageReporter=u.codeCoverageReporter.length===0?["html","text"]:u.codeCoverageReporter,u.codeCoverageInclude=u.codeCoverageInclude.length===0?["src/**"]:u.codeCoverageInclude;let f={mockNetworkHar:"--mock-network-har",mockNetworkPattern:"--mock-network-pattern",overrideMappingFile:"--override-mapping-file",codeCoverageUrlFilter:"--code-coverage-url-filter",collectCodeCoverage:"--collect-code-coverage",disableMockNetwork:"--disable-mock-network",useChromeLauncher:"--use-chrome-launcher"},h=Object.keys(f).filter(S=>Boolean(u[S]));if(u.mode!==Q.EXTENSION&&h.length){let S=h.length>1?"are":"is";throw new R(`${h.map(_=>f[_]).join(" and ")} ${S} only applicable in extension mode`)}if(u.tmsFieldFile)try{let S=Ul.readFileSync(u.tmsFieldFile);u.tmsCustomFields=JSON.parse(S)}catch(S){throw new R(`failed to parse field file error: ${S.message}`)}if(u.highSpeed&&(Uv("--high-speed"," --turbo-mode"),u.turboMode=!0),u.deviceUdid&&(u.deviceModel||u.osVersion))throw new R("It is not possible to use --osVersion or --deviceModel with --device-udid. device-udid is unique and cannot be combined with another flag");if(u.resetAppData&&u.fullReset)throw new R("It is not possible to set both --reset-app-data and --full-reset capabilities to true at the same time!");if(u.resetOnSessionStartOnly&&!u.fullReset&&console.warn("Ignoring --reset-on-session-start-only flag, should be used when --full-reset is provided for ios runs"),u.lightweightMode)try{let S={general:!0,disableLabs:!0,disableFeatureFlags:!0,disableAssets:!0,disablePixelValidation:!0,disableResults:!0,disableStepDelay:!0,disableRemoteStep:!0,assumePreloadedSharedSteps:!0,disableVisibilityCheck:!1,disableLocators:!1,bypassSetup:!1,disableAutoImprove:!0,disableQuotaBlocking:!0,onlyTestIdsNoSuite:!0,uploadAssetsAndResultsOnFailure:!0,preloadTests:!0,disableProjectDefaults:!0,type:"lightweight"},_=typeof u.lightweightMode=="string"?JSON.parse(u.lightweightMode):{};u.lightweightMode=Object.assign({},S,_)}catch(S){throw new R(`failed to parse lightweightMode settings error: ${S.message}`)}else u.turboMode&&u.mode===Q.EXTENSION&&(u.lightweightMode={general:!0,disableLabs:!1,disableFeatureFlags:!1,disableAssets:!0,disablePixelValidation:!1,disableResults:!0,disableStepDelay:!0,disableRemoteStep:!1,assumePreloadedSharedSteps:!1,disableVisibilityCheck:!1,disableLocators:!1,bypassSetup:!1,disableQuotaBlocking:!1,disableAutoImprove:!1,onlyTestIdsNoSuite:!1,uploadAssetsAndResultsOnFailure:!0,preloadTests:!1,disableProjectDefaults:!1,type:"turboMode"});if(typeof u.baseUrl=="boolean")throw new R("base url cannot be used as a flag, and must contain a string value");return{testId:[u.testId].flat(),name:[u.name].flat(),label:[u.label].flat(),suites:[u.suite].flat(),suiteIds:[u.suiteId].flat(),testPlan:[u.testPlan].flat(),testPlanIds:[u.testPlanId].flat(),files:[u.files].flat(),webpackConfig:u.webpackConfig,reportFile:u.reportFile,urls:u.urls,reportFileClassname:u.overrideReportFileClassname,reporters:u.reporters,project:u.project,host:u.host,headless:u.headless,useLocalChromeDriver:u.useLocalChromeDriver,chromeBinaryLocation:u.chromeBinaryLocation,useChromeLauncher:u.useChromeLauncher,port:u.port,grid:u.grid,gridId:u.gridId,disableNativeEvents:u.disableNativeEvents,saucelabs:u.saucelabs,browserstack:u.browserstack,baseUrl:u.baseUrl,branch:(u.branch==="auto-detect"?Ir():u.branch)||"master",autoDetect:u.branch==="auto-detect",token:u.token,userParamsData:s,mode:u.mode,isRegressionBaselineRun:u.isRegressionBaselineRun,browser:u.browser,beforeParallel:u.beforeParallel,parallel:u.parallel,afterParallel:u.afterParallel,canary:u.canary,rerunFailedByRunId:u.rerunFailedByRunId,disableGridCheck:u.disableGridCheck,disableTimeoutRetry:u.disableTimeoutRetry,resultLabels:u.resultLabel,path:u.path,protocol:u.protocol,perfecto:u.perfecto,experitestToken:u.experitestToken,testobjectSauce:u.testobjectSauce,gridUsername:u.gridUsername,gridPassword:u.gridPassword,overrideExecutionName:u.overrideExecutionName,tmsSuppressReporting:Boolean(u.suppressTmsReporting)||Boolean(u.tmsSuppressReporting),tmsRunId:u.tmsRunId,tmsCustomFields:u.tmsCustomFields,proxyForGrid:u.proxyForGrid,retentionDays:u.setRetention,passZeroTests:Boolean(u.passZeroTests),runQuarantinedTests:Boolean(u.runQuarantinedTests),deviceModel:u.deviceModel,deviceUdid:u.deviceUdid,osVersion:u.osVersion,appId:u.appId,appiumLogLevel:u.appiumLogLevel,resetAppData:u.resetAppData,fullReset:u.fullReset,resetOnSessionStartOnly:u.resetOnSessionStartOnly,ext:u.ext,extensionLocation:[u.extensionPath||d].flat(),extensionPath:u.extensionPath,playerLocation:u.playerPath||m,playerPath:u.playerPath,playerRequirePath:u.playerRequirePath,tunnel:u.tunnel,tunnelPort:u.tunnelPort,tunnelRoutes:u.tunnelRoutes,tunnelRoutesOutput:u.tunnelRoutesOutput,tunnelHostHeader:u.tunnelHostHeader,tunnelRegion:u.tunnelRegion,tunnelDiagnostics:u.tunnelDiagnostics,tunnelUseHttpAddress:u.tunnelUseHttpAddress,externalLambdatestTunnelId:u.externalLambdatestTunnelId,externalLambdatestUseWss:u.externalLambdatestUseWss||!1,externalLambdatestDisableAutomationTunneling:Boolean(u.externalLambdatestDisableAutomationTunneling),externalLambdatestMitm:Boolean(u.externalLambdatestMitm),beforeTest:u.beforeTest,afterTest:u.afterTest,beforeSuite:u.beforeSuite,afterSuite:u.afterSuite,timeout:u.timeout,timeoutWasGiven:c,browserTimeout:u.browserTimeout,newBrowserWaitTimeout:u.newBrowserWaitTimeout,getBrowserTimeout:u.getBrowserTimeout,getBrowserRetries:u.getBrowserRetries,getSessionTimeout:u.getSessionTimeout,getSessionRetries:u.getSessionRetries,driverRequestTimeout:u.driverRequestTimeout,driverRequestRetries:u.driverRequestRetries,testStartTimeout:u.testStartTimeout,testConfigNames:u.testConfig,testConfigIds:u.testConfigId,overrideMappingFile:u.overrideMappingFile,disableMockNetwork:u.disableMockNetwork,codeCoverageUrlFilter:u.codeCoverageUrlFilter,collectCodeCoverage:u.collectCodeCoverage,codeCoverageReportPath:u.codeCoverageReportPath,codeCoverageSourceMapPath:u.codeCoverageSourceMapPath,codeCoverageReporter:u.codeCoverageReporter,codeCoverageInclude:u.codeCoverageInclude,executionId:u.executionId,remoteRunId:u.remoteRunId,schedulerId:u.schedulerId,source:u.source,resultId:u.resultId,installCustomExtension:u.installCustomExtension,w3cCapabilities:u.w3cCapabilities,oldCapabilities:u.oldCapabilities,chromeBlockLocation:u.chromeBlockLocation,chromeUserDataDir:u.chromeUserDataDir,retries:u.retries,chromeExtraPrefs:e,chromeExtraArgs:t,disableCookiesSameSiteNoneRequiresSecure:u.disableCookiesSameSiteNoneRequiresSecure,seleniumCapsFileContent:r,shouldMonitorPerformance:u.monitorPerformance,user:u.user,lightweightMode:u.lightweightMode,createPrefechedData:u.createPrefechedData,saveRCALocally:u.saveRcaLocally,exitCodeIgnoreFailingTests:u.exitCodeIgnoreFailingTests,disableSockets:u.disableSockets,intersections:{labels:u.intersectWithLabel.length?[u.intersectWithLabel].flat():void 0,suiteNames:u.intersectWithSuite.length?[u.intersectWithSuite].flat():void 0,suiteIds:u.intersectWithSuiteId.length?[u.intersectWithSuiteId].flat():void 0},downloadBrowser:u.downloadBrowser}}});var qv={};var hs,af,cf,Ko,Gv,lf=T(()=>{"use strict";hs=E(require("path")),af=require("fs"),cf=require("child_process"),Ko=hs.resolve(__filename),Gv=!Ko.includes("node_modules")&&hs.dirname(Ko).endsWith("src");Gv&&!(0,af.existsSync)(hs.resolve(Ko,"..","..","..","webdriverio","build","index.js"))&&(console.log("Hi developer, we're initializing the runner dev env for the first time for you \u2764\uFE0F"),(0,cf.execSync)("yarn workspace @testim/webdriverio build",{cwd:hs.resolve(Ko,"..","..")}))});var $l={};$($l,{installAllLazyDependencies:()=>zv,lazyRequire:()=>ge});async function ge(s,e={}){let t=Lc(s);if(t)return t;let r;e.silent||(r=(0,uf.default)(`Installing ${s} before first usage...`).start());try{let n=await Hv(s);return r&&r.succeed(),n}catch(n){Vv.warn("failed to install dependency lazily",{dependency:s,err:n});let o=pf(s),i=`${s}@${o}`,c=process.argv.includes("npx")?"":"-g ",l=`Installation of ${s} failed. This typically means you are running an out-of-date version of Node.js or NPM.Please manually install by running the following command: npm install ${c}${i}`;throw r&&r.fail(l),n}}async function Hv(s){return gs.has(s)||(gs.set(s,df(s)),gs.get(s).catch(()=>{gs.delete(s)})),gs.get(s)}async function df(s){let e=Lc(s);if(e)return e;let t=pf(s),r=`${s}@${t}`;return await Io(lt(),r),Vt(s)}async function zv(){let s=Object.keys(qa);for(let e of s)await df(e)}function pf(s){let e=Object.entries(qa).find(([t])=>t===s);if(!e)throw new Error("The given package name is not lazyDependencies");return e[1]}var uf,Vv,gs,ft=T(()=>{"use strict";uf=E(require("ora"));ln();j();F();io();cn();Vv=x("lazy-require"),gs=new Map});var gf={};$(gf,{init:()=>Jv});async function Jv(s){var w,C;let e=typeof s=="string"?s:"";(typeof s!="string"||!s.trim())&&(e=(await(0,Gl.default)({type:"text",name:"project",message:"Please enter Project name",validate:v=>String(v).length>3})).project);let t=Kt.resolve(e);Jt.existsSync(t)&&Jt.readdirSync(t).length!==0&&(console.log(`${t} is not empty. Quitting...`),process.exit(1));let r=t.substr(Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"))+1),n=(0,ff.default)(r);if(!n.validForNewPackages){let b=`The name '${r}' is not a valid package name:`;throw console.log(Jo.default.red(b)),n.errors&&n.errors.forEach(v=>console.log(Jo.default.red(v))),n.warnings&&n.warnings.forEach(v=>console.log(Jo.default.yellowBright(`warning: ${v}`))),new R(`${b}
|
|
21
21
|
validation errors:
|
|
22
22
|
${((w=n.errors)==null?void 0:w.join(`
|
|
23
23
|
`))||""}
|