Skip to content

Commit

Permalink
Adjusting Behat - test 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed Aug 31, 2023
1 parent 16ecc1b commit 76aea15
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/lib/Behat/Component/ContentActionsMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ public function clickButton(string $buttonName): void
return;
}

$contextMenuSplitBtnsTogglers = $this->getHTMLPage()
->findAll($this->getLocator('menuSplitToggler'));

foreach($contextMenuSplitBtnsTogglers->getIterator() as $splitBtnToggler) {
$splitBtnToggler->click();

$matchingSubButtons = $this->getHTMLPage()
->findAll($this->getLocator('menuSplitSubmenuButton'))
->filterBy(new ElementTextCriterion($buttonName));

if ($matchingSubButtons->any()) {
$matchingSubButtons->first()->click();
}
}

$this->getHTMLPage()->find($this->getLocator('moreButton'))->click();

$this->getHTMLPage()
Expand Down Expand Up @@ -79,6 +94,8 @@ protected function specifyLocators(): array
{
return [
new VisibleCSSLocator('menuButton', '.ibexa-context-menu .ibexa-btn, .ibexa-context-menu__item .ibexa-popup-menu__item, .ibexa-context-menu .btn'), // TO DO: set one selector after redesign
new VisibleCSSLocator('menuSplitToggler', '.ibexa-context-menu .ibexa-split-btn__toggle-btn'),
new VisibleCSSLocator('menuSplitSubmenuButton', '.ibexa-popup-menu:not(.ibexa-popup-menu--hidden) .ibexa-popup-menu__item-content'),
new VisibleCSSLocator('label', '.ibexa-btn__label'),
new VisibleCSSLocator('moreButton', '.ibexa-context-menu__item--more'),
new VisibleCSSLocator('expandedMenuButton', '.ibexa-context-menu__item .ibexa-popup-menu__item-content'),
Expand Down

0 comments on commit 76aea15

Please sign in to comment.