How to implement custom verification extension method for a generic page object.
There are similar page verifications in tests that are possible to extract to extention methods.
using Atata;
namespace SampleApp.UITests
{
public static class IPageObjectVerificationProviderExtensions
{
public static TPageObject BeOnEditPage<TPageObject>(this IPageObjectVerificationProvider<TPageObject> should)
where TPageObject : PageObject<TPageObject>
{
return should.Component.PageUrl.Should.WithSettings(should).Contain("/Edit.aspx");
}
}
}
Go.To<SomePage>()
.Should.BeOnEditPage();