Skip to content

Commit

Permalink
directly invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax committed Oct 20, 2023
1 parent 42eedc3 commit 03f1d3b
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions Examples/Razor/Razor.Playwright/GlobalSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,9 @@ public void RunBeforeAnyTests()

private static void InstallPlayWright()
{
ProcessStartInfo startInfo = new()
{
WindowStyle = ProcessWindowStyle.Hidden,
RedirectStandardOutput = true,
RedirectStandardError = true,
FileName = "pwsh",
Arguments = "playwright.ps1 install --with-deps"
};

using Process process = new()
{
StartInfo = startInfo,
};
process.OutputDataReceived += (sender, args) => Console.WriteLine(args.Data);
process.ErrorDataReceived += (sender, args) => Console.WriteLine(args.Data);
process.Start();
process.WaitForExit();
var exitCode = Microsoft.Playwright.Program.Main(new[] { "install", "--with-deps" });

if (process.ExitCode != 0)
if (exitCode != 0)
{
Console.WriteLine("Failed to install playwright.");
Assert.Fail();
Expand Down

0 comments on commit 03f1d3b

Please sign in to comment.