-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
PhpBrowser's submitForm() is not submitting empty $button correctly #4477
Copy link
Copy link
Open
Description
When submitting a form as shown in the example at http://codeception.com/docs/modules/PhpBrowser#submitForm
$I->submitForm(
'#userForm',
[
'user' => [
'login' => 'Davert',
'password' => '123456',
'agree' => true
]
],
'submitButton'
);... the submitButton gets submitted as "submitButton":null. (This is probably due to the fact that I'm using a <button> rather than an <input type="submit"> - so the button itself doesn't have a value.) The problem is that now Symfony doesn't recognize the button as being clicked, since it expects different data (which is how real browsers do it): "submitButton":"".
So I would suggest:
- Either accept an array as the
$buttonparameter ofsubmitForm()like this:array('submitButton'=>'') - Or (preferably): If the element doesn't have a value, just submit the empty string
''instead ofnull
Details
- Codeception version: 2.3.5
- PHP Version: 7.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels