minkphp / minkphp/driver-testsuite

Strict value type check for checkboxes makes filling fields from tables difficult

Open
#104 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
8
Forks
29
Avg merge
22h 21m
Merged PRs (30d)
2

Description

The strict check added in #102 requires checkboxes to be set with boolean values only.

That makes it difficult to fill forms from Gherkin tables, since there is – to my knowledge – no built-in type conversion, and one cannot simply forward all values to MinkContext::fillFields anymore.

https://github.com/FriendsOfBehat/MinkExtension/blob/a9653d777beeb1dca4931a673c6a54bb2dd6ddf8/src/Behat/MinkExtension/Context/MinkContext.php#L142

Example:

    And I fill in the following:
      | Published                         | 1                  |
      | Name                              | Behat meet-up test |

I am not sure which is the right way to address it... Relax the requirement here? Detect checkbox types in MinkContext and cast the value appropriately? Not use the "fill in the following" step definition for checkboxes anymore?

Technically, this testsuite here did not change anything directly breaking the old code, but it triggered downstream changes like https://gitlab.com/behat-chrome/chrome-mink-driver/-/issues/158 that cause the issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining MinkContext::fillFields at the linked line and the strict checkbox validation introduced in #102. Reproduce the Gherkin table example with Published set to 1, then establish and test the intended behavior for table-supplied checkbox values without weakening the direct boolean check.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.