mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Add ability to confirm/dismiss dialogs after clicking in elements
This commit is contained in:
parent
19a7c52b1d
commit
140c31b34f
@ -592,6 +592,10 @@ It's based on the `vendor/bin/behat -di @cms` output.
|
|||||||
|
|
||||||
Given /^I (?:press|follow) the "([^"]*)" (?:button|link), dismissing the dialog$/
|
Given /^I (?:press|follow) the "([^"]*)" (?:button|link), dismissing the dialog$/
|
||||||
|
|
||||||
|
Given /^I (click|double click) "([^"]*)" in the "([^"]*)" element, confirming the dialog$/
|
||||||
|
|
||||||
|
Given /^I (click|double click) "([^"]*)" in the "([^"]*)" element, dismissing the dialog$/
|
||||||
|
|
||||||
Given /^I confirm the dialog$/
|
Given /^I confirm the dialog$/
|
||||||
|
|
||||||
Given /^I dismiss the dialog$/
|
Given /^I dismiss the dialog$/
|
||||||
|
@ -399,6 +399,27 @@ JS;
|
|||||||
$element->$clickTypeFn();
|
$element->$clickTypeFn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Needs to be in single command to avoid "unexpected alert open" errors in Selenium.
|
||||||
|
* Example: I click "Delete" in the ".actions" element, confirming the dialog
|
||||||
|
*
|
||||||
|
* @Given /^I (click|double click) "([^"]*)" in the "([^"]*)" element, confirming the dialog$/
|
||||||
|
*/
|
||||||
|
public function iClickInTheElementConfirmingTheDialog($clickType, $text, $selector) {
|
||||||
|
$this->iClickInTheElement($clickType, $text, $selector);
|
||||||
|
$this->iConfirmTheDialog();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Needs to be in single command to avoid "unexpected alert open" errors in Selenium.
|
||||||
|
* Example: I click "Delete" in the ".actions" element, dismissing the dialog
|
||||||
|
*
|
||||||
|
* @Given /^I (click|double click) "([^"]*)" in the "([^"]*)" element, dismissing the dialog$/
|
||||||
|
*/
|
||||||
|
public function iClickInTheElementDismissingTheDialog($clickType, $text, $selector) {
|
||||||
|
$this->iClickInTheElement($clickType, $text, $selector);
|
||||||
|
$this->iDismissTheDialog();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Given /^I type "([^"]*)" into the dialog$/
|
* @Given /^I type "([^"]*)" into the dialog$/
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user