MNT Behat test for gridfield object on page

This commit is contained in:
Sabina Talipova 2024-01-08 08:30:01 +13:00
parent d946d69f17
commit 15e24f92d0

View File

@ -510,6 +510,9 @@ JS;
$parentElement = $page->find('css', $selector); $parentElement = $page->find('css', $selector);
Assert::assertNotNull($parentElement, sprintf('"%s" element not found', $selector)); Assert::assertNotNull($parentElement, sprintf('"%s" element not found', $selector));
$element = $parentElement->find('xpath', sprintf('//*[count(*)=0 and contains(.,"%s")]', $text)); $element = $parentElement->find('xpath', sprintf('//*[count(*)=0 and contains(.,"%s")]', $text));
if (is_null($element)) {
$element = $parentElement->find('xpath', sprintf('//*[text()[contains(.,"%s")]]', $text));
}
Assert::assertNotNull($element, sprintf('"%s" not found', $text)); Assert::assertNotNull($element, sprintf('"%s" not found', $text));
$clickTypeFn = $clickTypeMap[$clickType]; $clickTypeFn = $clickTypeMap[$clickType];
$element->$clickTypeFn(); $element->$clickTypeFn();