コード例 #1
0
 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());
 }
コード例 #2
0
        public ParentPage(IBasePage basePage)
        {
            BasePage = basePage;
            ToolDependencyResolver = basePage.GetToolDependencyResolver();
            Resolver = basePage.GetResolver();

            TestObjectFactory = ToolDependencyResolver.Resolve <ITestObjectFactory>(basePage.GetBrowser());
        }
コード例 #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>());
 }
コード例 #4
0
 public BasePage(IBrowser browser, IDependencyResolver resolver,
                 IToolDependencyResolver toolDependencyResolver)
 {
     _browser  = browser;
     _resolver = resolver;
     _toolDependencyResolver = toolDependencyResolver;
     _screenShotTaker        = _toolDependencyResolver.Resolve <IScreenshotTaker>(this.GetBrowser());
     HomePage  = _resolver.Resolve <HomePage>(this);
     LoginPage = _resolver.Resolve <LoginPage>(this);
 }
コード例 #5
0
        public IVerification VerifyDisplayStyleWith(string displayValue)
        {
            IVerification info   = Resolver.Resolve <IVerification>();
            string        script = "var element = arguments[0];";

            script += "return element.style.display;";

            IJavaScriptExecutor js = (IJavaScriptExecutor)GetDriver();
            string displayStyle    = js.ExecuteScript(script, GetAutomationElement()).ToString();

            info.Expected = displayValue;
            info.Actual   = displayStyle;
            if (displayStyle.Contains(displayValue))
            {
                info.Result = true;
            }
            else
            {
                info.Result = false;
            }

            return(info);
        }
コード例 #6
0
 public ITestObject Get(Locator locator, string value)
 {
     TOLocator = Resolver.Resolve <ITestObjectLocator>(locator, value);
     return(Get(TOLocator));
 }