Merge pull request #10635 from creative-commoners/pulls/5/fix-behat

MNT Fix using treedropdownfield in behat
This commit is contained in:
Maxime Rainville 2023-01-11 11:34:27 +13:00 committed by GitHub
commit 2868edd8d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -304,13 +304,13 @@ JS;
});
$this->retryThrowable(function () use ($parentElement, $selector) {
$dropdown = $parentElement->find('css', '.Select-arrow');
$dropdown = $parentElement->find('css', '.treedropdownfield__dropdown-indicator');
Assert::assertNotNull($dropdown, sprintf('Unable to find the dropdown in "%s"', $selector));
$dropdown->click();
});
$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 .="%s"]', $text));
Assert::assertNotNull($element, sprintf('"%s" not found in "%s"', $text, $selector));
$element->click();
});