Ossa.TestFramework.UIIntegration.Playwright
1.0.1
See the version list below for details.
dotnet add package Ossa.TestFramework.UIIntegration.Playwright --version 1.0.1
NuGet\Install-Package Ossa.TestFramework.UIIntegration.Playwright -Version 1.0.1
<PackageReference Include="Ossa.TestFramework.UIIntegration.Playwright" Version="1.0.1" />
paket add Ossa.TestFramework.UIIntegration.Playwright --version 1.0.1
#r "nuget: Ossa.TestFramework.UIIntegration.Playwright, 1.0.1"
// Install Ossa.TestFramework.UIIntegration.Playwright as a Cake Addin #addin nuget:?package=Ossa.TestFramework.UIIntegration.Playwright&version=1.0.1 // Install Ossa.TestFramework.UIIntegration.Playwright as a Cake Tool #tool nuget:?package=Ossa.TestFramework.UIIntegration.Playwright&version=1.0.1
Ossa.TestFramework.UIIntegration.Playwright
Overview
This package based on Playwright and C# provides a set of methods and test project configuration to speed up UI/Integration tests. Along with configuration assistance to support the Ossa.TestFrameWorkTemplates 'ossa-test-playwright' template, the test methods are designed to be consitent across both Ossa.TestFramework.UIIntegration.Selenium and Ossa.TestFramework.UIIntegration.Playwright packages.
The package provides functionality for organising actions in Steps, and provides a simple interface for performing common UI test actions and selection methods.
Advantages are:
- reduced reliance on complex selectors
- Tested helper methods for dropdowns, iframes, slider/range inputs, and more
- Automatic snapshots after each user step and snapshot on error/test failure
Getting Started
Install the package to your integration project using nuget manager or from the dotnet command line:
dotnet new add Ossa.TestFramework.UIIntegration.Playwright
or install the startertemplate
Starter integration project
See nuget package Ossa.TestFramework.Templates for a starter project and install the ossa-test-playwright template.
Prerequisites
- Recommended Visual studio 2022 or later
- .NET 8.0 or later
Usage
Ossa.TestFramework.Templates for a starter project example or see the devops WIKI. Main components are PlaywrightBrowserSession (implementing IBrowserSession) and PlaywrightByLocator (implemeting IByLocator). Which can be used to implement a PageObject pattern for your tests
Want to implement some additional playwright code? Simply use the PlaywrightBylocator.Selector to obtain a Playwright 'locator' object you can work with
Additional documentation
- Ossa Templates: https://www.nuget.org/packages/Ossa.TestFramework.Templates/
- Playwright: https://playwright.dev/dotnet/docs/intro
Codegen
You can run the Playwright codegen tool from the build directory. This tool can be used to identify elements, create locators in order to build a page object model.
powershell bin/Debug/net6.0/playwright.ps1 codegen' or 'powershell bin/Debug/net7.0/playwright.ps1 codegen
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Console (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Microsoft.Playwright (>= 1.43.0)
- Ossa.TestFramework.Core (>= 1.0.1)
-
net7.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Console (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Microsoft.Playwright (>= 1.43.0)
- Ossa.TestFramework.Core (>= 1.0.1)
-
net8.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Console (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Microsoft.Playwright (>= 1.43.0)
- Ossa.TestFramework.Core (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.