Пример #1
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");
        }
Пример #2
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);
        }