Skip to content

Commit ebc0606

Browse files
authored
Merge pull request #322 from nexxai/4.x
[4.x] Add Geolocation method to browser testing page
2 parents 8dc42bc + 4f0db16 commit ebc0606

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

browser-testing.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ You may wish to override the User Agent of the browser for all of your tests, yo
196196
pest()->browser()->userAgent('CustomUserAgent');
197197
```
198198

199+
### Geolocation
200+
201+
Sometimes, you need to define where the browser believes it is physically on the earth. This method takes a latitude and longitude and will set the `geolocation` permission in the browser and then make the coordinates available via Javascript's getCurrentPosition API:
202+
203+
```php
204+
$page = visit('/')
205+
->geolocation(39.399872, -8.224454);
206+
```
207+
199208
## Table of Contents
200209

201210
### Available Assertions

0 commit comments

Comments
 (0)