Open bloodgang94 opened 2 years ago
Same question here. When we are testing a scenario on a page which needs another page to be accessed from, using 2 page objects does not work as a browser instance will be created for each page.
An example would be to have an Home Page with a button that allows to navigate to a "Page To test" only reachable from the Home Page.
Same issue, have a BasePage which is used by a LoginPage to login. LoginPage starts up a browser session and works no problem. When a new page is created after logging in another browser window is opened rather than using the LoginPage session. Any ideas how to resolve?
Yeah, the example is not the best in this case. I will try to find some time to improve it.
@TechWatching @bloodgang94 @matthewearley-payroc How do you work with blocks? I would like to spread the functionality of individual blocks on the page so as not to create huge classes with pages
This is something that is causing me an issue too. It is, in fact, blocking me from continuing to evaluate using Specflow.Actions.Playwright as part of the solution for one of my teams. Any update on this?
Any update on this please? The same as @Myvryn I am evaluating Playwright and not sure how to get around this issue.
I temporarily declined up using SpecFlow.Actions. This approach works great for me :
var page = await context.NewPageAsync(); _objectContainer.RegisterInstanceAs(page);
public abstract class BasePage { protected IPage Page { get; } public BasePage(IPage page) => Page = page; }
Everything works fine both using a ready-made docker image and via a web socket (Moon)
@bloodgang94 Is that possible that you provide us the Hook and Base Page ?
Same issue, have a BasePage which is used by a LoginPage to login. LoginPage starts up a browser session and works no problem. When a new page is created after logging in another browser window is opened rather than using the LoginPage session. Any ideas how to resolve?
I have same issue. Have you an oplossing now?
Same issue, have a BasePage which is used by a LoginPage to login. LoginPage starts up a browser session and works no problem. When a new page is created after logging in another browser window is opened rather than using the LoginPage session. Any ideas how to resolve?
I have same issue. Have you an oplossing now?
Created a small example. This approach has a drawback I didn't figure out how to use Multiple contexts
@SabotageAndi It would be great if this issue is fixed - Certainly Cannot use this with multiple page options
Curious whether this plugin supports multiple pages, just that the current examples illustrates it wrong ?
@SabotageAndi Any thoughts on this ?
When I create a new page object, a new browser instance opens. In your example, I saw only one class. Are there ways to solve the problem?