Esempio n. 1
0
        //Navigation via Kitchen -> Cool -> Built in Refrigerator
        public void TestViaNavigation()
        {
            string        homePage = "https://www.fisherpaykel.com/nz.html";
            FirefoxDriver driver   = new FirefoxDriver();

            //This can be a timeout setting in a config file - from requirements
            //How many seconds to wait to conclude that the page is unresponsive
            //Setting it to 5 seconds
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));

            FisherPaykelPageObject fpObject = new FisherPaykelPageObject();

            fpObject.openPage(homePage, driver);
            verificationErrors = new StringBuilder();
            //reuse common functions in the page object
            //fpObject.ClickLinkText("Kitchen", driver); - opens kitchen in a new page
            driver.FindElement(By.XPath("//div[@id='footer-top']/div/div/div/div[2]/a/h6")).Click();
            //Click on cool
            fpObject.ClickCool(driver);
            //Click on Built in Refrigerator image
            fpObject.ClickBuiltInRefrigeratorImage(driver);
            //Ensure search page has the fridge listed
            Assert.IsTrue(fpObject.IsTextPresent("RS90AU1", driver), "Failed to locate the element");
            //Click on the image
            System.Threading.Thread.Sleep(2000);
            driver.FindElement(By.XPath("//div[@id='wrap']/div[3]/div/div[3]/div/div[2]/div/div/a/img")).Click();
            System.Threading.Thread.Sleep(2000);
            //Click on View All Specs
            fpObject.ClickLinkText("View All Specs", driver);
        }
Esempio n. 2
0
        public void TestViaSearch()
        {
            string        homePage = "https://www.fisherpaykel.com/nz.html";
            FirefoxDriver driver   = new FirefoxDriver();

            //This can be a timeout setting in a config file - from requirements
            //How many seconds to wait to conclude that the page is unresponsive
            //Setting it to 5 seconds
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5));

            FisherPaykelPageObject fpObject = new FisherPaykelPageObject();

            fpObject.openPage(homePage, driver);
            verificationErrors = new StringBuilder();

            //Click on search icon
            fpObject.ClickSearchIcon(driver);
            //Enter search term
            fpObject.EnterSearchTerm("RS90AU1", driver);
            //Click search
            fpObject.clickSearch(driver);
            //Ensure search page has the fridge listed
            Assert.IsTrue(fpObject.IsTextPresent("RS90AU1", driver));

            //Can either click linktext or can click image
            //fpObject.ClickLinkText("ActiveSmart™ Fridge 900mm French Door Slide -in with Ice & Water – Stainless Steel", driver);
            fpObject.ClickFridgeImage(driver);
            //Ensure search page has the fridge listed
            Assert.IsTrue(fpObject.IsTextPresent("RS90AU1", driver));

            //Click View All Specs
            //fpObject.ClickLinkText("View All Specs", driver);

            //Ensure that the dimensions for the fridge are showing
            //Assert.IsTrue(fpObject.IsTextPresent("1798", driver));
            //Assert.IsTrue(fpObject.IsTextPresent("896", driver));
            //Assert.IsTrue(fpObject.IsTextPresent("606", driver));
        }