Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Few more possible regular expressions to check checkbox is checked #57

Merged
merged 2 commits into from

3 participants

@kssundar

I added a couple of regular expressions that helps the user to check if a checkbox is checked or not on a page.

Committed here - de37a1a

Is it worth?

src/Behat/MinkExtension/Context/MinkContext.php
@@ -381,6 +383,9 @@ public function assertCheckboxChecked($checkbox)
* Checks, that checkbox with specified in|name|label|value is unchecked.
*
* @Then /^the "(?P<checkbox>(?:[^"]|\\")*)" checkbox should not be checked$/
+ * @Then /^I (?:|should )see the checkbox "(?P<checkbox>(?:[^"]|\\")*)" (?:is not checked|is unchecked)$/
@stof Owner
stof added a note

This does not look like an English sentence. you have 2 verbs

Right. The we can remove "I should see .... " from the above regular expression and keep the rest.??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@stof
Owner

And the trait should be kept in sync with the class

@kssundar

Could you please point it out at one example here? I am not able to figure out the trait. :)

(Sundar is new here and is trying to learn new stuff on git as much as possible. Please excuse.)

@stof
Owner

you have to update this file to keep the same step definitions

@kssundar

I have updated as suggested and the commit is done here - b6df191

I above commit is on top of my previous commit de37a1a. Is this fine or should I do fork it again and commit with only the new changes?

@everzet everzet merged commit 523f2e7 into Behat:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 11, 2012
  1. @kssundar

    by kssundar: Added few more possible regular expression to check whet…

    kssundar authored
    …her a checkbox is checked.
Commits on Dec 13, 2012
  1. @kssundar

    by kssundar: Updated regular expression to remove 2 verbs and updated…

    kssundar authored
    … trait to be in sync with minkcontext.
This page is out of date. Refresh to see the latest.
View
3  src/Behat/MinkExtension/Context/MinkContext.php
@@ -371,6 +371,7 @@ public function assertFieldNotContains($field, $value)
* Checks, that checkbox with specified in|name|label|value is checked.
*
* @Then /^the "(?P<checkbox>(?:[^"]|\\")*)" checkbox should be checked$/
+ * @Then /^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" (?:is|should be) checked$/
*/
public function assertCheckboxChecked($checkbox)
{
@@ -381,6 +382,8 @@ public function assertCheckboxChecked($checkbox)
* Checks, that checkbox with specified in|name|label|value is unchecked.
*
* @Then /^the "(?P<checkbox>(?:[^"]|\\")*)" checkbox should not be checked$/
+ * @Then /^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" should (?:be unchecked|not be checked)$/
+ * @Then /^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" is (?:unchecked|not checked)$/
*/
public function assertCheckboxNotChecked($checkbox)
{
View
3  src/Behat/MinkExtension/Context/MinkDictionary.php
@@ -437,6 +437,7 @@ public function assertFieldNotContains($field, $value)
* Checks, that checkbox with specified in|name|label|value is checked.
*
* @Then /^the "(?P<checkbox>(?:[^"]|\\")*)" checkbox should be checked$/
+ * @Then /^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" (?:is|should be) checked$/
*/
public function assertCheckboxChecked($checkbox)
{
@@ -447,6 +448,8 @@ public function assertCheckboxChecked($checkbox)
* Checks, that checkbox with specified in|name|label|value is unchecked.
*
* @Then /^the "(?P<checkbox>(?:[^"]|\\")*)" checkbox should not be checked$/
+ * @Then /^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" should (?:be unchecked|not be checked)$/
+ * @Then /^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" is (?:unchecked|not checked)$/
*/
public function assertCheckboxNotChecked($checkbox)
{
Something went wrong with that request. Please try again.