This thread is trying to answer question "How to use SpecFlow with Page Object Models and whether to share the same IPage or create a new one for each scenario?"
Create a Base.cs file with that inside:
public class Base { protected IPage Page; public Base(IPage page) => Page = page; }
Inside your other Pages files you will have:
`public class LoginPage : Base { public LoginPage(IPage page) : base(page) { }
public async Task LogIn(string email, string pass)
{
await Page.GetByPlaceholder(.......).FillAsync(email);
await Page.GetByPlaceholder(........).FillAsync(pass);
await Page.GetByRole(AriaRole.Button, new() { Name = ........}).ClickAsync();
await Assertions.Expect(Page.GetByText(........)).ToBeVisibleAsync();
}
}`
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].