|
|
@ -3,6 +3,20 @@ namespace PlaywrightStudy.Test
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class PlaywrightTest
|
|
|
|
public class PlaywrightTest
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 通过 API 安装浏览器
|
|
|
|
|
|
|
|
/// 当然有多种安装方式
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
[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
|
|
|
|
#region Edge
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public async void Baidu_Edge_Test()
|
|
|
|
public async void Baidu_Edge_Test()
|
|
|
|