playwright-dotnet icon indicating copy to clipboard operation
playwright-dotnet copied to clipboard

[Feature]: Add possibility to diagnose errors when Microsoft.Playwright.Program.Run() fails

Open 0xced opened this issue 7 months ago • 0 comments

🚀 Feature Request

Ensuring that playwright is properly installed can be done by running the following code:

var playwright = new Microsoft.Playwright.Program();
var exitCode = playwright.Run(["install", "--with-deps"]);

This is fine when the installation succeeds and the exit code is 0. But when running under xUnit.net (which does not capture the console output) and the installation fails with exit code 1, then it becomes impossibly hard to diagnose the root cause of the failure.

It would be nice to have an exception instead of a non-zero exit code.

Example

No response

Motivation

Diagnosing such issues required me to reference Playwright from source rather than using the NuGet package, putting breakpoints to figure out the actual Node.js call and run it in a console to get the actual error messages.

It would be much better to have a built-in way to extract the root cause of the failure.

0xced avatar Apr 03 '25 22:04 0xced