diff --git a/PlaywrightStudy.Test/PlaywrightTest.cs b/PlaywrightStudy.Test/PlaywrightTest.cs index f103b5a..099cad5 100644 --- a/PlaywrightStudy.Test/PlaywrightTest.cs +++ b/PlaywrightStudy.Test/PlaywrightTest.cs @@ -3,6 +3,20 @@ namespace PlaywrightStudy.Test { public class PlaywrightTest { + /// + /// 通过 API 安装浏览器 + /// 当然有多种安装方式 + /// + [Fact] + public void Install_Browsers_Test() + { + var exitCode = Microsoft.Playwright.Program.Main(new[] { "install" }); + if (exitCode != 0) + { + throw new Exception($"Playwright exited with code {exitCode}"); + } + } + #region Edge [Fact] public async void Baidu_Edge_Test()