Skip to content

Add TestExpectation system, remove continue-on-error#75

Merged
kblok merged 23 commits intomainfrom
infra-combined
Mar 25, 2026
Merged

Add TestExpectation system, remove continue-on-error#75
kblok merged 23 commits intomainfrom
infra-combined

Conversation

@kblok
Copy link
Member

@kblok kblok commented Mar 23, 2026

Summary

  • Port the TestExpectation pattern from puppeteer-sharp to skip known-failing tests instead of relying on continue-on-error: true in CI
  • PlaywrightTestAttribute.ApplyToTest() now matches tests against a JSON expectations file and marks FAIL/SKIP/TIMEOUT entries as RunState.Ignored
  • 18 spec file patterns covering ~122 pre-existing failures listed in TestExpectations.local.json (embedded resource)
  • NetworkPostDataTests.ShouldThrowOnInvalidJSONInPostData gets [Ignore] since it has no [PlaywrightTest] attribute
  • All three continue-on-error: true entries removed from .github/workflows/dotnet.yml

Test plan

  • CI builds green (0 compile errors)
  • Previously-failing tests show as Ignored/Skipped, not Failed
  • Previously-passing tests still run and pass
  • No continue-on-error remains in the workflow

🤖 Generated with Claude Code

kblok and others added 23 commits March 20, 2026 08:55
- Renamed all assemblies/namespaces from Microsoft.Playwright to PlaywrightSharp
- Added GitHub Actions CI/CD workflows (matrix testing, code style, NuGet publish)
- Migrated test framework from xUnit to NUnit 4.x
- Created PlaywrightSharp.Nunit project with PlaywrightTestAttribute

Closes #70, Closes #71

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Split HTTPS cert step into Linux/Windows variants (mkdir -p is bash-only)
- Run dotnet format to fix whitespace issues across test files
- Delete old workflows: docs.yml, nuget-package-tests.yml, nuget.yml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dotnet format in .NET 10 includes analyzer diagnostics (NUnit2007,
ASP0019, ASP0016, SA1600/SA1602) which cause --verify-no-changes to
exit with code 2 even when no actual formatting changes are needed.
Split into whitespace + style subcommands to check formatting without
failing on third-party analyzer warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename DefaultPuppeteerTimeout to DefaultContextTimeout and replace
PuppeteerSharp comments with PlaywrightSharp to pass the no-puppeteer
CI check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The --filter "Category=chromium/firefox" was an xUnit leftover. In the
NUnit migration, tests don't have [Category] attributes, so the filter
matched zero tests. The PRODUCT env variable already controls which
browser is used, and SkipBrowserAndPlatformFact handles skipping
incompatible browser tests at runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TestServerSetup was in PlaywrightSharp.Tests.BaseTests namespace but
tests are in PlaywrightSharp.Tests. NUnit SetUpFixture only applies to
its own namespace and children, so the fixture never ran for the actual
tests, causing NullReferenceException on Server.Reset().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The DriverDownloader was hardcoded to download to src/Playwright/Drivers
but the project was renamed to src/PlaywrightSharp/. Also added the
missing download-drivers step before build, which downloads the
Playwright driver binaries needed for the MSBuild targets to copy
drivers and install browsers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The old driver version (1.10.0) tries to download browser builds from
CDN URLs that return 400 (ubuntu-18.04 suffix, old revision numbers).
Added PlaywrightSkipBrowserInstall property to skip the MSBuild
InstallBrowsers target, and install browsers via npx playwright which
handles modern OS versions correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dotnet test was re-triggering MSBuild targets including InstallBrowsers
(without PlaywrightSkipBrowserInstall=true), causing browser download
failures. Since the build step already compiled everything, pass
--no-build to skip the redundant rebuild.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The 1.10.0-next driver uses placeholder revision 1234 for browser
paths (e.g. firefox-1234/) but npx playwright@1.10.0 install uses
real revisions. Create symlinks from *-1234 to the actual browser
directories so the driver can find them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Playwright 1.10.0's browser download CDN no longer serves old builds.
Use latest npx playwright install which has working CDN URLs, then
symlink to the revision-1234 paths the -next driver expects. Also
added ls -la for debugging browser directory state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The old driver expects specific browser revisions (chromium-857950,
firefox-1234) with old directory structures. Download the exact builds
from the Playwright CDN using the generic linux/win64 platform suffix
(the ubuntu-18.04 suffix is gone but linux.zip still works).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The -next driver has placeholder Firefox revision 1234 and old WebKit
revision 1443, neither of which have builds on the CDN. After
downloading drivers, patch browsers.json to use the 1.10.0 release
revisions (firefox=1238, webkit=1446) which have CDN builds.

Removes manual browser download hacks and PlaywrightSkipBrowserInstall
- the MSBuild targets now handle browser install naturally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add npx playwright install-deps to install system libraries needed by
browser builds (fixes "Host system is missing dependencies" on Linux).
Add IgnoreExitCode=true to browser install Exec targets to handle lock
file conflicts when multiple target frameworks install concurrently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add libdbus-glib-1-2 for old Firefox build. Add
IgnoreStandardErrorWarningFormat to Exec targets so MSBuild doesn't
treat stderr output from parallel browser installs as build errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove Firefox-on-Linux from matrix (old Firefox build compiled for
Ubuntu 18.04 crashes on Ubuntu 22.04+ runners). Firefox is still
tested on Windows.

Add continue-on-error to test steps so pre-existing test failures
don't block this infrastructure PR. Tests ARE running (812/1076 pass
on chromium-headless-ubuntu, 845/1076 on chromium-headless-windows).
Remove libdbus-glib-1-2 (no longer needed without Firefox on Linux).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tinue-on-error

Port the TestExpectation pattern from puppeteer-sharp so CI enforces green runs
instead of silently swallowing failures via continue-on-error: true.

- Add TestExpectation model with JSON-backed expectations (embedded resource)
- Implement ApplyToTest() in PlaywrightTestAttribute to mark matching tests as Ignored
- Add TestExpectations.local.json with 18 known-failing spec file patterns
- Add [Ignore] to NetworkPostDataTests.ShouldThrowOnInvalidJSONInPostData
- Remove continue-on-error: true from all CI test steps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…changes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The PlaywrightTestAttribute now includes headless/headful mode in the
parameters array (based on HEADLESS env var), enabling mode-specific
test expectations.

New expectations added for:
- tap.spec.ts, proxy.spec.ts, selectors-register.spec.ts (universal)
- workers.spec.ts (Windows-only)
- Firefox-specific failures (web-socket, page-route, page-keyboard, etc.)
- Headful-specific failures (23 spec files that timeout in headful CI)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- page-add-init-script, page-request-continue, page-route (headful)
- page-autowaiting-basic: change from firefox+headful to firefox-only

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kblok kblok merged commit 9aad9c0 into main Mar 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant