Пример #1
0
        public void Test11()
        {
            string email    = TestCommon.GenerateRandomString(5) + "@test.test";
            string password = "******";

            driver.Url = "https://localhost/litecart/en/";
            var    elements = driver.FindElements(By.CssSelector("#box-account-login a"));
            string link     = elements.Where(item => item.GetAttribute("textContent").Equals("New customers click here")).Select(item => item.GetAttribute("href")).Single();

            driver.FindElement(By.CssSelector(string.Format("#box-account-login a[href='{0}']", link))).Click();

            EnterText("company", "test company");
            EnterText("address1", "test address1");
            EnterText("address2", "test address2");
            EnterText("firstname", "test firstname");
            EnterText("lastname", "test lastname");
            EnterText("postcode", "98778");
            EnterText("city", "Toronto");
            SelectValueOfElement("[name='country_code']", "Italy");
            EnterText("email", email);
            EnterText("phone", "+39119119191");
            EnterText("password", password);
            EnterText("confirmed_password", password);


            driver.FindElement(By.CssSelector("[name='create_account']")).Click();

            Logout();

            EnterTextByCssSelector("#box-account-login input[name='email']", email);
            EnterTextByCssSelector("#box-account-login input[name='password']", password);

            driver.FindElement(By.CssSelector(".button-set [name='login']")).Click();
            Logout();
        }