Writing more complex tests
So far, we have only tested the very basic example of our sign-in interface rendering. However, we also want to make sure that our sign-in interface actually works and allows users to sign in. For this, we will write a new test that ensures that when a username and password are being provided, the sign-in button is clickable:
- Create a new function,
VerifyButtonIsEnabledWithUsernameAndPassword
, inside theSignInTests.cs
file and add the Test attribute to it. - Since we will use those queries more often, add the following
Query
objects to theSignInTests
class:Query usernameInput = q => q.Marked("UsernameInput"); Query passwordInput = q => q.Marked("PasswordInput"); Query signInButton = q => q.Marked("SignInButton");
- Now, let's simulate entering text in the username and password fields by inserting the following code into the
VerifyButtonIsEnabledWithUsernameAndPassword
test:App.ClearText(usernameInput...