You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, elements may take time to appear on the page. By default, Pest waits for `5` seconds before timing out. You can configure the default timeout for browser tests in your `Pest.php` configuration file:
183
+
184
+
```php
185
+
pest()->browser()->timeout(10);
186
+
```
187
+
167
188
## Table of Contents
168
189
169
190
### Available Assertions
@@ -1013,7 +1034,13 @@ $page->waitForKey(); // Useful for debugging
1013
1034
## Debugging tests
1014
1035
1015
1036
<aname="debug"></a>
1016
-
Sometimes you may want to debug your browser tests. Pest provides a convenient way to do this by using the `debug()` method, which focus Pest only on the current test and allows you to inspect the page state:
1037
+
Sometimes you may want to debug your browser tests. Pest provides a convenient way to do this by using the `--debug` option, which makes pest to open the browser window and pause the execution of the test when it fails. You can then inspect the page and see what went wrong.
1038
+
1039
+
```bash
1040
+
./vendor/bin/pest --debug
1041
+
```
1042
+
1043
+
Optionally, you can also use the `debug()` method in your test to pause the execution and open the browser window:
1017
1044
1018
1045
```php
1019
1046
$page->debug();
@@ -1042,6 +1069,12 @@ After you can run your tests with the `--headed` option to open the browser wind
1042
1069
./vendor/bin/pest --headed
1043
1070
```
1044
1071
1072
+
If you wish to run the tests in a headed mode by default, you can set it in your `Pest.php` configuration file:
1073
+
1074
+
```php
1075
+
pest()->browser()->headed();
1076
+
```
1077
+
1045
1078
## Continuous Integration
1046
1079
1047
1080
You may refer to Pest's [Continuous Integration](https://pestphp.com/docs/continuous-integration) documentation for more information on how to run your browser tests in a CI environment.
0 commit comments