public EdgeTestObject(IBrowser browser, ITestObjectLocator toLocator, IToolDependencyResolver resolver)
 {
     this.browser      = browser;
     Resolver          = resolver;
     TestObjectLocator = toLocator;
     WaitFor           = Resolver.Resolve <IWaitFor>(browser.GetInstance().GetDriver <IWebDriver>(), toLocator.GetLocator());
 }
Beispiel #2
0
 private void ValidateWaitFor(IWaitFor waitFor)
 {
     _currentContext.AssertNotNull(waitFor, "WaitFor");
     if (waitFor is WaitForSeconds waitForSeconds)
     {
         _currentContext.AssertIsPositiveIfPresent(waitForSeconds.Seconds,
                                                   PropertyNames.SECONDS);
     }
     else if (waitFor is WaitForSecondsPath waitForSecondsPath)
     {
         AssertWaitForPath(waitForSecondsPath.SecondsPath, PropertyNames.SECONDS_PATH);
     }
     else if (waitFor is WaitForTimestamp waitForTimestamp)
     {
         _currentContext.AssertNotNull(waitForTimestamp.Timestamp, PropertyNames.TIMESTAMP);
     }
     else if (waitFor is WaitForTimestampPath waitForTimestampPath)
     {
         AssertWaitForPath(waitForTimestampPath.TimestampPath, PropertyNames.TIMESTAMP_PATH);
     }
     else if (waitFor != null)
     {
         throw new Exception("Unsupported WaitFor strategy: " + waitFor.GetType());
     }
 }
Beispiel #3
0
 public FirefoxTestObject(IBrowser browser, ITestObjectLocator toLocator, IToolDependencyResolver resolver)
 {
     this.browser      = browser;
     Resolver          = resolver;
     TestObjectLocator = toLocator;
     WaitFor           = Resolver.Resolve <IWaitFor>(browser.GetInstance().GetDriver <IWebDriver>(), toLocator.GetLocator());
     JSExecuter        = new CustomJavaScriptExecuter(browser.GetInstance().GetDriver <IWebDriver>());
 }