Example #1
0
        public void EditCountries_ZonesSortedAlphabetically()
        {
            List <IWebElement> countriesWithZones = GetCountriesWithNotEmptyZones();

            for (int i = 0; i < countriesWithZones.Count; i++)
            {
                var currentUrl = driver.Url;
                countriesWithZones[i].FindElement(By.CssSelector("a")).Click();
                var           editPage  = new EditCountryPage(driver);
                List <string> zoneNames = editPage.GetZonesNames();
                ValidateAlphabetical(zoneNames);
                driver.Url         = currentUrl;
                countriesWithZones = GetCountriesWithNotEmptyZones();
            }
        }
Example #2
0
        public void LinksAreOpenedInNewWindow()
        {
            var adminPage     = navigator.ToAdminPage();
            var countriesPage = adminPage.GoToCountries();

            countriesPage.GetCountriesColumnButtons().First().Сlick();
            var           countryEditPage = new EditCountryPage(driver);
            var           externalLinks   = countryEditPage.GetExternalLinks();
            var           mainWindow      = driver.CurrentWindowHandle;
            List <string> oldWindows      = driver.WindowHandles.ToList();

            for (int i = 0; i < externalLinks.Count; i++)
            {
                externalLinks[i].Сlick();
                string newWindow = wait.Until(AnyWindowOtherThanThat(oldWindows));
                driver.SwitchTo().Window(newWindow);
                driver.Close();
                driver.SwitchTo().Window(mainWindow);
            }
            driver.Close();
        }