mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix behat tree dropdown trigger
This commit is contained in:
parent
4e222fc189
commit
a85bc86fd3
@ -267,17 +267,22 @@ JS;
|
|||||||
public function iSelectValueInTreeDropdown($text, $selector)
|
public function iSelectValueInTreeDropdown($text, $selector)
|
||||||
{
|
{
|
||||||
$page = $this->getSession()->getPage();
|
$page = $this->getSession()->getPage();
|
||||||
$parentElement = $page->find('css', $selector);
|
$parentElement = null;
|
||||||
assertNotNull($parentElement, sprintf('"%s" element not found', $selector));
|
$this->retryThrowable(function () use (&$parentElement, &$page, $selector) {
|
||||||
|
$parentElement = $page->find('css', $selector);
|
||||||
|
assertNotNull($parentElement, sprintf('"%s" element not found', $selector));
|
||||||
|
$page = $this->getSession()->getPage();
|
||||||
|
});
|
||||||
|
|
||||||
$dropdown = $parentElement->find('css', '.Select');
|
$this->retryThrowable(function () use ($parentElement, $selector) {
|
||||||
assertNotNull($dropdown, sprintf('Unable to find the dropdown in "%s"', $selector));
|
$dropdown = $parentElement->find('css', '.Select-arrow');
|
||||||
$dropdown->click();
|
assertNotNull($dropdown, sprintf('Unable to find the dropdown in "%s"', $selector));
|
||||||
|
$dropdown->click();
|
||||||
|
});
|
||||||
|
|
||||||
$this->retryThrowable(function () use ($text, $parentElement, $selector) {
|
$this->retryThrowable(function () use ($text, $parentElement, $selector) {
|
||||||
$element = $parentElement->find('xpath', sprintf('//*[count(*)=0 and contains(.,"%s")]', $text));
|
$element = $parentElement->find('xpath', sprintf('//*[count(*)=0 and contains(.,"%s")]', $text));
|
||||||
assertNotNull($element, sprintf('"%s" not found in "%s"', $text, $selector));
|
assertNotNull($element, sprintf('"%s" not found in "%s"', $text, $selector));
|
||||||
|
|
||||||
$element->click();
|
$element->click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user