Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explaining how to uncheck a pre-checked checkbox #6156

Merged
merged 1 commit into from
Apr 5, 2021

Conversation

ThomasLandauer
Copy link
Member

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)

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 Codeception#6063 (comment)
(More precisely: If the documentation isn't where the function is, then *two* links)
@Naktibalda
Copy link
Member

Isn't this just repeating that uncheckOption actually unchecks checkbox?

Is it a naming problem? Would it be better to rename uncheckOption to uncheckCheckbox?

@ThomasLandauer
Copy link
Member Author

Well, let's look at this from the very beginning: Codeception has two ways to submit a form (right?):

  • The "human" way: fillField, selectOption, etc., then click the submit button
  • The "machine" way: submitForm and pass all values you want

The problem is that this unchecking scenario is the only (?) one where you need to mix those two ways.

So the (to me) perfect solution would be: Change submitForm so that it just submits what you pass in the array. I.e. do not submit "2" for the "plan" field in the example at https://codeception.com/docs/modules/Symfony#submitForm
Cause when I want to use what's on the page, I can just click. And if I want to test "fake/spam/whatever" submissions, I don't care what's on the page (even worse: If I don't fully understand this concept, some pre-set values might compromise my tests, in that they submit stuff I didn't think about).

Well, but changing submitForm would be a BC break...

And, yes, renaming uncheckOption to uncheckCheckbox is a good idea in any case! "Option" is an ambiguous term - e.g. selectOption refers to <select> and radio: https://codeception.com/docs/modules/Symfony#selectOption But checkbox is checkbox is checkbox :-)

@Naktibalda Naktibalda merged commit 76ed781 into Codeception:4.1 Apr 5, 2021
@ThomasLandauer ThomasLandauer deleted the patch-11 branch April 5, 2021 18:58
ThomasLandauer added a commit to ThomasLandauer/lib-innerbrowser that referenced this pull request Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants