예제 #1
0
        public void PopugSite_RadioGender_Enabled()
        {
            driver.Navigate().GoToUrl(testUrl);

            var assertsAccumulator = new AssertsAccumulator();

            assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(radioBoyLocator).Enabled, "Радиокнопка мальчика отключена"));
            assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(radioGirlLocator).Enabled, "Радиокнопка девочки отключена"));
            assertsAccumulator.Release();
        }
예제 #2
0
        public void PopugSite_RadioGender_Preselected()
        {
            driver.Navigate().GoToUrl(testUrl);
            SendForm();

            var assertsAccumulator = new AssertsAccumulator();

            assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(radioBoyLocator).Selected, "Мальчик не выбран по умолчанию"));
            assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(resulttextLocator).Text.Contains(boycall), "Предварительное радио не влияет на пол"));
            assertsAccumulator.Release();
        }
예제 #3
0
        public void TearDown()
        {
            AssertsAccumulator.Release();
            PageFactory.CloseDriver();

            var processes = Process.GetProcessesByName(Configuration.GetBrowser());

            foreach (var process in processes)
            {
                process.Kill();
            }
        }
예제 #4
0
        public void PopugSite_EmptyFormEmail_Error()
        {
            driver.Navigate().GoToUrl(testUrl);
            driver.FindElement(buttonLocator).Click();

            var assertsAccumulator = new AssertsAccumulator();

            assertsAccumulator.Accumulate(() => Assert.AreEqual("error", driver.FindElement(emailInputLocator).GetAttribute("class"), "поле не подсвечивается"));
            assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(formError).Displayed, "Текст ошибки не отображается"));
            assertsAccumulator.Accumulate(() => Assert.AreEqual("Введите email", driver.FindElement(formError).Text, "Неверный текст ошибки"));
            assertsAccumulator.Release();
        }
예제 #5
0
        public void PopugSite_AnotherEmailLink_FreeFormEmail()
        {
            driver.Navigate().GoToUrl(testUrl);
            SendForm();
            driver.FindElement(anotherEmailLinkLocator).Click();

            var assertsAccumulator = new AssertsAccumulator();

            assertsAccumulator.Accumulate(() => Assert.AreEqual(string.Empty, driver.FindElement(emailInputLocator).Text, "строка емейла не отчистилась"));
            assertsAccumulator.Accumulate(() => Assert.IsEmpty(driver.FindElements(resultblock), "Поле с сообщением осталось"));
            assertsAccumulator.Accumulate(() => Assert.IsFalse(driver.FindElement(anotherEmailLinkLocator).Displayed, "Не исчезла ссылка"));
            assertsAccumulator.Release();
        }
예제 #6
0
        public void PopugSite_FillFormEmail_Success(string TextMail)
        {
            driver.Navigate().GoToUrl(testUrl);
            driver.FindElement(emailInputLocator).SendKeys(TextMail);
            driver.FindElement(buttonLocator).Click();

            var assertsAccumulator = new AssertsAccumulator();

            assertsAccumulator.Accumulate(() => Assert.AreEqual(TextMail, driver.FindElement(emailResultLocator).Text, "Емейлы не совпали"));
            assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(resulttextLocator).Displayed, "Текст результата отображается"));
            assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(anotherEmailLinkLocator).Displayed, "Ссылка для другого емейла не отображается"));
            assertsAccumulator.Release();
        }
예제 #7
0
        public void PopugSite_F5afterSubmit_EmptyForm()
        {
            driver.Navigate().GoToUrl(testUrl);
            SendForm();
            driver.Navigate().Refresh();

            var assertsAccumulator = new AssertsAccumulator();

            assertsAccumulator.Accumulate(() => Assert.IsTrue(driver.FindElement(radioBoyLocator).Selected, "Радиокнопка не предвыбрана по умолчанию"));
            assertsAccumulator.Accumulate(() => Assert.AreEqual(string.Empty, driver.FindElement(emailInputLocator).Text, "строка емейла не отчистилась"));
            assertsAccumulator.Accumulate(() => Assert.IsEmpty(driver.FindElements(resultblock), "Поле с сообщением осталось"));
            assertsAccumulator.Accumulate(() => Assert.IsFalse(driver.FindElement(anotherEmailLinkLocator).Displayed, "Не исчезла ссылка"));
            assertsAccumulator.Release();
        }