Skip to content

Commit ffce7f1

Browse files
authored
Merge pull request #337 from jackbayliss/per-test-overrides
[4.x] Add per test override section
2 parents 368b9e5 + 3833f3a commit ffce7f1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

browser-testing.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,35 @@ $page = visit('/')
205205
->geolocation(39.399872, -8.224454);
206206
```
207207

208+
### Configuring Locale
209+
210+
You can set the locale for your test requests using the `withLocale` method. This is particularly useful for testing multilingual applications.
211+
212+
```php
213+
$page = visit('/')->withLocale('fr-FR');
214+
215+
$page->assertSee('Bienvenue');
216+
```
217+
### Configuring Timezone
218+
219+
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.
220+
221+
```php
222+
$page = visit('/')->withTimezone('America/New_York');
223+
224+
$page->assertSee('EST');
225+
```
226+
227+
### Configuring UserAgent
228+
229+
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.
230+
231+
```php
232+
$page = visit('/')->withUserAgent('Googlebot');
233+
234+
$page->assertSee('Welcome, bot!');
235+
```
236+
208237
## Table of Contents
209238

210239
### Available Assertions

0 commit comments

Comments
 (0)