private static string BuildRunnerArgs(TestOptions options, TestContext context, string fileUrl, string runnerPath, TestExecutionMode testExecutionMode, bool isRunningElevated, string chromeBrowserPath)
        {
            string runnerArgs;
            var    testModeStr   = testExecutionMode.ToString().ToLowerInvariant();
            var    timeout       = context.TestFileSettings.TestFileTimeout ?? options.TestFileTimeoutMilliseconds ?? Constants.DefaultTestFileTimeout;
            string inspectBrkArg = context.TestFileSettings.EngineOptions != null && context.TestFileSettings.EngineOptions.NodeInspect ? "--inspect-brk" : "";

            var engineBrowserOptions = string.Empty;

            if (context.TestFileSettings.BrowserArguments != null && options.Engine != null)
            {
                var matchingEntries = context.TestFileSettings.BrowserArguments.Where(x => x.Key.Equals(options.Engine.ToString(), StringComparison.OrdinalIgnoreCase));
                if (matchingEntries.Any())
                {
                    engineBrowserOptions = matchingEntries.First().Value;
                }
            }

            runnerArgs = string.Format("{0} \"{1}\" {2} {3} {4} {5} {6} {7} \"{8}\" \"{9}\"",
                                       inspectBrkArg,
                                       runnerPath,
                                       fileUrl,
                                       testModeStr,
                                       timeout,
                                       isRunningElevated,
                                       context.TestFileSettings.IgnoreResourceLoadingErrors.Value,
                                       $"\"{chromeBrowserPath}\"",
                                       context.TestFileSettings.UserAgent,
                                       engineBrowserOptions);

            return(runnerArgs);
        }
示例#2
0
        private static string BuildRunnerArgs(TestOptions options, TestContext context, string fileUrl, string runnerPath, TestExecutionMode testExecutionMode)
        {
            string runnerArgs;
            var    testModeStr = testExecutionMode.ToString().ToLowerInvariant();
            var    timeout     = context.TestFileSettings.TestFileTimeout ?? options.TestFileTimeoutMilliseconds ?? Constants.DefaultTestFileTimeout;

            runnerArgs = string.Format("--ignore-ssl-errors=true --proxy-type=none \"{0}\" {1} {2} {3} {4} {5}",
                                       runnerPath,
                                       fileUrl,
                                       testModeStr,
                                       timeout,
                                       context.TestFileSettings.IgnoreResourceLoadingErrors.Value,
                                       context.TestFileSettings.UserAgent);


            return(runnerArgs);
        }
        private static string BuildRunnerArgs(TestOptions options, TestContext context, string fileUrl, string runnerPath, TestExecutionMode testExecutionMode, bool isRunningElevated, string chromeBrowserPath)
        {
            string runnerArgs;
            var    testModeStr = testExecutionMode.ToString().ToLowerInvariant();
            var    timeout     = context.TestFileSettings.TestFileTimeout ?? options.TestFileTimeoutMilliseconds ?? Constants.DefaultTestFileTimeout;

            runnerArgs = string.Format("\"{0}\" {1} {2} {3} {4} {5} {6} {7}",
                                       runnerPath,
                                       fileUrl,
                                       testModeStr,
                                       timeout,
                                       isRunningElevated,
                                       context.TestFileSettings.IgnoreResourceLoadingErrors.Value,
                                       $"\"{chromeBrowserPath}\"",
                                       context.TestFileSettings.UserAgent);

            return(runnerArgs);
        }
示例#4
0
        private static string BuildRunnerArgs(TestOptions options, TestContext context, string fileUrl, string runnerPath, TestExecutionMode testExecutionMode)
        {
            string runnerArgs;
            var    testModeStr  = testExecutionMode.ToString().ToLowerInvariant();
            var    timeout      = context.TestFileSettings.TestFileTimeout ?? options.TestFileTimeoutMilliseconds ?? Constants.DefaultTestFileTimeout;
            var    proxy        = options.Proxy ?? context.TestFileSettings.Proxy;
            var    proxySetting = string.IsNullOrEmpty(proxy) ? "--proxy-type=none" : string.Format("--proxy={0}", proxy);

            runnerArgs = string.Format("--ignore-ssl-errors=true {0} --ssl-protocol=any \"{1}\" {2} {3} {4} {5} {6}",
                                       proxySetting,
                                       runnerPath,
                                       fileUrl,
                                       testModeStr,
                                       timeout,
                                       context.TestFileSettings.IgnoreResourceLoadingErrors.Value,
                                       context.TestFileSettings.UserAgent);


            return(runnerArgs);
        }
示例#5
0
        private static string BuildRunnerArgs(TestOptions options, TestContext context, string fileUrl, string runnerPath, TestExecutionMode testExecutionMode)
        {
            string runnerArgs;
            var    testModeStr = testExecutionMode.ToString().ToLowerInvariant();
            var    timeout     = context.TestFileSettings.TestFileTimeout ?? options.TestFileTimeoutMilliseconds;

            if (timeout.HasValue && timeout > 0)
            {
                runnerArgs = string.Format("--ignore-ssl-errors=true --proxy-type=none \"{0}\" {1} {2} {3}",
                                           runnerPath,
                                           fileUrl,
                                           testModeStr,
                                           timeout);
            }
            else
            {
                runnerArgs = string.Format("--ignore-ssl-errors=true --proxy-type=none \"{0}\" {1} {2}", runnerPath, fileUrl, testModeStr);
            }

            return(runnerArgs);
        }
示例#6
0
        private static string BuildRunnerArgs(TestOptions options, TestContext context, string fileUrl, string runnerPath, TestExecutionMode testExecutionMode)
        {
            string runnerArgs;
            var testModeStr = testExecutionMode.ToString().ToLowerInvariant();
            var timeout = context.TestFileSettings.TestFileTimeout ?? options.TestFileTimeoutMilliseconds ?? Constants.DefaultTestFileTimeout;

            runnerArgs = string.Format("--ignore-ssl-errors=true --proxy-type=none \"{0}\" {1} {2} {3} {4} {5}",
                                       runnerPath,
                                       fileUrl,
                                       testModeStr,
                                       timeout,
                                       context.TestFileSettings.IgnoreResourceLoadingErrors.Value,
                                       context.TestFileSettings.UserAgent);


            return runnerArgs;
        }