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
6009c5bdbd
commit
33eb0adf0c
@ -591,6 +591,10 @@ It's based on the `vendor/bin/behat -di @cms` output.
|
|||||||
Given /^I (?:press|follow) the "([^"]*)" (?:button|link), confirming the dialog$/
|
Given /^I (?:press|follow) the "([^"]*)" (?:button|link), confirming the dialog$/
|
||||||
|
|
||||||
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$/
|
||||||
|
|
||||||
|
@ -394,6 +394,27 @@ JS;
|
|||||||
|
|
||||||
$element->click();
|
$element->click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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