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.csfile and add the Test attribute to it. - Since we will use those queries more often, add the following
Queryobjects to theSignInTestsclass: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
VerifyButtonIsEnabledWithUsernameAndPasswordtest:App.ClearText(usernameInput...