Skip to content

Instantly share code, notes, and snippets.

@SeidChr
Created December 11, 2022 02:07
Show Gist options
  • Save SeidChr/2090bae56b140a4baeff3c02f2caf6e8 to your computer and use it in GitHub Desktop.
Save SeidChr/2090bae56b140a4baeff3c02f2caf6e8 to your computer and use it in GitHub Desktop.
Playwright with XUnit
namespace playwrighttests;
// <PackageReference Include="PlaywrightSharp" Version="0.192.0" />
public class UnitTest1
{
[Fact]
public async void Test1()
{
var pw = await PlaywrightSharp.Playwright.CreateAsync();
var br = await pw.Chromium.LaunchAsync();
var pg = await br.NewPageAsync();
await pg.GoToAsync("https://www.google.de");
var html = await pg.GetInnerHtmlAsync("*");
Assert.False(string.IsNullOrWhiteSpace(html));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment