コード例 #1
0
 public static void BeforeFeature1(
     TestThreadContext testThreadContext,
     FeatureContext featureContext)
 {
     testThreadContext.Set(new Stopwatch(), nameof(TestThreadStopWatch));
     testThreadContext.Get <Stopwatch>(nameof(TestThreadStopWatch)).Start();
 }
コード例 #2
0
        public static void AfterTestRun(TestThreadContext TestThreadContext)
        {
            var objectContainer = TestThreadContext?.Get <IObjectContainer>("objectContainer");

            if (objectContainer.IsRegistered <WebDriverContext>())
            {
                objectContainer.Resolve <WebDriverContext>().CloseBrowser();
            }

            AppiumLocalService?.Dispose();
        }
コード例 #3
0
        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");
        }
コード例 #4
0
 public static void AfterFeature3(
     TestThreadContext testThreadContext,
     FeatureContext featureContext)
 {
     testThreadContext.Get <IWebDriver>(nameof(Driver)).Quit();
 }