Skip to content

Commit 3833f3a

Browse files
authored
Update browser-testing.md
1 parent 5320900 commit 3833f3a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

browser-testing.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,26 +186,28 @@ Sometimes, elements may take time to appear on the page. By default, Pest waits
186186
pest()->browser()->timeout(10);
187187
```
188188

189-
### Per-Test Overrides
189+
### Configuring Locale
190190

191-
In addition to configuring defaults globally, you can override settings per test using the following methods:
192-
193-
#### Setting Locale
191+
You can set the locale for your test requests using the `withLocale` method. This is particularly useful for testing multilingual applications.
194192

195193
```php
196194
$page = visit('/')->withLocale('fr-FR');
197195

198196
$page->assertSee('Bienvenue');
199197
```
200-
#### Setting Timezone
198+
### Configuring Timezone
199+
200+
You can set the timezone for your test requests using the `withTimezone` method. This is useful for testing date and time displays in different time zones.
201201

202202
```php
203203
$page = visit('/')->withTimezone('America/New_York');
204204

205205
$page->assertSee('EST');
206206
```
207207

208-
#### Setting UserAgent
208+
### Configuring UserAgent
209+
210+
You can set the User-Agent header for your test requests using the `withUserAgent` method. This is useful for testing how your application responds to different types of clients, such as mobile browsers or bots.
209211

210212
```php
211213
$page = visit('/')->withUserAgent('Googlebot');

0 commit comments

Comments
 (0)