public void Should_expose_the_test_thread_container() { TestThreadContext result = ContextManagerStub.TestThreadContext; result.Should().NotBeNull(); result.TestThreadContainer.Should().BeSameAs(TestThreadContainer); }
public BeforeScenarioBlockHooks( TestThreadContext testThreadContext, FeatureContext featureContext, ScenarioContext scenarioContext) : base(testThreadContext, featureContext, scenarioContext) { }
public IntegerSetGeneratorStepDefinitions( TestThreadContext testThreadContext, FeatureContext featureContext, ScenarioContext scenarioContext) : base(testThreadContext, featureContext, scenarioContext) { }
public AfterTestRunHooks( TestThreadContext testThreadContext, FeatureContext featureContext, ScenarioContext scenarioContext) : base(testThreadContext, featureContext, scenarioContext) { }
public BaseSeleniumTestStepDefinition( TestThreadContext testThreadContext, FeatureContext featureContext, ScenarioContext scenarioContext) : base(testThreadContext, featureContext, scenarioContext) { }
public static void BeforeFeature2( TestThreadContext testThreadContext, FeatureContext featureContext) { featureContext.Set(new Stopwatch(), nameof(FeatureStopwatch)); featureContext.Get <Stopwatch>(nameof(FeatureStopwatch)).Start(); }
public void Should_ContextManager_initialize_TestThreadContext_when_constructed() { var contextManager = CreateContextManager(); TestThreadContext result = contextManager.TestThreadContext; result.Should().NotBeNull(); result.Should().BeSameAs(TestThreadContainer.Resolve <TestThreadContext>()); }
public BaseBindingClass( TestThreadContext testThreadContext, FeatureContext featureContext, ScenarioContext scenarioContext) { TestThreadContext = testThreadContext; FeatureContext = featureContext; ScenarioContext = scenarioContext; }
private void InitializeTestThreadContext() { // Since both TestThreadContext and ContextManager are in the same container (test thread container) // their lifetime is the same, so we do not need the swop infrastructure like for the other contexts. // We just need to initialize it during construction time. var testThreadContext = testThreadContainer.Resolve <TestThreadContext>(); this.TestThreadContext = testThreadContext; }
/// <summary> /// <inheritdoc cref="BaseBindingClass" /> /// </summary> /// <param name="testThreadContext">Context object, that can be used during the usage of the TestThread.</param> /// <param name="featureContext">Context object, that can be used during the execution of the Feature.</param> /// <param name="scenarioContext">Context object, that can be used during the execution of the Scenario.</param> protected BaseBindingClass( [NotNull] TestThreadContext testThreadContext, [NotNull] FeatureContext featureContext, [NotNull] ScenarioContext scenarioContext) { TestThreadContext = testThreadContext ?? throw new ArgumentNullException(nameof(testThreadContext)); FeatureContext = featureContext ?? throw new ArgumentNullException(nameof(featureContext)); ScenarioContext = scenarioContext ?? throw new ArgumentNullException(nameof(scenarioContext)); }
public static void AfterTestRun(TestThreadContext TestThreadContext) { var objectContainer = TestThreadContext?.Get <IObjectContainer>("objectContainer"); if (objectContainer.IsRegistered <WebDriverContext>()) { objectContainer.Resolve <WebDriverContext>().CloseBrowser(); } AppiumLocalService?.Dispose(); }
public static void BeforeFeature2( TestThreadContext testThreadContext, FeatureContext featureContext) { var testThreadStopWatch = featureContext.Get <Stopwatch>(nameof(TestThreadStopWatch)); testThreadStopWatch.Stop(); testThreadContext.Get <Logger>(nameof(Logger)).Information( $"Elapsed time in the TestThread: {Math.Round(testThreadStopWatch.Elapsed.TotalSeconds, 2)} seconds"); }
public static void BeforeFeature3( TestThreadContext testThreadContext, FeatureContext featureContext) { var driver = DriverInitializer.StartWebDriver( ExecutionMode.LOCAL, BrowserType.CHROME, new ChromeOptions(), Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); testThreadContext.Set(driver, "Driver"); }
public StepDefinition1(TestThreadContext testThreadContext, FeatureContext featureContext, ScenarioContext scenarioContext) : base(testThreadContext, featureContext, scenarioContext) { }
public static void AfterFeature3( TestThreadContext testThreadContext, FeatureContext featureContext) { testThreadContext.Get <IWebDriver>(nameof(Driver)).Quit(); }