public IWebElement SurveyEmail(string email)
        {
            //select our drop-down and enters a parkcode
            SelectElement ParkSelector = new SelectElement(chromeDriver.FindElement(By.Id("ParkCode")));

            ParkSelector.SelectByValue("CVNP");

            //type an email for us and then clears any older entries then send email brought in and types it in SendKeys(email)
            WaitForElement(By.Id("EmailAddress"));
            EmailBox.Clear();
            EmailBox.SendKeys(email);

            //select from a drop down menu
            SelectElement StateSelector = new SelectElement(chromeDriver.FindElement(By.Id("State")));

            StateSelector.SelectByValue("OH");

            //select radio butons
            IList <IWebElement> radioSelect = chromeDriver.FindElements(By.Id("ActivityLevel"));

            radioSelect[0].Click();

            WaitForElement(By.Id("submit"));
            SubmitButton.Click();

            WaitForElement(By.Id("survey"));
            return(Survey);
        }
Exemple #2
0
        public void ThenIShouldBeAbleToContactQAWorksWithTheFollowingInformation(Table table)
        {
            var form = table.CreateInstance <ContactUsForm>();

            NameBox.SendKeys(form.Name);
            EmailBox.SendKeys(form.Email);
            MessageBox.SendKeys(form.Message);
            SendButton.SendKeys(Keys.Return);
            Assert.That(!NameValidation.Displayed, "Form not submitted due to Name validation");
            Assert.That(!EmailValidation.Displayed, "Form not submitted due to invalid Email");
            Assert.That(!EmailBoxValidation.Displayed, "Form not submitted due to Email validation");
            Assert.That(!MessageValidation.Displayed, "Form not submitted due to Messsage validation");
            Assert.That(NameBox.GetAttribute("value") == string.Empty, "Name field should be clear");
            Assert.That(EmailBox.GetAttribute("value") == string.Empty, "Email field should be clear");
            Assert.That(MessageBox.GetAttribute("value") == string.Empty, "Message box should be clear");
        }
Exemple #3
0
        public void WhenISubmitTheFormWithWithOneOfTheFieldsLeftBlankOrWithAnInvalidEmail(string name, string email, string message)
        {
            //Hard to pass an empty string in Scenario Outline examples hence the below line
            if (name == "\"\"")
            {
                name = string.Empty;
            }
            if (email == "\"\"")
            {
                email = string.Empty;
            }
            if (message == "\"\"")
            {
                message = string.Empty;
            }

            NameBox.SendKeys(name);
            EmailBox.SendKeys(email);
            MessageBox.SendKeys(message);
            SendButton.SendKeys(Keys.Return);
        }