I'm writing integration tests using WebDriver against a Blazor Web App. How do I test the visibility of validation messages?
For example, I have the following form:
<form method="post" action="/users/register"><div><input id="Name" class="form-control valid" type="text" aria-required="true" /><label for="Name" class="form-label">Name</label><ValidationMessage For="Name" class="text-danger"/></div><div><input id="EmailAddress" class="form-control valid" aria-required="true" type="email" /><label for="EmailAddress" class="form-label">Email Address</label></div></form>And the following test using WebDriver.
webDriver.Navigate().GoToUrl(WebSite.FullUrl(url))var name = webDriver.FindElement(By.Id("Name"))name.Clear();var emailAddress = webDriver.FindElement(By.Id("EmailAddress"))At this point I can see the validation message is now visible as expected. How do I programmatically verify that the validation message is visible?