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
@@ -911,6 +921,16 @@ The `type` method types the given value in the given field:
911
921
$page->type('email', 'test@example.com');
912
922
```
913
923
924
+
<aname="type-slowly"></a>
925
+
926
+
### typeSlowly
927
+
928
+
The `typeSlowly` method types the given value in the given field slowly, like a user:
929
+
930
+
```php
931
+
$page->typeSlowly('email', 'test@example.com');
932
+
```
933
+
914
934
<aname="select"></a>
915
935
### select
916
936
@@ -1031,6 +1051,31 @@ The `value` method gets the value of the element matching the given selector:
1031
1051
$value = $page->value('input[name=email]');
1032
1052
```
1033
1053
1054
+
<aname="with-in-iframe"></a>
1055
+
1056
+
### withinIframe
1057
+
1058
+
The `withinIframe` method allows you to interact with elements inside an iframe:
1059
+
1060
+
```php
1061
+
use Pest\Browser\Api\PendingAwaitablePage;
1062
+
1063
+
$page->withinIframe('.iframe-container', function (PendingAwaitablePage $page) {
1064
+
$page->type('frame-input', 'Hello iframe')
1065
+
->click('frame-button');
1066
+
});
1067
+
```
1068
+
1069
+
<aname="resize"></a>
1070
+
1071
+
### resize
1072
+
1073
+
You may use the resize method to adjust the size of the browser window:
1074
+
1075
+
```php
1076
+
$page->resize(1280, 720);
1077
+
```
1078
+
1034
1079
<aname="script"></a>
1035
1080
### script
1036
1081
@@ -1094,12 +1139,21 @@ $page->debug();
1094
1139
<aname="screenshot"></a>
1095
1140
You can also take a screenshot of the current page using the `screenshot()` method. This is useful for visual debugging:
1096
1141
1142
+
NOTE: If you don't pass the filename, it will use the test name as the filename.
1143
+
1097
1144
```php
1098
1145
$page->screenshot();
1099
1146
$page->screenshot(fullPage: true);
1100
1147
$page->screenshot(filename: 'custom-name');
1101
1148
```
1102
1149
1150
+
<aname="screenshotElement"></a>
1151
+
You can also take a screenshot of a specific element using the `screenshotElement()` method:
1152
+
1153
+
```php
1154
+
$page->screenshotElement('#my-element');
1155
+
```
1156
+
1103
1157
<aname="tinker"></a>
1104
1158
You can also use the `tinker()` method to open a Tinker session in the context of the current page. This allows you to interact with the page using PHP code:
0 commit comments