File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ public function thereIsNotificationAppearsWithDetails(TableNode $notificationDet
7171 */
7272 public function iOpenNotificationMenu (string $ description ): void
7373 {
74- $ this ->userNotificationPopup ->verifyIsLoaded ();
7574 $ this ->userNotificationPopup ->openNotificationMenu ($ description );
7675 }
7776
Original file line number Diff line number Diff line change 1010
1111use Exception ;
1212use Ibexa \Behat \Browser \Component \Component ;
13- use Ibexa \Behat \Browser \Element \Action \MouseOverAndClick ;
1413use Ibexa \Behat \Browser \Element \Condition \ElementExistsCondition ;
1514use Ibexa \Behat \Browser \Element \Condition \ElementNotExistsCondition ;
1615use Ibexa \Behat \Browser \Element \Criterion \ChildElementTextCriterion ;
@@ -115,16 +114,26 @@ public function openNotificationMenu(string $expectedDescription): void
115114 $ this ->getLocator ('notificationActionsPopup ' ),
116115 )
117116 );
117+
118+ $ this ->getHTMLPage ()
119+ ->setTimeout (10 )
120+ ->waitUntilCondition (
121+ new ElementExistsCondition (
122+ $ this ->getHTMLPage (),
123+ $ this ->getLocator ('notificationMenuItemContent ' )
124+ )
125+ );
118126 }
119127
120128 public function clickActionButton (string $ buttonText ): void
121129 {
122- $ buttons = $ this ->getHTMLPage ()
123- ->setTimeout (10 )
124- ->findAll ($ this ->getLocator ('notificationMenuItemContent ' ))
125- ->filterBy (new ElementTextCriterion ($ buttonText ));
130+ $ button = $ this ->getActionButton ($ buttonText );
131+
132+ if ($ button === null ) {
133+ throw new \Exception (sprintf ('Action button "%s" not found. ' , $ buttonText ));
134+ }
126135
127- $ buttons -> first ()-> execute ( new MouseOverAndClick () );
136+ $ button -> click ( );
128137
129138 $ this ->getHTMLPage ()
130139 ->setTimeout (10 )
You can’t perform that action at this time.
0 commit comments