Should submitting a form via pressButton wait for page load?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start with the named tests, especially Form\Html5Test::testHtml5FormInputAttribute and Form\GeneralTest::testSubmitEmptyTextarea, then inspect the pressButton and page->getContent() entry points. Compare when each test observes navigation and determine the intended loading contract. Done means the relevant tests consistently verify that contract without reading the previous page.
Written by the indexing model from the issue text.
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.
- Dominant language
- PHP
- Stars
- 8
- Forks
- 29
- Avg merge
- 22h 21m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from minkphp/driver-testsuite
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
minkphp/driver-testsuite#109 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
minkphp/driver-testsuite#104 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
minkphp/driver-testsuite#94 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
minkphp/driver-testsuite#92 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
minkphp/driver-testsuite#89 · 1 reaction ·
All issues in minkphp/driver-testsuite
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100