Пример #1
0
        public void DivideByZeroTest()
        {
            loginPage.LoginToPage(testUserName, testUserPw);
            calculatorPage.WaitForTitle();

            calculatorPage.ClickButton(random.Next(0, 9));
            calculatorPage.SelectOperation(Operation.Divide);
            calculatorPage.ClickButton(0);
            calculatorPage.ClickButton(Button.Equal);

            Assert.IsTrue(calculatorPage.AlertIsPresent());
            if (calculatorPage.AlertIsPresent())
            {
                Assert.AreEqual("Cannot divide by 0", driver.SwitchTo().Alert().Text);
                driver.SwitchTo().Alert().Dismiss();
            }
        }