Skip to content

Commit

Permalink
MNT Behat test for gridfield object on page
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Jan 8, 2024
1 parent d946d69 commit 8d2e749
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Context/BasicContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,9 @@ public function iClickInTheElement($clickType, $text, $selector)
$parentElement = $page->find('css', $selector);
Assert::assertNotNull($parentElement, sprintf('"%s" element not found', $selector));
$element = $parentElement->find('xpath', sprintf('//*[count(*)=0 and contains(.,"%s")]', $text));
if (is_null($element)) {
$element = $parentElement->find('xpath', sprintf('//*[count(*)>-1 and text()[contains(.,"%s")]]', $text));
}
Assert::assertNotNull($element, sprintf('"%s" not found', $text));
$clickTypeFn = $clickTypeMap[$clickType];
$element->$clickTypeFn();
Expand Down

0 comments on commit 8d2e749

Please sign in to comment.