Skip to content

healenium/healenium-example-playwright-dotnet

Repository files navigation

healenium-example-playwright-dotnet

Prerequisites

Connection to Healenium proxy is configured in BaseHealeniumTest.cs:

var wsEndpoint = Environment.GetEnvironmentVariable("PLAYWRIGHT_SERVER_URL")
    ?? "ws://localhost:8095/hlm-playwright-proxy";
_browser = await _playwright.Chromium.ConnectAsync(wsEndpoint, new BrowserTypeConnectOptions
{
    Timeout = 60000
});

Build

dotnet restore
dotnet build

Install Playwright browsers (if running without Healenium proxy):

pwsh bin/Debug/net8.0/playwright.ps1 install

Or use the system-wide Playwright:

playwright install

Run Playwright server separately (optional)

See healenium docker-compose. If the Playwright server is not running with the playwright-proxy, run it separately:

npx -y playwright run-server --port 5050

Run Playwright proxy with Node server

healenium-playwright-proxy

Connection to the proxy is configured in BaseHealeniumTest.cs.

Run tests

All tests:

dotnet test

Filter by test class (e.g. locator chain tests):

dotnet test --filter "FullyQualifiedName~LocatorChainTests"

Run a single test:

dotnet test --filter "FullyQualifiedName~Simple_chain_form_then_getByPlaceholder"

Project structure

  • BaseHealeniumTest.cs – base class that connects to the Healenium Playwright proxy and provides Page and common timeouts.
  • tests/test-env/playwright-specific/ – Playwright Locator API tests (chained locators, getBy, actions, expect, iframe, drag-drop, utility, pseudo-class).
  • tests/test-env/selenium-like-locator-api/ – Selenium-like locator tests (CSS, XPath, simple, general, parent-child).

Docs

Running and debugging Playwright tests

Playwright for .NET

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages