Beispiel #1
0
        public Task InfoEndpointValidationTest(DiagnosticPortConnectionMode mode)
        {
            return(ScenarioRunner.SingleTarget(
                       _outputHelper,
                       _httpClientFactory,
                       mode,
                       TestAppScenarios.AsyncWait.Name,
                       appValidate: async(runner, client) =>
            {
                // GET /info
                DotnetMonitorInfo info = await client.GetInfoAsync();

                Assert.NotNull(info.Version);     // Not sure of how to get Dotnet Monitor version from within tests...
                Assert.True(Version.TryParse(info.RuntimeVersion, out Version runtimeVersion), "Unable to parse version from RuntimeVersion property.");

                Version currentAspNetVersion = TargetFrameworkMoniker.Net60.GetAspNetCoreFrameworkVersion();
                Assert.Equal(currentAspNetVersion.Major, runtimeVersion.Major);
                Assert.Equal(currentAspNetVersion.Minor, runtimeVersion.Minor);
                Assert.Equal(currentAspNetVersion.Revision, runtimeVersion.Revision);

                Assert.Equal(mode, info.DiagnosticPortMode);

                if (mode == DiagnosticPortConnectionMode.Connect)
                {
                    Assert.Null(info.DiagnosticPortName);
                }
                else if (mode == DiagnosticPortConnectionMode.Listen)
                {
                    Assert.Equal(runner.DiagnosticPortPath, info.DiagnosticPortName);
                }

                await runner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
            }));
        }
Beispiel #2
0
        public GroupScenarios(EmbeddedEventStoreFixture fixture)
        {
            var settings  = new JsonSerializerSettings();
            var prefix    = fixture.NextStreamNamePrefix();
            var converter = StreamNameConversions.WithPrefix(prefix);

            _runner = new ScenarioRunner(
                new CommandHandlerInvoker(new CommandHandlerModule[]
            {
                new GroupModule(
                    new GroupRepository(fixture.Connection,
                                        new EventSourceReaderConfiguration(
                                            converter,
                                            () => new StreamEventsSliceTranslator(
                                                name => Type.GetType(name, true),
                                                settings),
                                            new SliceSize(100)),
                                        new EventSourceWriterConfiguration(
                                            converter,
                                            new EventSourceChangesetTranslator(
                                                type => type.FullName,
                                                settings))))
            }),
                fixture.Connection,
                settings,
                prefix);
        }
 public void InitializeScenario()
 {
     if (scenario != null)
     {
         return;
     }
     if (ScenarioRunner.Instance == null)
     {
         return;
     }
     if (Client.realtimeSinceStartup > (lastInitCheck + 10))
     {
         lastInitCheck = Client.realtimeSinceStartup;
         foreach (ScenarioModule sm in ScenarioRunner.GetLoadedModules())
         {
             if (scenario == null && sm is ScenarioDiscoverableObjects)
             {
                 scenario = (ScenarioDiscoverableObjects)sm;
             }
         }
         if (scenario != null)
         {
             DarkLog.Debug("Scenario module found, we can spawn asteroids!");
             scenario.spawnInterval    = float.MaxValue;
             scenario.spawnOddsAgainst = 1;
             // Disable the new Sentinel mechanic in KSP 1.3.0
             SentinelUtilities.SpawnChance = 0f;
         }
     }
 }
 public ConfigurationTabViewModel(
     IPersistedRunnerConfig config,
     ScenarioRunner runner,
     IEnumerable <IResultFormatter <ScenarioInRunResult> > formatters,
     IEventAggregator eventAggregator,
     ISendMessages sender,
     ISelectableScenarios scenarios,
     ISelectableConfigurations configurations,
     ISelectableFormatters compiledFormatters)
 {
     _config                   = config;
     _runner                   = runner;
     _formatters               = formatters;
     _sender                   = sender;
     _scenarios                = scenarios;
     _selectableFormatters     = compiledFormatters;
     _selectableConfigurations = configurations.SelectableConfigurations;
     foreach (var c in _selectableConfigurations)
     {
         c.IsSelected = !_config.IgnoredConfigurations.Contains(c.Name);
     }
     foreach (var f in _selectableFormatters.SelectableFormatters)
     {
         f.IsSelected = !_config.IgnoredFormatters.Contains(f.Formatter.Name);
     }
     foreach (var s in _scenarios.SelectableScenarios)
     {
         s.IsSelected = !_config.IgnoredScenarios.Contains(s.Scenario.Name);
     }
     NumberOfIterations = config.NumberOfRuns;
     eventAggregator.Subscribe(this);
 }
Beispiel #5
0
        protected FluentTest()
        {
            // ReSharper disable once DoNotCallOverridableMethodsInConstructor
            var reportTarget = CreateReportTarget();

            _scenarioRunner = new ScenarioRunner(this, reportTarget);
        }
Beispiel #6
0
        public IEnumerable <TContext> Run(RunSettings settings)
        {
            var builder = new RunDescriptorsBuilder();

            runDescriptorsBuilderAction(builder);

            var runDescriptors = builder.Build();

            if (!runDescriptors.Any())
            {
                Console.Out.WriteLine("No active rundescriptors was found for this test, test will not be executed");
                return(new List <TContext>());
            }

            foreach (var runDescriptor in runDescriptors)
            {
                runDescriptor.ScenarioContext       = contextFactory();
                runDescriptor.TestExecutionTimeout  = settings.TestExecutionTimeout ?? TimeSpan.FromSeconds(90);
                runDescriptor.UseSeparateAppdomains = settings.UseSeparateAppDomains;
            }

            var sw = new Stopwatch();

            sw.Start();
            ScenarioRunner.Run(runDescriptors, behaviors, shoulds, done, limitTestParallelismTo, reports, allowedExceptions);

            sw.Stop();

            Console.Out.WriteLine("Total time for testrun: {0}", sw.Elapsed);

            return(runDescriptors.Select(r => (TContext)r.ScenarioContext));
        }
Beispiel #7
0
        public async Task EgressCancelTest()
        {
            await ScenarioRunner.SingleTarget(
                _outputHelper,
                _httpClientFactory,
                DiagnosticPortConnectionMode.Connect,
                TestAppScenarios.AsyncWait.Name,
                appValidate : async(appRunner, apiClient) =>
            {
                int processId = await appRunner.ProcessIdTask;

                OperationResponse response = await apiClient.EgressTraceAsync(processId, durationSeconds: -1, FileProviderName);
                Assert.Equal(HttpStatusCode.Accepted, response.StatusCode);

                OperationStatusResponse operationResult = await apiClient.GetOperationStatus(response.OperationUri);
                Assert.Equal(HttpStatusCode.OK, operationResult.StatusCode);
                Assert.True(operationResult.OperationStatus.Status == OperationState.Running);

                HttpStatusCode deleteStatus = await apiClient.CancelEgressOperation(response.OperationUri);
                Assert.Equal(HttpStatusCode.OK, deleteStatus);

                operationResult = await apiClient.GetOperationStatus(response.OperationUri);
                Assert.Equal(HttpStatusCode.OK, operationResult.StatusCode);
                Assert.Equal(OperationState.Cancelled, operationResult.OperationStatus.Status);

                await appRunner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
            },
                configureTool : (toolRunner) =>
            {
                toolRunner.WriteKeyPerValueConfiguration(new RootOptions().AddFileSystemEgress(FileProviderName, _tempDirectory.FullName));
            });
        }
        public async Task CollectionRule_CommandLineFilterNoMatchTest(DiagnosticPortConnectionMode mode)
        {
            Task filteredTask = null;

            await ScenarioRunner.SingleTarget(
                _outputHelper,
                _httpClientFactory,
                mode,
                TestAppScenarios.AsyncWait.Name,
                appValidate : async(runner, client) =>
            {
                await filteredTask;

                await runner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
            },
                configureTool : runner =>
            {
                // Note that the process name filter is specified as "SpinWait" whereas the
                // actual command line of the target process will contain "AsyncWait".
                runner.ConfigurationFromEnvironment.CreateCollectionRule(DefaultRuleName)
                .SetStartupTrigger()
                .AddProcessNameFilter(TestAppScenarios.SpinWait.Name);

                filteredTask = runner.WaitForCollectionRuleUnmatchedFiltersAsync(DefaultRuleName);
            });
        }
        public async Task CollectionRule_StartupTriggerTest(DiagnosticPortConnectionMode mode)
        {
            using TemporaryDirectory tempDirectory = new(_outputHelper);
            string ExpectedFilePath    = Path.Combine(tempDirectory.FullName, "file.txt");
            string ExpectedFileContent = Guid.NewGuid().ToString("N");

            Task ruleCompletedTask = null;

            await ScenarioRunner.SingleTarget(
                _outputHelper,
                _httpClientFactory,
                mode,
                TestAppScenarios.AsyncWait.Name,
                appValidate : async(runner, client) =>
            {
                await ruleCompletedTask;

                Assert.True(File.Exists(ExpectedFilePath));
                Assert.Equal(ExpectedFileContent, File.ReadAllText(ExpectedFilePath));

                await runner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
            },
                configureTool : runner =>
            {
                runner.ConfigurationFromEnvironment.CreateCollectionRule(DefaultRuleName)
                .SetStartupTrigger()
                .AddExecuteActionAppAction("TextFileOutput", ExpectedFilePath, ExpectedFileContent);

                ruleCompletedTask = runner.WaitForCollectionRuleCompleteAsync(DefaultRuleName);
            });
        }
Beispiel #10
0
        public async Task ConcurrencyLimitTest()
        {
            await ScenarioRunner.SingleTarget(
                _outputHelper,
                _httpClientFactory,
                DiagnosticPortConnectionMode.Connect,
                TestAppScenarios.AsyncWait.Name,
                appValidate : async(appRunner, apiClient) =>
            {
                int processId = await appRunner.ProcessIdTask;

                OperationResponse response1 = await EgressTraceWithDelay(apiClient, processId);
                OperationResponse response2 = await EgressTraceWithDelay(apiClient, processId);
                OperationResponse response3 = await EgressTraceWithDelay(apiClient, processId);

                ValidationProblemDetailsException ex = await Assert.ThrowsAsync <ValidationProblemDetailsException>(() => EgressTraceWithDelay(apiClient, processId));
                Assert.Equal(HttpStatusCode.TooManyRequests, ex.StatusCode);
                Assert.Equal((int)HttpStatusCode.TooManyRequests, ex.Details.Status.GetValueOrDefault());

                await CancelEgressOperation(apiClient, response1);
                await CancelEgressOperation(apiClient, response2);

                OperationResponse response4 = await EgressTraceWithDelay(apiClient, processId, delay: false);

                await CancelEgressOperation(apiClient, response3);
                await CancelEgressOperation(apiClient, response4);

                await appRunner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
            },
                configureTool : (toolRunner) =>
            {
                toolRunner.WriteKeyPerValueConfiguration(new RootOptions().AddFileSystemEgress(FileProviderName, _tempDirectory.FullName));
            });
        }
Beispiel #11
0
        public Task TestCustomMetrics()
        {
            return(ScenarioRunner.SingleTarget(_outputHelper,
                                               _httpClientFactory,
                                               DiagnosticPortConnectionMode.Connect,
                                               TestAppScenarios.AsyncWait.Name,
                                               async(appRunner, apiClient) =>
            {
                var counterNames = new[] { "cpu-usage", "working-set" };

                using ResponseStreamHolder holder = await apiClient.CaptureMetricsAsync(await appRunner.ProcessIdTask,
                                                                                        durationSeconds: 10,
                                                                                        metricsConfiguration: new EventMetricsConfiguration
                {
                    IncludeDefaultProviders = false,
                    Providers = new[]
                    {
                        new EventMetricsProvider
                        {
                            ProviderName = EventPipe.MonitoringSourceConfiguration.SystemRuntimeEventSourceName,
                            CounterNames = counterNames,
                        }
                    }
                });

                var metrics = GetAllMetrics(holder);
                await ValidateMetrics(new [] { EventPipe.MonitoringSourceConfiguration.SystemRuntimeEventSourceName },
                                      counterNames,
                                      metrics,
                                      strict: true);

                await appRunner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
            }));
        }
Beispiel #12
0
        public async Task <TContext> Run(RunSettings settings)
        {
            var scenarioContext = new TContext();

            contextInitializer(scenarioContext);

            var runDescriptor = new RunDescriptor(scenarioContext);

            runDescriptor.Settings.Merge(settings);

            ScenarioContext.Current = scenarioContext;

            LogManager.UseFactory(Scenario.GetLoggerFactory(scenarioContext));

            var sw = new Stopwatch();

            sw.Start();
            var runSummary = await ScenarioRunner.Run(runDescriptor, behaviors, done).ConfigureAwait(false);

            sw.Stop();

            await runDescriptor.RaiseOnTestCompleted(runSummary);

            DisplayRunResult(runSummary);
            TestContext.WriteLine("Total time for testrun: {0}", sw.Elapsed);

            if (runSummary.Result.Failed)
            {
                PrintLog(scenarioContext);
                runSummary.Result.Exception.Throw();
            }

            return((TContext)runDescriptor.ScenarioContext);
        }
Beispiel #13
0
        public Task TestDefaultMetrics()
        {
            return(ScenarioRunner.SingleTarget(_outputHelper,
                                               _httpClientFactory,
                                               DiagnosticPortConnectionMode.Connect,
                                               TestAppScenarios.AsyncWait.Name,
                                               async(appRunner, apiClient) =>
            {
                using ResponseStreamHolder holder = await apiClient.CaptureMetricsAsync(await appRunner.ProcessIdTask,
                                                                                        durationSeconds: 10);

                var metrics = GetAllMetrics(holder);
                await ValidateMetrics(new [] { EventPipe.MonitoringSourceConfiguration.SystemRuntimeEventSourceName },
                                      new []
                {
                    "cpu-usage",
                    "working-set",
                    "gc-heap-size",
                    "threadpool-thread-count",
                    "threadpool-queue-length"
                },
                                      metrics, strict: false);

                await appRunner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
            }));
        }
Beispiel #14
0
        public Task LogsDefaultLevelNoneNotSupportedViaBodyTest(DiagnosticPortConnectionMode mode, LogFormat logFormat)
        {
            return(ScenarioRunner.SingleTarget(
                       _outputHelper,
                       _httpClientFactory,
                       mode,
                       TestAppScenarios.Logger.Name,
                       appValidate: async(runner, client) =>
            {
                ValidationProblemDetailsException exception = await Assert.ThrowsAsync <ValidationProblemDetailsException>(
                    async() =>
                {
                    using ResponseStreamHolder _ = await client.CaptureLogsAsync(
                              await runner.ProcessIdTask,
                              CommonTestTimeouts.LogsDuration,
                              new LogsConfiguration()
                    {
                        LogLevel = LogLevel.None
                    },
                              logFormat);
                });
                Assert.Equal(HttpStatusCode.BadRequest, exception.StatusCode);
                Assert.Equal(StatusCodes.Status400BadRequest, exception.Details.Status);

                // Allow test app to gracefully exit by continuing the scenario.
                await runner.SendCommandAsync(TestAppScenarios.Logger.Commands.StartLogging);
            }));
        }
Beispiel #15
0
        public static IScenarioStep Given(Action initialStateSetupMethod)
        {
            var scenarioRunner = new ScenarioRunner();

            scenarioRunner.AddStep("Given", initialStateSetupMethod);
            return(scenarioRunner);
        }
Beispiel #16
0
        static void Main(string[] args)
        {
            //var uri = new Uri("http://localhost:9200");
            //var singleConnectionPool = new SingleNodeConnectionPool(uri);
            //var settings = new ConnectionConfiguration(singleConnectionPool);

            //var elasticLowLevelClient = new ElasticLowLevelClient(settings);

            CreateLogger();
            var container = InitDi();

            var stepRunner     = new ScenarioRunner(_logger, container);
            var scenarioResult = stepRunner.RunScenario <ElasticSearchScenario>();

#if DEBUG
            _logger.Information("-------------------------------------------------------------------------------------------------------------------------------------");
            _logger.Information("-------------------------------------------------------------------------------------------------------------------------------------");
            _logger.Information("-------------------------------------------------------------------------------------------------------------------------------------");

            _logger.Information("Please press any key in order to exit.");
            Console.ReadKey();
#endif


            //elasticLowLevelClient.clos();
        }
        public async Task <TContext> Run(RunSettings settings)
        {
            var scenarioContext = new TContext();

            contextInitializer(scenarioContext);

            var runDescriptor = new RunDescriptor
            {
                ScenarioContext = scenarioContext
            };

            runDescriptor.Settings.Merge(settings);

            LogManager.UseFactory(new ContextAppenderFactory());

            var sw = new Stopwatch();

            sw.Start();
            await ScenarioRunner.Run(runDescriptor, behaviors, done).ConfigureAwait(false);

            sw.Stop();

            Console.WriteLine("Total time for testrun: {0}", sw.Elapsed);

            return((TContext)runDescriptor.ScenarioContext);
        }
Beispiel #18
0
        public static IScenarioStep Given <T1, T2>(Action <T1, T2> initialStateSetupMethod, T1 param1, T2 param2)
        {
            var scenarioRunner = new ScenarioRunner();

            scenarioRunner.AddStep("Given", initialStateSetupMethod, param1, param2);
            return(scenarioRunner);
        }
        public async Task <IEnumerable <TContext> > Run(RunSettings settings)
        {
            var builder = new RunDescriptorsBuilder();

            runDescriptorsBuilderAction(builder);

            var runDescriptors = builder.Build();

            if (!runDescriptors.Any())
            {
                Console.WriteLine("No active rundescriptors were found for this test, test will not be executed");
                return(new List <TContext>());
            }

            foreach (var runDescriptor in runDescriptors)
            {
                var scenarioContext = new TContext();
                contextInitializer(scenarioContext);
                runDescriptor.ScenarioContext = scenarioContext;
                runDescriptor.Settings.Merge(settings);
            }

            LogManager.UseFactory(new ContextAppenderFactory());

            var sw = new Stopwatch();

            sw.Start();
            await ScenarioRunner.Run(runDescriptors, behaviors, shoulds, done, reports).ConfigureAwait(false);

            sw.Stop();

            Console.WriteLine("Total time for testrun: {0}", sw.Elapsed);

            return(runDescriptors.Select(r => (TContext)r.ScenarioContext));
        }
Beispiel #20
0
        public async Task DisableHttpEgressTest()
        {
            await ScenarioRunner.SingleTarget(
                _outputHelper,
                _httpClientFactory,
                DiagnosticPortConnectionMode.Connect,
                TestAppScenarios.AsyncWait.Name,
                appValidate : async(appRunner, appClient) =>
            {
                int processId = await appRunner.ProcessIdTask;

                ProcessInfo processInfo = await appClient.GetProcessAsync(processId);
                Assert.NotNull(processInfo);

                // Dump Error Check
                ValidationProblemDetailsException validationProblemDetailsExceptionDumps = await Assert.ThrowsAsync <ValidationProblemDetailsException>(
                    () => appClient.CaptureDumpAsync(processId, DumpType.Mini));
                Assert.Equal(HttpStatusCode.BadRequest, validationProblemDetailsExceptionDumps.StatusCode);
                Assert.Equal(StatusCodes.Status400BadRequest, validationProblemDetailsExceptionDumps.Details.Status);
                Assert.Equal(DisabledHTTPEgressErrorMessage, validationProblemDetailsExceptionDumps.Message);

                // Logs Error Check
                ValidationProblemDetailsException validationProblemDetailsExceptionLogs = await Assert.ThrowsAsync <ValidationProblemDetailsException>(
                    () => appClient.CaptureLogsAsync(processId, CommonTestTimeouts.LogsDuration, LogLevel.None, LogFormat.NewlineDelimitedJson));
                Assert.Equal(HttpStatusCode.BadRequest, validationProblemDetailsExceptionLogs.StatusCode);
                Assert.Equal(StatusCodes.Status400BadRequest, validationProblemDetailsExceptionLogs.Details.Status);
                Assert.Equal(DisabledHTTPEgressErrorMessage, validationProblemDetailsExceptionLogs.Message);

                await appRunner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
            },
                disableHttpEgress : true);
        }
Beispiel #21
0
        public async Task EgressListTest()
        {
            await ScenarioRunner.SingleTarget(
                _outputHelper,
                _httpClientFactory,
                DiagnosticPortConnectionMode.Connect,
                TestAppScenarios.AsyncWait.Name,
                appValidate : async(appRunner, apiClient) =>
            {
                int processId = await appRunner.ProcessIdTask;

                OperationResponse response1 = await EgressTraceWithDelay(apiClient, processId);
                OperationResponse response2 = await EgressTraceWithDelay(apiClient, processId, delay: false);
                await CancelEgressOperation(apiClient, response2);

                List <OperationSummary> result = await apiClient.GetOperations();
                Assert.Equal(2, result.Count);

                OperationStatusResponse status1 = await apiClient.GetOperationStatus(response1.OperationUri);
                OperationSummary summary1       = result.First(os => os.OperationId == status1.OperationStatus.OperationId);
                ValidateOperation(status1.OperationStatus, summary1);

                OperationStatusResponse status2 = await apiClient.GetOperationStatus(response2.OperationUri);
                OperationSummary summary2       = result.First(os => os.OperationId == status2.OperationStatus.OperationId);
                ValidateOperation(status2.OperationStatus, summary2);

                await appRunner.SendCommandAsync(TestAppScenarios.AsyncWait.Commands.Continue);
            },
                configureTool : (toolRunner) =>
            {
                toolRunner.WriteKeyPerValueConfiguration(new RootOptions().AddFileSystemEgress(FileProviderName, _tempDirectory.FullName));
            });
        }
Beispiel #22
0
 /// <summary>
 /// Check if the scenario has changed and sends it to the server
 /// </summary>
 public void SendScenarioModules()
 {
     if (Enabled)
     {
         var modules = (ScenarioModule[])ScenarioRunner.GetLoadedModules().ToArray().Clone();
         TaskFactory.StartNew(() => ParseAndSendModules(modules));
     }
 }
Beispiel #23
0
        protected ScenarioBase()
        {
            // ReSharper disable once DoNotCallOverridableMethodsInConstructor
            var reportTarget = CreateReportTarget();

            _scenarioRunner = new ScenarioRunner(this, reportTarget);
            StepsCaller     = this;
        }
Beispiel #24
0
        static int Main()
        {
            var scenarioRunner = new ScenarioRunner();

            scenarioRunner.Initialize();
            var success = scenarioRunner.Run().Result;

            return(success ? 0 : 1);
        }
Beispiel #25
0
        public void SuccessRoundTripBuying()
        {
            ScenarioRunner <BuyTicketPageBehaviors> runner = new ScenarioRunner <BuyTicketPageBehaviors>(
                successRoundTripBuyingScenario,
                page => Assert.AreEqual(true, page.IsShowingResultsTable)
                );

            runner.Start();
        }
Beispiel #26
0
        public void RoundTripReturnDateValidation()
        {
            ScenarioRunner <BuyTicketPageBehaviors> runner = new ScenarioRunner <BuyTicketPageBehaviors>(
                roundTripReturnDateValidation,
                page => Assert.AreEqual(missingReturnDateValidationMessage, page.AlertText)
                );

            runner.Start();
        }
Beispiel #27
0
        public void InvalidDiscountCode()
        {
            ScenarioRunner <BuyTicketPageBehaviors> runner = new ScenarioRunner <BuyTicketPageBehaviors>(
                invalidDiscountCodeScenario,
                page => Assert.AreEqual(dicountCodeValidationMessage, page.AlertErrorMessage)
                );

            runner.Start();
        }
Beispiel #28
0
        public void PreviousDateSelecting()
        {
            ScenarioRunner <BuyTicketPageBehaviors> runner = new ScenarioRunner <BuyTicketPageBehaviors>(
                previousDateSelectingScenario,
                page => Assert.AreEqual(true, page.IsSelectingPreviousDateFailed)
                );

            runner.Start();
        }
Beispiel #29
0
        public void ChangeLanguage()
        {
            ScenarioRunner <MainPageBehaviors> runner = new ScenarioRunner <MainPageBehaviors>(
                changeLanguageScenario,
                page => Assert.AreEqual(japaneseLanguageTitle, page.PageTitle)
                );

            runner.Start();
        }
Beispiel #30
0
        public void LoginInvalidCredentialsValidation()
        {
            ScenarioRunner <LoginPageBehaviors> runner = new ScenarioRunner <LoginPageBehaviors>(
                loginInvalidCredentialsValidation,
                page => Assert.IsTrue(page.ValidationError.StartsWith(invalidCredentialsValidationError))
                );

            runner.Start();
        }
Beispiel #31
0
        static void Main(string[] args)
        {
            var options = Args.Parse<TestRunnerOptions>(args);

            if (options.Help || String.IsNullOrEmpty(options.Assembly))
            {
                Console.WriteLine(ArgUsage.GetUsage<TestRunnerOptions>(options: new ArgUsageOptions
                {
                    ShowType = false,
                    ShowPosition = false,
                    ShowPossibleValues = false,
                    AppendDefaultValueToDescription = true
                }));
                return;
            }

            var runner = new ScenarioRunner(options);

            runner.Run().Wait();
        }
 public OnlineRateCalculation(RateCalculationFileHandler handler, ScenarioRunner runner)
 {
     m_Handler = handler;
     m_ScenarioRunner = runner;
 }
 public ReadMetaDataScenario(ScenarioRunner scenarioRunner)
 {
     m_ScenarioRunner = scenarioRunner;
 }
 public ExtractArchiveScenario(ScenarioRunner scenarioRunner)
 {
     m_ScenarioRunner = scenarioRunner;
 }