-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Many tests, such as \Behat\Mink\Tests\Driver\Form\Html5Test::testHtml5FormInputAttribute, seem to guard against the possibility of asserting things after a form is submitted, but before the next page is loaded.
Some other tests, notably* \Behat\Mink\Tests\Driver\Form\GeneralTest::testSubmitEmptyTextarea seem to assume the opposite - after a button is submitted, the fully-loaded page is expected.
Which case should it be?
- should
pressButton(and similar) detect submission and wait for the page to load? - should methods in general wait for the page to be fully loaded?
- or is that specific methods - such as
page->getContent()are supposed to block until page load?
*after many tries, I managed to get that test to fail locally with the following error:
Failed asserting that '<html lang="en"><head>\n
<title>Empty textarea submission</title>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n
</head>\n
<body>\n
<h1>Empty textarea submission</h1>\n
<form method="POST" action="advanced_form_post.php">\n
<textarea name="textarea"></textarea>\n
<input type="submit" name="submit" value="Save">\n
</form>\n
\n
\n
</body></html>' contains "textarea = ``,".
but the following screenshot:
which seems to prove that the test checked the content of the previous page instead of the submit result page.