@@ -341,34 +341,23 @@ private Locator.XPathLocator getTrackLocator(String trackId, boolean waitFor)
341341
342342 private By getVariantWithinTrack (String trackId , String variantText , boolean waitFor )
343343 {
344- try
345- {
346- Locator .XPathLocator l = getTrackLocator (trackId , waitFor );
347-
348- l = l .append (Locator .xpath ("//*[name()='text' and contains(text(), '" + variantText + "')]/.." )).notHidden ();
349-
350- if (waitFor )
351- {
352- waitForElement (l );
353- }
344+ Locator .XPathLocator l = getTrackLocator (trackId , waitFor );
354345
355- waitForElementToDisappear (Locator .tagWithText ("p" , "Loading" ));
356- sleep (250 );
346+ l = l .append (Locator .xpath ("//*[name()='text' and contains(text(), '" + variantText + "')]/.." )).notHidden ();
357347
358- return By .xpath (l .toXpath ());
359- }
360- catch (Exception e )
348+ if (waitFor )
361349 {
362- return null ;
350+ waitForElement ( l ) ;
363351 }
364- }
365352
366- private boolean isVariantVisible (String trackId , String variantText , boolean waitFor ){
367- By var = getVariantWithinTrack (trackId , variantText , waitFor );
368- if (var != null ){
369- return true ;
353+ waitForElementToDisappear (Locator .tagWithText ("p" , "Loading" ));
354+ sleep (250 );
355+ if (waitFor )
356+ {
357+ waitForElement (l );
370358 }
371- return false ;
359+
360+ return By .xpath (l .toXpath ());
372361 }
373362
374363 private void testMessageDisplay ()
@@ -384,8 +373,9 @@ private void testMessageDisplay()
384373
385374 private void waitForJBrowseToLoad ()
386375 {
387- waitForElementToDisappear (Locator .tagWithText ("p" , "Loading..." ));
376+ waitForElementToDisappear (Locator .tagWithText ("p" , "Loading..." )); //the initial message before getSession
388377 waitForElement (Locator .tagWithClass ("span" , "MuiIconButton-label" ).notHidden ()); //this is the top-left icon
378+ waitForElement (Locator .tagWithAttribute ("button" , "title" , "close this track" ).notHidden ());
389379 waitForElement (Locator .tagWithClassContaining ("span" , "MuiTypography-root" ).notHidden (), WAIT_FOR_PAGE ); //this is the icon from the track label
390380
391381 waitForElementToDisappear (Locator .tagWithText ("div" , "Loading..." )); //track data
0 commit comments