@saucebase/laravel-playwright 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -105,7 +105,7 @@ This writes a copy of your `.env` with its own server and database. Laravel load
|
|
|
105
105
|
APP_ENV=e2e
|
|
106
106
|
APP_URL=http://localhost:8100
|
|
107
107
|
DB_CONNECTION=sqlite
|
|
108
|
-
DB_URL=
|
|
108
|
+
DB_URL="sqlite:///database/e2e.sqlite?transaction_mode=IMMEDIATE&busy_timeout=10000"
|
|
109
109
|
DB_DATABASE=database/e2e.sqlite
|
|
110
110
|
SESSION_DRIVER=file
|
|
111
111
|
CACHE_STORE=file
|
|
@@ -114,7 +114,27 @@ MAIL_MAILER=log
|
|
|
114
114
|
REDIS_PREFIX=<your prefix>e2e_
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
`DB_URL` carries the SQLite settings that let parallel workers wait for each other. `transaction_mode=IMMEDIATE` needs PHP 8.4 or later; older versions ignore it, so read-then-write transactions can still hit `database is locked`. `busy_timeout` applies on every version.
|
|
118
|
+
|
|
119
|
+
To change a value, set it in `.env` with an `E2E_` prefix. It wins over the defaults above and is copied as written, with any `${VARIABLE}` resolved. The prefix follows the environment: `playwright:env browser` reads `BROWSER_*`.
|
|
120
|
+
|
|
121
|
+
```dotenv
|
|
122
|
+
E2E_MAIL_MAILER=smtp
|
|
123
|
+
|
|
124
|
+
# A real database, e.g. MySQL in Docker. Create it first.
|
|
125
|
+
E2E_DB_CONNECTION=mysql
|
|
126
|
+
E2E_DB_HOST=127.0.0.1
|
|
127
|
+
E2E_DB_PORT=3307
|
|
128
|
+
E2E_DB_DATABASE=${APP_SLUG}_e2e
|
|
129
|
+
E2E_DB_USERNAME=root
|
|
130
|
+
E2E_DB_PASSWORD=password
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**The suite wipes this database**, so the command refuses one that is also the app's. On SQLite, `E2E_DB_DATABASE` keeps the lock settings. `E2E_DB_URL` is used exactly as written, so include them yourself or parallel workers can hit `database is locked`.
|
|
134
|
+
|
|
135
|
+
If the file exists, the command asks whether to back it up and replace it, replace it, or keep it. `--backup` and `--force` answer without asking, and an unattended run without either keeps the file. The backup is `.env.e2e.backup`, replaced by the next one. It holds your secrets, so keep it out of git too.
|
|
136
|
+
|
|
137
|
+
Options: `php artisan playwright:env <environment> --url=http://localhost:9000`. Edit the file afterwards for anything else the suite needs. Keep `.env.e2e` out of git like `.env`, and in CI, run the command after creating `.env`.
|
|
118
138
|
|
|
119
139
|
**2. Let Playwright start the server:**
|
|
120
140
|
|
package/package.json
CHANGED