diff --git a/browser-testing.md b/browser-testing.md index 3720d8c..224736e 100644 --- a/browser-testing.md +++ b/browser-testing.md @@ -186,6 +186,35 @@ Sometimes, elements may take time to appear on the page. By default, Pest waits pest()->browser()->timeout(10); ``` +### Configuring Locale + +You can set the locale for your test requests using the `withLocale` method. This is particularly useful for testing multilingual applications. + +```php +$page = visit('/')->withLocale('fr-FR'); + +$page->assertSee('Bienvenue'); +``` +### Configuring Timezone + +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. + +```php +$page = visit('/')->withTimezone('America/New_York'); + +$page->assertSee('EST'); +``` + +### Configuring UserAgent + +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. + +```php +$page = visit('/')->withUserAgent('Googlebot'); + +$page->assertSee('Welcome, bot!'); +``` + ## Table of Contents ### Available Assertions