Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Connecting to an Existing Browser in Playwright Tests #53

Open
harryepstein opened this issue Dec 13, 2023 · 1 comment

Comments

@harryepstein
Copy link

In our tests, we have a requirement to connect to an existing browser instance. This is particularly useful when we need to maintain the session state across multiple tests, especially in scenarios where manual intervention is required (like entering a pin for an SSL certificate).

Currently, we're using the playwright.chromium.connectOverCDP() method to connect to an existing Chromium-based browser (Microsoft Edge) that's already running with remote debugging enabled:

beforeAll(async() => {
    jest.setTimeout(60000);
    browser = await playwright.chromium.connectOverCDP('http://localhost:9223');  
});

However, we believe it would be beneficial to have built-in support for this functionality in the d365-ui-test library. This could potentially be implemented as an option in the XrmUiTest constructor or as a separate method.

We're looking forward to your thoughts on this. Any help or guidance would be greatly appreciated.

@DigitalFlow
Copy link
Member

HI @harryepstein,

sounds like a good use case, I would be willing to add it.

Is all that is needed a CDP URL that we use for populating the browser property via the connectOverCDP call?

That would be fairly easy to add. Would have to check whether the other browser have support for that as well.

Kind regards,
Florian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants