We accomplish two big milestones in September. Microsoft adopted Playwright Sharp and now is part of the Playwright family.
We shipped v0.142.0, which is the first version having full feature match with Playwright!

boom

No v1 yet?

We decided to leave PlaywrightSharp in v0, so we can give you the chance to send us feedback and help us shape the API.
Until we decide to make it v1, the minor version will map to the Playwright version. In this case, v0.142.0 maps to v1.4.2 in Playwright.

Breaking Changes

Now that Playwright Sharp is part of the Playwright family, there must be some consistency between Playwright bindings. But, you shouldn’t feel as if Playwright Sharp was generated by some code conversion tool. Playwright Sharp needs to be a first-class C# library.

During this evaluation, we decided to drop most option classes, like ClickOptions, PdfOptions, etc. We left a few classes related to launch settings, like LaunchOptions. We considered you might want to load those options from a settings file.

Our tools shapes how we code

The tools we use shape how we code. If you use Entity Framework, you will use Linq a lot. If you use Playwright Sharp, we will want you to take advantage of named arguments.

So, if we drop PdfOptions in Page.GetPdfAsync, we woulnd’t like you to do this:

await page.GetPdfAsync(null, 1, true, headerTemplate, "<div>Test footer template</div>", 
true, false, "", null, null, null, new Margin { Bottom = "1in", Top = "2in" }, false);

But this

await page.GetPdfAsync(
  displayHeaderFooter: true,
  headerTemplate: headerTemplate,
  footerTemplate: "<div>Test footer template</div>",
  margin: new Margin { Bottom = "1in", Top = "2in" },
  printBackground: true);

playwright-sharp dotnet tool

One of the weak spots of Playwright Sharp was the need for a await Playwright.InstallAsync(); in runtime. That wasn’t ideal.
Now we can get rid of that line using the new playwright-sharp dotnet tool. It’s as easy as installing the tool and running the install command:

dotnet tool install playwright-sharp-tool -g
playwright-sharp install-browsers

This dotnet tool opens the door to many other CLI features we can implement in the future.

playwrightsharp.dev

Thanks to Meir Blachman we now have a site!
This is still a work in progress, but we started to build the website. You can take a look at the API and a few Examples.

Activity

  • Repository Stars: 165 (prev 140) +17%
  • Repository Forks: 14 (prev 10) +40%
  • Nuget downloads: 550

Final words

Getting close to our first v1 version, I’m looking forward to getting more feedback. The issues tab in GitHub is open for all of you to share your ideas and thoughts.
Don’t forget to follow me on Twitter @hardkoded to get more updates.

Don’t stop coding!

Previous Reports