How to perform the navigation to different pages after the button/link click.
Simple sign in form which after ‘Sign In’ button click can navigate user to different pages. For example, to admin page or regular user profile page, depending on user account.
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" id="email">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password">
</div>
<button class="btn btn-primary">Sign In</button>
using Atata;
namespace SampleApp.UITests
{
using _ = SignInPage;
public class SignInPage : Page<_>
{
public TextInput<_> Email { get; private set; }
public PasswordInput<_> Password { get; private set; }
public Button<_> SignIn { get; private set; }
}
}
Go.To<SignInPage>()
.Email.Set("user@mail.com")
.Password.Set("abc123")
.SignIn.ClickAndGo<UserProfilePage>();
Go.To<SignInPage>()
.Email.Set("admin@mail.com")
.Password.Set("abc123")
.SignIn.ClickAndGo<AdminPage>();