public void JupiterToysSearch()
        {
            using (var driver = new ChromeDriver(@".\"))
            {
                driver.Manage().Timeouts().ImplicitWait = (TimeSpan.FromSeconds(10));
                driver.Navigate().GoToUrl("http://jupiter.cloud.planittesting.com/");
                driver.Manage().Window.Maximize();
                HomePage homePage = new HomePage(driver);
                // TODO: Verify we are actually on the Jupiter Toys home page
                Assert.Equal("Jupiter Toys", (driver.FindElementByClassName("brand").Text));

                ContactPage contactPage = homePage.clickContact();

                // TODO: Check that the status msg is what we expect: "We welcome your feedback - tell it how it is."
                Assert.Equal("We welcome your feedback - tell it how it is.", contactPage.getMsgBeforeFeedback());

                contactPage.EnterForename("kapil");
                contactPage.EnterSurname("Batra");
                contactPage.EnterEmail("*****@*****.**");
                contactPage.EnterTelephone("045363738");
                contactPage.EnterMessage("test message");

                contactPage.clickSubmit();
                // TODO: Check that the status message is "Thanks kapil, we appreciate your feedback"
                Assert.Equal("Thanks kapil, we appreciate your feedback.", contactPage.getMsgAfterFeedback());


                //Assert.Equal(,"");
                //driver.FindElementByCssSelector("li#nav-login").Click;
                // driver.FindElementByCssSelector("div.hero-unit h1");


                driver.Quit();
            }
        }
Ejemplo n.º 2
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);
            }
        }