Skip to content

Commit 4f0db16

Browse files
authored
Add Geolocation method to browser testing page
1 parent 1444d52 commit 4f0db16

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
@@ -185,6 +185,15 @@ Sometimes, elements may take time to appear on the page. By default, Pest waits
185185
pest()->browser()->timeout(10);
186186
```
187187

188+
### Geolocation
189+
190+
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:
191+
192+
```php
193+
$page = visit('/')
194+
->geolocation(39.399872, -8.224454);
195+
```
196+
188197
## Table of Contents
189198

190199
### Available Assertions

0 commit comments

Comments
 (0)