Skip to content

Commit 988577d

Browse files
authored
Update form-submit.php
1 parent 46e75f3 commit 988577d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/form-submit.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
$page->navigate('file://' . __DIR__ . '/html/form.html')->waitForNavigation();
1414

1515
// put 'hello' in the input and submit the form
16-
$page->evaluate(
16+
$evaluation = $page->evaluate(
1717
'(() => {
1818
document.querySelector("#myinput").value = "hello";
1919
document.querySelector("#myform").submit();
2020
})()'
21-
)->waitForPageReload();
21+
);
22+
23+
// wait for the page to be reloaded
24+
$evaluation->waitForPageReload();
2225

2326
// get value in the new page
2427
$value = $page->evaluate('document.querySelector("#value").innerHTML')->getReturnValue();

0 commit comments

Comments
 (0)