public static void BeforeFeature1( TestThreadContext testThreadContext, FeatureContext featureContext) { testThreadContext.Set(new Stopwatch(), nameof(TestThreadStopWatch)); testThreadContext.Get <Stopwatch>(nameof(TestThreadStopWatch)).Start(); }
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 AfterFeature3( TestThreadContext testThreadContext, FeatureContext featureContext) { testThreadContext.Get <IWebDriver>(nameof(Driver)).Quit(); }