How to implement custom verification extension method for a specific page object.
There is a repeating verification of a specific page in different tests. In its turn, it is possible to simplify it by extracting to extention method.
using Atata;
namespace SampleApp.UITests
{
public static class IPageObjectVerificationProviderExtensions
{
public static SomePage HaveSomething(this IPageObjectVerificationProvider<SomePage> should)
{
return should.Component.SomeProperty.Should.WithSettings(should).Equal("...");
}
}
}
Go.To<SomePage>()
.Should.HaveSomething();