Skip to content

Commit f2fd7e0

Browse files
authored
Merge pull request #338 from jackbayliss/user-agent-config
[4.x] Add how to configure user agent globally
2 parents 4ad44d8 + 30e3c9e commit f2fd7e0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

browser-testing.md

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

189+
### Configuring User Agent
190+
191+
By default, the User Agent will default to the Browser you're running for tests such as: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/133.0.6943.16 Safari/537.36`
192+
193+
You may wish to override the User Agent of the browser for all of your tests, you can configure this in the `Pest.php` configuration file:
194+
195+
```php
196+
pest()->browser()->userAgent('CustomUserAgent');
197+
```
198+
189199
## Table of Contents
190200

191201
### Available Assertions

0 commit comments

Comments
 (0)