PlaywrightContrib.Extensions 1.0.0

Contributions to Playwright for .NET 🎭🧪

✔️ PlaywrightContrib.Extensions is a library with extension methods for writing tests with the Playwright API
✔️ It provides a convenient way to write readable and robust browser tests in .NET
✔️ Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast

Install-Package PlaywrightContrib.Extensions -Version 1.0.0
dotnet add package PlaywrightContrib.Extensions --version 1.0.0
<PackageReference Include="PlaywrightContrib.Extensions" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PlaywrightContrib.Extensions --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PlaywrightContrib.Extensions, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install PlaywrightContrib.Extensions as a Cake Addin
#addin nuget:?package=PlaywrightContrib.Extensions&version=1.0.0

// Install PlaywrightContrib.Extensions as a Cake Tool
#tool nuget:?package=PlaywrightContrib.Extensions&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

PlaywrightContrib.Extensions 🎭🧪

build CodeFactor

PlaywrightContrib.Extensions is a library with extension methods for writing tests with the Playwright API.

using FluentAssertions;
using Microsoft.Playwright;
using PlaywrightContrib.Extensions;

var playwright = await Playwright.CreateAsync();
var browser = await playwright.Chromium.LaunchAsync();
var page = await browser.NewPageAsync();

await page.GotoAsync("https://github.com/microsoft/playwright-dotnet");
var link = await page.QuerySelectorWithContentAsync("h1 a", "playwright-dotnet");
(await link.HrefAsync()).Should().Be("https://github.com/microsoft/playwright-dotnet");
(await page.HasContentAsync("Playwright for .NET is the official language port of Playwright")).Should().BeTrue();

await page.ClickAsync("a span[data-content='Actions']");
await page.WaitForNavigationAsync();
var latestStatus = await page.QuerySelectorAsync("#partial-actions-workflow-runs .Box-row div[title]");
latestStatus.Exists().Should().BeTrue();
(await latestStatus.HasAttributeValueAsync("title", "This workflow run completed successfully.")).Should().BeTrue();

Extensions for IPage 📄

Attribute:

  • GetAttributeOrDefaultAsync

Evaluation:

  • HasContentAsync
  • HasTitleAsync

Query:

  • QuerySelectorAllWithContentAsync
  • QuerySelectorWithContentAsync

Extensions for IElementHandle 📑

Attribute:

  • ClassListAsync
  • ClassNameAsync
  • GetAttributeOrDefaultAsync
  • HrefAsync
  • IdAsync
  • NameAsync
  • SrcAsync
  • ValueAsync

Content:

  • OuterHTMLAsync

Evaluation:

  • Exists
  • HasAttributeAsync
  • HasAttributeValueAsync
  • HasClassAsync
  • HasContentAsync
  • HasFocusAsync
  • HasValueAsync
  • IsReadOnlyAsync
  • IsRequiredAsync
  • IsSelectedAsync

Query:

  • QuerySelectorAllWithContentAsync
  • QuerySelectorWithContentAsync

Would you like to know more? 🤔

Further documentation is available at https://github.com/hlaueriksson/playwright-dotnet-contrib

PlaywrightContrib.Extensions 🎭🧪

build CodeFactor

PlaywrightContrib.Extensions is a library with extension methods for writing tests with the Playwright API.

using FluentAssertions;
using Microsoft.Playwright;
using PlaywrightContrib.Extensions;

var playwright = await Playwright.CreateAsync();
var browser = await playwright.Chromium.LaunchAsync();
var page = await browser.NewPageAsync();

await page.GotoAsync("https://github.com/microsoft/playwright-dotnet");
var link = await page.QuerySelectorWithContentAsync("h1 a", "playwright-dotnet");
(await link.HrefAsync()).Should().Be("https://github.com/microsoft/playwright-dotnet");
(await page.HasContentAsync("Playwright for .NET is the official language port of Playwright")).Should().BeTrue();

await page.ClickAsync("a span[data-content='Actions']");
await page.WaitForNavigationAsync();
var latestStatus = await page.QuerySelectorAsync("#partial-actions-workflow-runs .Box-row div[title]");
latestStatus.Exists().Should().BeTrue();
(await latestStatus.HasAttributeValueAsync("title", "This workflow run completed successfully.")).Should().BeTrue();

Extensions for IPage 📄

Attribute:

  • GetAttributeOrDefaultAsync

Evaluation:

  • HasContentAsync
  • HasTitleAsync

Query:

  • QuerySelectorAllWithContentAsync
  • QuerySelectorWithContentAsync

Extensions for IElementHandle 📑

Attribute:

  • ClassListAsync
  • ClassNameAsync
  • GetAttributeOrDefaultAsync
  • HrefAsync
  • IdAsync
  • NameAsync
  • SrcAsync
  • ValueAsync

Content:

  • OuterHTMLAsync

Evaluation:

  • Exists
  • HasAttributeAsync
  • HasAttributeValueAsync
  • HasClassAsync
  • HasContentAsync
  • HasFocusAsync
  • HasValueAsync
  • IsReadOnlyAsync
  • IsRequiredAsync
  • IsSelectedAsync

Query:

  • QuerySelectorAllWithContentAsync
  • QuerySelectorWithContentAsync

Would you like to know more? 🤔

Further documentation is available at https://github.com/hlaueriksson/playwright-dotnet-contrib

Release Notes

Initial release 🎉

NuGet packages (1)

Showing the top 1 NuGet packages that depend on PlaywrightContrib.Extensions:

Package Downloads
PlaywrightContrib.FluentAssertions
Contributions to Playwright for .NET 🎭🧪 ✔️ PlaywrightContrib.FluentAssertions is a library for writing tests with FluentAssertions against the Playwright API ✔️ It provides a convenient way to write readable and robust browser tests in .NET ✔️ Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast ✔️ FluentAssertions offers a very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 149 6/28/2021