Skip to content

Conversation

@smnandre
Copy link
Member

Introducing a custom AssertionException and a new ExpectDecorator class to decouple from and still be compatible with PHPUnit.

Assertion Counting Integration:

  • Replaced all usages of PHPUnit\Framework\AssertionFailedError with Playwright\Assertions\Failure\AssertionException in Expectation.php and Expect.php
  • Added a new ExpectDecorator class that wraps the Expect class and automatically increments PHPUnit assertion count when available
  • Updated the expect() method in PlaywrightTestCaseTrait to return an instance of ExpectDecorator instead of Expect

@codecov
Copy link

codecov bot commented Dec 20, 2025

Codecov Report

❌ Patch coverage is 0% with 80 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Testing/ExpectDecorator.php 0.00% 71 Missing ⚠️
src/Testing/Assert/Expectation.php 0.00% 4 Missing ⚠️
src/Testing/Expect.php 0.00% 4 Missing ⚠️
src/Testing/PlaywrightTestCaseTrait.php 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@smnandre smnandre merged commit 204ed13 into playwright-php:main Dec 20, 2025
9 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