Esempio n. 1
0
 public void Test2()
 {
     browser.SetText("//input[@id='package-origin-hp-package']", "Chihuahua, Chihuahua, Mexico (CUU-General Roberto Fierro Villalobos Intl.)");
     browser.SetText("//input[@id='package-destination-hp-package']", "Barcelona, Spain (BCN-All Airports)");
     browser.DoClickById("package-departing-hp-package");
     browser.DoClickByXPath("//button[@data-month='10' and @data-day='22']");
     browser.DoClickById("package-returning-hp-package");
     browser.DoClickByXPath("//button[@data-month='10' and @data-day='24']");
     browser.ClickUntilElementAppears("//label/button[@id='search-button-hp-package']", "//div[@class='imgLoading']");
     browser.WaitUntilElementAppears("//input[@id='star5']");
     browser.ClickUntilElementAppears("//input[@id='star5']", "//div[@id='legal-disclosure']");
     foreach (var elem in browser.FindElements("//article/div/div/a"))
     {
         elem.Click();
         Thread.Sleep(7000);
         browser.SwitchToNewWindow();
         browser.DoClickById("tab-reviews");
         browser.SelectFromCombo("//select[@id='reviews-sort-selector']", "Lowest rating");
         string rate = browser.FindElement("//span[@class='rating']/span").Text;
         if (Convert.ToInt32(rate) < 4)
         {
             Assert.Fail();
         }
     }
 }