Skip to content

Commit

Permalink
Explaining how to uncheck a pre-checked checkbox for submitForm
Browse files Browse the repository at this point in the history
Sounds like a tongue twister ... ;-)

I was expecting this text to be in https://github.com/Codeception/lib-innerbrowser/blob/master/src/Codeception/Lib/InnerBrowser.php#L941 - while in fact it's even in another module! So, again, a link at each function to get to its source code would really be nice - see #6063 (comment)
(More precisely: If the documentation isn't where the function is, then *two* links)
  • Loading branch information
ThomasLandauer committed Apr 5, 2021
1 parent d8b16e1 commit 76ed781
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Codeception/Lib/Interfaces/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,15 @@ public function dontSeeInSource($raw);
* For example, given this sample "Sign Up" form:
*
* ``` html
* <form action="/sign_up">
* <form id="userForm">
* Login:
* <input type="text" name="user[login]" /><br/>
* Password:
* <input type="password" name="user[password]" /><br/>
* Do you agree to our terms?
* <input type="checkbox" name="user[agree]" /><br/>
* Subscribe to our newsletter?
* <input type="checkbox" name="user[newsletter]" value="1" checked="checked" /><br/>
* Select pricing plan:
* <select name="plan">
* <option value="1">Free</option>
Expand Down Expand Up @@ -188,6 +190,9 @@ public function dontSeeInSource($raw);
* Note that "2" will be the submitted value for the "plan" field, as it is
* the selected option.
*
* To uncheck the pre-checked checkbox "newsletter", call `$I->uncheckOption(['name' => 'user[newsletter]']);` *before*,
* then submit the form as shown here (i.e. without the "newsletter" field in the `$params` array).
*
* You can also emulate a JavaScript submission by not specifying any
* buttons in the third parameter to submitForm.
*
Expand Down

0 comments on commit 76ed781

Please sign in to comment.