You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@
10
10
# Setup Playwright (for PHP)
11
11
12
12
Sets up the runner for [Playwright for PHP](https://playwright-php.dev):
13
-
- install `@playwright` JS library globally
13
+
- install Playwright library globally
14
14
- download the browser binaries (default: Chrome)
15
15
16
16
## Usage
@@ -36,6 +36,36 @@ jobs:
36
36
- run: vendor/bin/phpunit
37
37
```
38
38
39
+
## Examples
40
+
41
+
### Install multiple browsers
42
+
```yaml
43
+
- uses: playwright-php/setup-playwright@v1
44
+
with:
45
+
browsers: '["chromium","firefox"]'
46
+
```
47
+
48
+
### Reuse cached browser downloads
49
+
```yaml
50
+
- uses: actions/cache@v4
51
+
with:
52
+
path: ~/.cache/ms-playwright
53
+
key: browsers-${{ runner.os }}
54
+
55
+
- uses: playwright-php/setup-playwright@v1
56
+
with:
57
+
browsers-path: ~/.cache/ms-playwright
58
+
```
59
+
60
+
### Pin the Playwright CLI version and skip deps
61
+
```yaml
62
+
- uses: playwright-php/setup-playwright@v1
63
+
with:
64
+
playwright-version: '1.48.2'
65
+
browsers: webkit
66
+
with-deps: false
67
+
```
68
+
39
69
## Outputs
40
70
41
71
The action exposes two outputs:
@@ -52,6 +82,12 @@ The action exposes two outputs:
52
82
| `with-deps` | `auto` | `true`, `false`, `auto` | `auto` appends Playwright's `--with-deps` flag on Linux runners. |
53
83
| `browsers-path` | | Directory path | Exports `PLAYWRIGHT_BROWSERS_PATH` so downloads land in your cache. Leave blank for Playwright defaults (`~/.cache/ms-playwright`, `%LOCALAPPDATA%\ms-playwright`, etc.) |
54
84
85
+
## Testing the action
86
+
87
+
1. Trigger `.github/workflows/test.yml` via `workflow_dispatch` to exercise the action on hosted runners.
88
+
2. Run the same workflow with [`act`](https://github.com/nektos/act) to catch issues locally before pushing.
89
+
3. In a scratch repo, reference the action with `uses: ./` so every commit is validated before tagging a Marketplace release.
90
+
55
91
## License
56
92
57
93
This package is released by the [Playwright PHP](https://playwright-php.dev)
0 commit comments