Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# CHANGELOG

## [Unreleased]
## [1.0.0] - 2025-11-08

### Added
- Initial stable release of Playwright PHP
- Cross-browser support (Chromium, Firefox, WebKit)
- PHPUnit integration with fluent assertions
- Auto-waiting locators and interactions
- Screenshot and tracing capabilities
- Storage state management

### Changed
- Marked package as stable (removed experimental warning)
- Added PHPUnit 10+ requirement documentation for testing trait

### Fixed
- PHPUnit compatibility: Added check for `status()` method availability to support PHPUnit 10+ (#9)

9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@

# Playwright PHP - Modern Browser Automation

> [!IMPORTANT]
> This package is **experimental**. Its API may still change before the upcoming `1.0` release.
>
> Curious or interested? Try it out, [share your feedback](https://github.com/playwright-php/playwright/issues), or ideas!


## About

Playwright for PHP lets you launch real browsers (Chromium, Firefox, WebKit), drive pages and locators, and write reliable end‑to‑end tests — all from PHP.
Expand Down Expand Up @@ -136,6 +129,8 @@ $ctx = Playwright::chromium([

The package provides a testing trait and fluent `expect()` assertions to write robust E2E tests.

**Requirements**: PHPUnit 10.0 or higher is required to use the `PlaywrightTestCaseTrait`.

Minimal example:

```php
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
"symfony/console": "^6.4 || ^7.3 || ^8.0",
"symfony/process": "^6.4 || ^7.3 || ^8.0"
},
"suggest": {
"phpunit/phpunit": "^10.0 || ^11.0 || ^12.0 - Required for using the PHPUnit integration (PlaywrightTestCaseTrait)"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.40",
"monolog/monolog": "^3.9",
Expand Down Expand Up @@ -66,7 +69,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "0.x-dev"
"dev-main": "1.x-dev"
}
},
"bin": [
Expand Down
10 changes: 6 additions & 4 deletions src/Testing/PlaywrightTestCaseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ protected function setUpPlaywright(?LoggerInterface $logger = null, ?PlaywrightC

protected function tearDownPlaywright(): void
{
$status = $this->status();
if (method_exists($this, 'status')) {
$status = $this->status();

if ($status->isFailure() || $status->isError()) {
$testName = method_exists($this, 'getName') && is_string($this->getName()) ? $this->getName() : 'test';
$this->captureFailureArtifacts($testName);
if ($status->isFailure() || $status->isError()) {
$testName = method_exists($this, 'getName') && is_string($this->getName()) ? $this->getName() : 'test';
$this->captureFailureArtifacts($testName);
}
}

$this->safeClose($this->context);
Expand Down
Loading