Created
January 11, 2014 01:02
-
-
Save alnutile/8365610 to your computer and use it in GitHub Desktop.
Allow user to submit a form with no submit button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Some forms do not have a Submit button just pass the ID | |
* | |
* @Given /^I submit the form with id "([^"]*)"$/ | |
*/ | |
public function iSubmitTheFormWithId($arg) | |
{ | |
$node = $this->getMainContext()->getSession()->getPage()->find('css', $arg); | |
if($node) { | |
$this->getMainContext()->getSession()->executeScript("jQuery('$arg').submit();"); | |
} else { | |
throw new Exception('Element not found'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment