public virtual ITestMethodBase Add(string testMethod) { CheckTestAlreadyInitialised(testMethod); IConfigurationReader configurationReader = new ConfigurationReader(TestContext, AppConfiguration); ITestMethodBase testMethodMain = new TestMethodCore(LoggingUtility, configurationReader, testMethod); TestMethods.AddOrUpdate(testMethod, testMethodMain, (key, oldValue) => testMethodMain); return(testMethodMain); }
public virtual void Dispose(string testMethod) { TestMethods.TryGetValue(testMethod, out var testMethodCore); if (testMethodCore == null) { return; } testMethodCore.IsInitialised = false; TestMethods.AddOrUpdate(testMethod, testMethodCore, (key, oldValue) => testMethodCore); TestMethods.TryRemove(testMethod, out _); }
public virtual ITestMethodBase UpdateConfigurationReader(string testMethod, IConfigurationReader configurationReader) { TestMethods.TryGetValue(testMethod, out var testMethodCore); if (testMethodCore == null) { throw new ApplicationException($"Test Method {testMethod} Doesn't Exist"); } testMethodCore.ConfigurationReader = configurationReader; TestMethods.AddOrUpdate(testMethod, testMethodCore, (key, oldValue) => testMethodCore); return(testMethodCore); }
public virtual ITestMethodBase InitialiseTestMethod(string testMethod) { TestMethods.TryGetValue(testMethod, out var testMethodCore); if (testMethodCore == null) { throw new ApplicationException($"Test Method {testMethod} Doesn't Exist"); } testMethodCore.IsInitialised = true; TestMethods.AddOrUpdate(testMethod, testMethodCore, (key, oldValue) => testMethodCore); return(testMethodCore); }
public override void Dispose(string testMethod) { TestMethods.TryGetValue(testMethod, out var testMethodCore); var webTestMethod = (WebTestMethod)testMethodCore; if (webTestMethod == null) { return; } webTestMethod.Dispose(); TestMethods.AddOrUpdate(testMethod, webTestMethod, (key, oldValue) => webTestMethod); TestMethods.TryRemove(testMethod, out _); }
public override ITestMethodBase Add(string testMethod) { CheckTestAlreadyInitialised(testMethod); IConfigurationReader configurationReader = new ConfigurationReader(TestContext, AppConfiguration); var webTestMethod = new WebTestMethod(DriverCleanup, LoggingUtility, configurationReader, testMethod); var browser = WebDriverService.StartWebDriver(testMethod); webTestMethod.WebDriver = browser.Item1; webTestMethod.WebDriverWait = browser.Item2; TestMethods.AddOrUpdate(testMethod, webTestMethod, (key, oldValue) => webTestMethod); return(webTestMethod); }