Example #1
0
        public void  CanStartServiceWhenAllRequiredParamsSet()
        {
            BaseDriverService.Start(parameter);
            Assert.NotNull(WebTestContext.Get <DriverService>(Constants.DriverServiceKey), "Service should have started and context set");
            var service = WebTestContext.Get <DriverService>(Constants.DriverServiceKey);

            Assert.True(service.IsRunning, "Service must be running");
            Assert.AreEqual(service.ServiceUrl, parameter.ServerUri, "Service URL should have been updated");
        }
 public virtual void TestSetup()
 {
     //Start driver service
     DriverService.Start(this.TestEnvironmentParameters);
     //Merge user provided options to existing default capabilities.
     Capabilities.MergeCapabilities(RunParameterUpdater);
     // Write Runsettings to log file
     TestLogs.WriteLogSection("Original Test Run Parameters", () => TestLogs.Write(this.TestEnvironmentParameters.ToString()));
     WebDriver.Initialize(Capabilities);
     //Write device configuration to log file
     TestLogs.WriteLogSection("DUT Configuration", () => TestLogs.Write(WebDriver.Instance.Capabilities.ToString()));
     WebTestContext.Set(Constants.TestEnvironmentKey, TestEnvironmentParameters);
     TestLogs.AddSection($"Test {TestContext.CurrentContext.Test.Name} Starts");
 }
 public virtual void TestTearDown()
 {
     try {
         if (TestContext.CurrentContext.Result.Outcome != ResultState.Success)
         {
             Screenshot.Attach();
         }
         TestLogs.AddSection($"Test {TestContext.CurrentContext.Test.Name} Ends");
         TestLogs.Attach();
     } catch (Exception e) {
         throw new Exception($"Teardown failed. Urgent attention required!!! Exception: \n {e}");
     } finally {
         WebDriver.Dispose();
         DriverService.Dispose();
     }
 }
Example #4
0
 public void TestCleanup()
 {
     BaseDriverService.Dispose();
 }