Navigation to Any Page After Click

How to perform the navigation to different pages after the button/link click.

Given

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>

Implementation

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; }
    }
}

Navigate to Regular User Profile Page

Go.To<SignInPage>().
    Email.Set("user@mail.com").
    Password.Set("abc123").
    SignIn.ClickAndGo<UserProfilePage>();

Navigate to Admin Page

Go.To<SignInPage>().
    Email.Set("admin@mail.com").
    Password.Set("abc123").
    SignIn.ClickAndGo<AdminPage>();