Exemple #1
0
        public void DetermineElementPresenceBySelector()
        {
            PageAssertion pageAssertion = new PageAssertion($"{nameof(DetermineElementPresenceBySelector)}_Test", async(page) =>
            {
                return(new PageAssertionResult(page, await page.IsPresentAsync(".header"))); // assert that there is an element matching the selector
            });
            AutomationPage      page   = AutomationPage.Open("https://okta.com");
            PageAssertionResult result = pageAssertion.Execute(page);

            result.Passed.Should().BeTrue();
            Console.WriteLine("passed");
        }
Exemple #2
0
        public void HandlePopUp()
        {
            var automationPage = new AutomationPage(driver);
            var homePage       = new ToolsQAHomePage(driver);

            automationPage.NavigateTo();
            automationPage.NewTabButton.Click();
            this.driver.SwitchTo().ActiveElement();
            var secondTab = this.driver.WindowHandles.Last();

            Assert.AreEqual("http://toolsqa.com/wp-content/uploads/2014/08/Toolsqa.jpg",
                            homePage.Logo.GetAttribute("src"));
            Assert.AreEqual(2, driver.WindowHandles.Count);
        }
Exemple #3
0
        public void HandlePopUp()
        {
            var automationPage = new AutomationPage(this.driver);
            var homePage       = new ToolsQAHomePage(this.driver);

            automationPage.Navigate();
            string firstTab = this.driver.WindowHandles.First();

            automationPage.NewTabButton.Click();
            string secondTab = this.driver.WindowHandles.Last();

            this.driver.SwitchTo().Window(secondTab);
            homePage.AssertLogoSrc("http://20tvni1sjxyh352kld2lslvc.wpengine.netdna-cdn.com/wp-content/uploads/2014/08/Toolsqa.jpg");
            automationPage.AssertCountTabs(2);
        }
Exemple #4
0
        public void HandlePopUp()
        {
            var automationPage = new AutomationPage(this.driver);
            var homePage       = new ToolsQaHomePage(this.driver);

            automationPage.NavigateTo();
            automationPage.NewTabButton.Click();
            this.driver.SwitchTo().ActiveElement();

            // Check is logo has "src" attribute
            homePage.AssertToolsQaLogoSrcContains("/wp-content/uploads/2014/08/Toolsqa.jpg");

            // Close the first open tab
            automationPage.PageClose();

            // Check that the driver handles only one window (in ToolsQaHomePageAsserter.cs)
            driver.AssertNumberOfWindowsHandled(1); // Attention: There are two asserts in the method
        }
Exemple #5
0
 public RegistrationSteps()
 {
     automationPage = new AutomationPage();
 }
 public LoginSteps()
 {
     automationPage = new AutomationPage();
 }