@@ -139,7 +139,7 @@ public boolean isMarkAllVisible()
139139 protected boolean isExpanded ()
140140 {
141141 boolean ariaExpanded = "true" .equals (elementCache ().toggle .getAttribute ("aria-expanded" ));
142- boolean menuContentDisplayed = elementCache ().menuContent .isDisplayed ();
142+ boolean menuContentDisplayed = elementCache ().menuContent () .isDisplayed ();
143143
144144 return ariaExpanded && menuContentDisplayed ;
145145 }
@@ -201,16 +201,14 @@ private WebElement waitForNotificationList()
201201
202202 // Wait for the listing container to show up. The listing container is in the open menu, scope the search to that.
203203 Locator notificationsContainerLocator = Locator .tagWithClass ("div" , "server-notifications-listing-container" );
204- WebDriverWrapper .waitFor (()-> notificationsContainerLocator .refindWhenNeeded (elementCache ().menuContent ). isDisplayed ( ),
204+ WebDriverWrapper .waitFor (()-> notificationsContainerLocator .areAnyVisible (elementCache ().menuContent () ),
205205 "List container did not render." , 500 );
206206
207207 // Find again (lambda requires a final reference to the component).
208- WebElement listContainer = notificationsContainerLocator .refindWhenNeeded (elementCache ().menuContent );
208+ WebElement listContainer = notificationsContainerLocator .refindWhenNeeded (elementCache ().menuContent () );
209209
210210 // It may be a moment before any notifications show up.
211- WebDriverWrapper .waitFor (()-> Locator .tagWithClass ("ul" , "server-notifications-listing" )
212- .refindWhenNeeded (listContainer )
213- .isDisplayed (),
211+ WebDriverWrapper .waitFor (()-> Locator .tagWithClass ("ul" , "server-notifications-listing" ).areAnyVisible (listContainer ),
214212 "There are no notifications in the drop down." , 1_000 );
215213
216214 // Just wait for a moment in case the list is slow to update with the most recent notification.
@@ -223,7 +221,7 @@ private WebElement waitForNotificationList()
223221
224222 // Find the container again, don't return listContainer WebElement previously found. If the list was slow to
225223 // update with the most recent notification the old reference will be stale.
226- return notificationsContainerLocator .refindWhenNeeded ((elementCache ().menuContent ));
224+ return notificationsContainerLocator .refindWhenNeeded ((elementCache ().menuContent () ));
227225 }
228226
229227 /**
@@ -282,7 +280,10 @@ protected ServerNotificationMenu.ElementCache newElementCache()
282280
283281 protected class ElementCache extends Component <?>.ElementCache
284282 {
285- public final WebElement menuContent = Locator .byClass ("navbar-menu__content" ).refindWhenNeeded (this );
283+ public final WebElement menuContent ()
284+ {
285+ return Locator .byClass ("navbar-menu__content" ).refindWhenNeeded (this );
286+ }
286287
287288 public final WebElement toggle = Locator .byClass ("navbar-menu-button" ).refindWhenNeeded (this );
288289
@@ -293,14 +294,14 @@ public final WebElement statusIcon()
293294
294295 public final WebElement noNotificationsElement ()
295296 {
296- return Locator .tagWithClass ("div" , "server-notifications-footer" ).refindWhenNeeded (elementCache ().menuContent );
297+ return Locator .tagWithClass ("div" , "server-notifications-footer" ).refindWhenNeeded (elementCache ().menuContent () );
297298 }
298299
299300 public final WebElement markAll ()
300301 {
301302 return Locator .tagWithClass ("h3" , "navbar-menu-header" )
302303 .child (Locator .byClass ("clickable-text" ))
303- .refindWhenNeeded (elementCache ().menuContent );
304+ .refindWhenNeeded (elementCache ().menuContent () );
304305 }
305306
306307 public final WebElement viewAllLink ()
0 commit comments