public void ShouldValidateContactDetails()
        {
            _contactPage.NavigateTo();

            // Don't enter a name
            _contactPage.EnterFormValue(nameof(ContactViewModel.Email), "*****@*****.**");
            _contactPage.EnterFormValue(nameof(ContactViewModel.Website), "");
            _contactPage.EnterFormValue(nameof(ContactViewModel.Subject), "Enquiry");
            _contactPage.EnterFormValue(nameof(ContactViewModel.Message), "This is a test message");

            var responsePage = _contactPage.Submit("ContactSubmit");

            Assert.Equal("Contact Me | Digital Nomad Dave", _contactPage.Driver.Title);

            IWebElement firstErrorMessage =
                _contactPage.Driver.FindElement(By.Id(nameof(ContactViewModel.Name) + "-error"));

            Assert.Equal("The Name field is required.", firstErrorMessage.Text);
        }
 public void GivenIAmOnTheHomeScreen()
 {
     _browser    = new SeleniumChromeBrowserFixture();
     _homeScreen = new SeleniumPage(_browser.Driver, "");
     _homeScreen.NavigateTo();
 }
Beispiel #3
0
 public void GivenIAmOnTheContactScreen()
 {
     _browser       = new SeleniumChromeBrowserFixture();
     _contactScreen = new SeleniumPage(_browser.Driver, "contact");
     _contactScreen.NavigateTo();
 }