Open princebaretto99 opened 1 year ago
@mxschmitt, any updates on this one?
@mxschmitt @pavelfeldman @avodovnik Any updates on suggestion on how this could be done? As per our investigation this is the line of code causing the issue https://github.com/microsoft/playwright-dotnet/blob/main/src/Playwright.NUnit/WorkerAwareTest.cs#L78 . If we can add a check for TestOk() and connection.isRemote(). But the connection or channel object is not available here. We would be happy to contribute too, can someone help on this?
Context:
Hi Team,
We are trying to inject the remote browser into playwright-nunit framework. While doing so we noticed that the Browser never gets closed using
Browser.close()
which results in "Abrupt Close" at the remote cloud's end. We have rewritten the BrowserService.cs by extending theIWorkerService
and used thebrowserType.ConnectAsync
method with BrowserStack's CDP URL to connect to the remote cloud.Apart from this we also noticed that the browser gets closed only in cases of errors/assertion errors.
Code Snippet
Below is the code snippet for the rewritten BrowserService.cs
Please let me know your thoughts on this.