Ejemplo n.º 1
0
        public void TestCase3()

        {
            try
            {
                var invalidEmail = "Email";
                var invalidPhone = "Phone";
                var homePage     = new HomePage(Driver);
                homePage.GoTo();
                ContactPage contactPage = homePage.GoToContactPage();
                //WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(5));
                //wait.Until(ExpectedConditions.ElementExists(By.CssSelector(".btn-contact.btn.btn-primary")));
                contactPage.EnterEmail(invalidEmail);
                contactPage.EnterTelephone(invalidPhone);

                Assert.AreEqual("Please enter a valid email", contactPage.GetEmailErrorMsg(), $"Displayed Email error message  is different and looks like : {contactPage.GetEmailErrorMsg()}");
                Assert.AreEqual("Please enter a valid telephone number", contactPage.GetTelephoneErrorMsg(), $"Displayed telephone error message  is different and looks like : {contactPage.GetTelephoneErrorMsg()}");
            }

            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }