Skip to content

Commit 5ffc829

Browse files
committed
Adjusting Behat - test 1
1 parent 1ad47c9 commit 5ffc829

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/lib/Behat/Component/ContentActionsMenu.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ public function clickButton(string $buttonName): void
3636
return;
3737
}
3838

39+
$contextMenuSplitBtnsTogglers = $this->getHTMLPage()
40+
->findAll($this->getLocator('menuSplitToggler'));
41+
42+
foreach($contextMenuSplitBtnsTogglers->getIterator() as $splitBtnToggler) {
43+
$splitBtnToggler->click();
44+
45+
$matchingSubButtons = $this->getHTMLPage()
46+
->findAll($this->getLocator('menuSplitSubmenuButton'))
47+
->filterBy(new ElementTextCriterion($buttonName));
48+
49+
if ($matchingSubButtons->any()) {
50+
$matchingSubButtons->first()->click();
51+
}
52+
}
53+
3954
$this->getHTMLPage()->find($this->getLocator('moreButton'))->click();
4055

4156
$this->getHTMLPage()
@@ -79,6 +94,8 @@ protected function specifyLocators(): array
7994
{
8095
return [
8196
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
97+
new VisibleCSSLocator('menuSplitToggler', '.ibexa-context-menu .ibexa-split-btn__toggle-btn'),
98+
new VisibleCSSLocator('menuSplitSubmenuButton', '.ibexa-popup-menu:not(.ibexa-popup-menu--hidden) .ibexa-popup-menu__item-content'),
8299
new VisibleCSSLocator('label', '.ibexa-btn__label'),
83100
new VisibleCSSLocator('moreButton', '.ibexa-context-menu__item--more'),
84101
new VisibleCSSLocator('expandedMenuButton', '.ibexa-context-menu__item .ibexa-popup-menu__item-content'),

0 commit comments

Comments
 (0)