Skip to content

Commit 4b355f5

Browse files
committed
Rework Driver tests
1 parent b5c2f4a commit 4b355f5

File tree

6 files changed

+512
-267
lines changed

6 files changed

+512
-267
lines changed

.github/workflows/ci.yml renamed to .github/workflows/CI.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
php-version: '8.4'
2222
coverage: none
23-
tools: composer
23+
tools: composer, phpstan, php-cs-fixer
2424

2525
- name: Composer cache
2626
uses: actions/cache@v4
@@ -33,12 +33,12 @@ jobs:
3333
run: composer install --no-interaction --prefer-dist --no-progress
3434

3535
- name: PHPStan (max level)
36-
run: vendor/bin/phpstan analyse --no-progress
36+
run: phpstan analyse --no-progress
3737

3838
- name: PHP-CS-Fixer (dry-run)
3939
run: |
4040
if [ -f .php-cs-fixer.php ]; then
41-
vendor/bin/php-cs-fixer fix --diff --dry-run
41+
php-cs-fixer fix --diff --dry-run
4242
else
4343
echo "No .php-cs-fixer.php; skipping."
4444
fi
@@ -80,14 +80,44 @@ jobs:
8080
uses: actions/setup-node@v4
8181
with:
8282
node-version: '22'
83-
cache: 'npm'
8483

85-
- name: Install Playwright (${{ matrix.browser }})
86-
run: npx playwright install --with-deps ${{ matrix.browser }}
84+
- name: Cache Playwright browsers
85+
uses: actions/cache@v4
86+
with:
87+
path: ~/.cache/ms-playwright
88+
key: ms-playwright-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
89+
restore-keys: ms-playwright-${{ runner.os }}-
90+
91+
- name: Install Playwright (browsers + system deps)
92+
run: vendor/bin/playwright-install --with-deps
8793

8894
- name: Start Mink test server
8995
run: vendor/bin/mink-test-server > mink-test-server.log 2>&1 &
9096
shell: bash
9197

98+
- name: Wait for Mink test server to be ready
99+
run: |
100+
for i in {1..60}; do
101+
if curl -fsS http://127.0.0.1:8002/ >/dev/null; then
102+
echo "Mink test server is up"; exit 0;
103+
fi
104+
sleep 1;
105+
done
106+
echo "Mink test server did not become ready in time"; exit 1
107+
92108
- name: PHPUnit (Mink driver testsuite)
93109
run: vendor/bin/phpunit --colors=always
110+
111+
- name: Show Mink server log on failure
112+
if: failure()
113+
run: |
114+
echo "==== mink-test-server.log ===="
115+
tail -n +1 mink-test-server.log || true
116+
117+
- name: Upload Mink server log artifact
118+
if: failure()
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: mink-test-server-log-${{ matrix.php }}-${{ matrix.browser }}
122+
path: mink-test-server.log
123+
if-no-files-found: ignore

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212

1313
A [Mink](https://mink.behat.org/) driver powered by **[Playwright PHP](https://github.com/playwright-php)**.
1414

15+
16+
> [!IMPORTANT]
17+
> This package is **experimental**. Its API may still change before the upcoming `1.0` release.
18+
>
19+
> Curious or interested? Try it out, [share your feedback](https://github.com/playwright-php/playwright-mink/issues), or ideas!
20+
21+
1522
## Features
1623

1724
- Run real browsers: Chromium, Firefox, WebKit (headless or not)
@@ -22,7 +29,7 @@ A [Mink](https://mink.behat.org/) driver powered by **[Playwright PHP](https://g
2229

2330
**Requirements**
2431

25-
- PHP 8.3 or higher
32+
- PHP 8.2 or higher
2633
- [Playwright PHP](https://github.com/playwright-php/playwright)
2734

2835
**Install the driver**
@@ -52,6 +59,8 @@ $session->stop();
5259

5360
This driver is validated against the official [`minkphp/driver-testsuite`](https://github.com/minkphp/driver-testsuite).
5461

62+
**Test Results**: 212/218 tests passing (97.2%) with 491 assertions
63+
5564
**Start the test server**
5665

5766
```bash
@@ -64,6 +73,13 @@ vendor/bin/mink-test-server
6473
vendor/bin/phpunit
6574
```
6675

76+
### Known Limitations
77+
78+
6 tests are skipped due to known limitations:
79+
80+
- **jQuery UI Drag & Drop** (2 tests): jQuery UI uses mouse events API, Playwright uses HTML5 Drag & Drop API - these are incompatible
81+
- **Popup Window Tracking** (4 tests): Async event timing with `window.open()` requires improvements in Playwright PHP event handling
82+
6783
## License
6884

6985
This package is released by the [Playwright PHP](https://playwright-php.dev)

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"license": "MIT",
55
"type": "library",
66
"keywords": [
7-
"php",
87
"mink",
98
"mink-driver",
109
"browser",
1110
"behat",
11+
"behat-driver",
1212
"mink-extension",
1313
"playwright-php",
1414
"playwright"
@@ -28,8 +28,7 @@
2828
"require": {
2929
"php": "^8.2",
3030
"behat/mink": "^1.10",
31-
"playwright-php/playwright": "dev-main",
32-
"symfony/clock": "^7.3 || ^8.0"
31+
"playwright-php/playwright": "dev-main"
3332
},
3433
"require-dev": {
3534
"mink/driver-testsuite": "dev-master",
@@ -46,6 +45,9 @@
4645
}
4746
},
4847
"extra": {
48+
"branch-alias": {
49+
"dev-main": "0.x-dev"
50+
},
4951
"thanks": {
5052
"name": "playwright-php/playwright",
5153
"url": "https://github.com/playwright-php/playwright"

0 commit comments

Comments
 (0)