Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 13 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ jobs:
uses: playwright-php/.github/.github/workflows/SA.yml@main

tests:
name: Tests (PHP ${{ matrix.php }}, Behat ${{ matrix.behat }})
name: Tests (PHP ${{ matrix.php }}, Behat ${{ matrix.behat }}, ${{ matrix.dependencies }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
behat: ['^3.23']
dependencies: ['highest']
include:
- php: '8.2'
behat: '^3.23'
dependencies: 'lowest'
- php: '8.4'
behat: '^3.33'
behat: '4.0.0-alpha1'
dependencies: 'highest'

steps:
- uses: actions/checkout@v4
Expand All @@ -53,7 +58,11 @@ jobs:
- name: Install PHP deps
run: |
composer require "behat/behat:${{ matrix.behat }}" --no-update --no-interaction
composer update --no-interaction --prefer-dist --no-progress
if [ "${{ matrix.dependencies }}" = "lowest" ]; then
composer update --prefer-lowest --no-interaction --prefer-dist --no-progress
else
composer update --no-interaction --prefer-dist --no-progress
fi

- name: Cache Playwright browsers
uses: actions/cache@v4
Expand All @@ -72,6 +81,6 @@ jobs:
if: failure()
uses: actions/upload-artifact@v4
with:
name: screenshots-php${{ matrix.php }}
name: screenshots-php${{ matrix.php }}-behat${{ matrix.behat }}-${{ matrix.dependencies }}
path: tests/Fixtures/var/screenshots/
if-no-files-found: ignore
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
"require": {
"php": "^8.2",
"behat/behat": "^3.23",
"playwright-php/playwright": "^1.4"
"playwright-php/playwright": "^1.4",
"symfony/config": "^5.4 || ^6.4 || ^7.0 || ^8.0",
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0 || ^8.0",
"symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0 || ^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.40",
Expand Down
35 changes: 35 additions & 0 deletions tests/Fixtures/behat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

/*
* This file is part of the community-maintained Playwright PHP project.
* It is not affiliated with or endorsed by Microsoft.
*
* (c) 2025-Present - Playwright PHP - https://github.com/playwright-php
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Behat\Config\Config;
use Behat\Config\Extension;
use Behat\Config\Profile;
use Behat\Config\Suite;
use Playwright\Behat\Context\PlaywrightContext;
use Playwright\Behat\ServiceContainer\PlaywrightExtension;

// The same file works on Behat 3.x and 4.x; YAML configuration is gone in 4.0.
return (new Config())
->withProfile((new Profile('default'))
->withExtension(new Extension(PlaywrightExtension::class, [
'base_url' => 'http://127.0.0.1:8971',
'screenshot_dir' => '%paths.base%/var/screenshots',
]))
->withSuite((new Suite('passing'))
->withPaths('%paths.base%/features/passing')
->withContexts(PlaywrightContext::class))
->withSuite((new Suite('failing'))
->withPaths('%paths.base%/features/failing')
->withContexts(PlaywrightContext::class))
);
14 changes: 0 additions & 14 deletions tests/Fixtures/behat.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Integration/BehatRunTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private function runBehat(string $suite): Process
$process = new Process([
PHP_BINARY,
__DIR__.'/../../vendor/bin/behat',
'--config', __DIR__.'/../Fixtures/behat.yml',
'--config', __DIR__.'/../Fixtures/behat.php',
'--suite', $suite,
'--format', 'progress',
'--no-colors',
Expand Down
Loading