Skip to content

Instantly share code, notes, and snippets.

@jmolivas
Last active December 12, 2015 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmolivas/4733870 to your computer and use it in GitHub Desktop.
Save jmolivas/4733870 to your computer and use it in GitHub Desktop.
Behat Mink check vs click
/**
* @When /^I click "([^"]*)"$/
*/
public function iClick($selector)
{
$element = $this->getSession()->getPage()->findField($selector);
$element->click();
}
@javascript
Scenario: Enable guest form ticket submissions
Given I am login as a Team Manager
And I have a Support Staff
And I am on "/settings/team/general"
# this one do not trigger the onClick event
When I check "Allow guest ticket submissions"
# we replace with this custom one
When I click "Allow guest ticket submissions"
And I wait for the "support-staff" to be enabled
And I select "Support Staff" from "Support staff"
And I press "Save"
Then I should see "Settings updated."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment