How to perform the navigation to specific page after the button/link click.
There is a page containing link/button that navigates to another page.
Button
, Link
and Clickable
controls support 2 generic arguments.
The first one is the type of page object to navigate to, e.g. AnotherPage
.
The last one is the type of current page object, typically _
.
using Atata;
namespace SampleApp.UITests
{
using _ = SomePage;
public class SomePage : Page<_>
{
public Button<AnotherPage, _> ViewAnother { get; private set; }
// Or using link:
//public Link<AnotherPage, _> ViewAnother { get; private set; }
}
}
Go.To<SomePage>()
.ViewAnother.ClickAndGo(); // Returns an instance of AnotherPage.