Package core.helpers

Class WaitHelper

java.lang.Object
core.helpers.WaitHelper

public class WaitHelper extends Object
  • Constructor Details

    • WaitHelper

      public WaitHelper()
  • Method Details

    • waitForElementToLoad

      public boolean waitForElementToLoad(EnhancedBy target)
      waits for element to be displayed for amount of time specified by 60 seconds
      Parameters:
      target -
    • waitForElementToLoad

      public boolean waitForElementToLoad(EnhancedBy target, int time)
      waits for element to load count() checks if the element is displayed Then gets the count number
      Parameters:
      target -
      time -
    • waitForElementToBeVisible

      public boolean waitForElementToBeVisible(EnhancedBy target, int time, int count)
      waits for element to load If mobile device, scrolls down the page until element is visible
      Parameters:
      target - : element to wait for
      time - : max time to wait
      count - : minimum count of elements to wait for in list
      Returns:
    • waitForElementToLoad

      public boolean waitForElementToLoad(EnhancedBy target, int time, int count)
    • mobile_waitAndRefreshForElementToLoad

      public void mobile_waitAndRefreshForElementToLoad(EnhancedBy target)
      waits for element to load And refreshes the app each time to renew the dom
      Parameters:
      target -
    • mobile_waitAndRefreshForElementToLoad

      public void mobile_waitAndRefreshForElementToLoad(EnhancedBy target, int time)
      waits for element to load And refreshes the app each time to renew the dom
      Parameters:
      target -
    • waitForFirstElementToLoad

      public boolean waitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2)
      waits for either element to load returns true When first item loads
      Parameters:
      element1 -
      element2 -
      time -
      Returns:
    • waitForFirstElementToLoad

      public boolean waitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2, int time)
      waits for either element to load returns true When first item loads
      Parameters:
      element1 -
      element2 -
      time -
      Returns:
    • waitForFirstElementToLoad

      public boolean waitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2, EnhancedBy element3)
      waits for either element to load returns true When first item loads
      Parameters:
      element1 -
      element2 -
      time -
      Returns:
    • waitForFirstElementToLoad

      public boolean waitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2, EnhancedBy element3, int time)
      waits for either element to load returns true When first item loads
      Parameters:
      element1 -
      element2 -
      time -
      Returns:
    • waitForAdditionalElementsToLoad

      public boolean waitForAdditionalElementsToLoad(EnhancedBy target, int originalCount)
      waits for element count to increase from the originalCount Usefull When waiting for a list to expand with additional items
      Parameters:
      target -
      originalCount -
      Returns:
    • waitForAdditionalElementsToLoad

      public boolean waitForAdditionalElementsToLoad(EnhancedBy target, int originalCount, int time)
      waits for element count to increase from the originalCount Usefull When waiting for a list to expand with additional items
      Parameters:
      target -
      originalCount -
      Returns:
    • waitForElementToBeRemoved

      public boolean waitForElementToBeRemoved(EnhancedBy target)
      waits for element to not be displayed wait for maximum of 60 seconds
      Parameters:
      target -
      Returns:
    • waitForElementToBeRemoved

      public boolean waitForElementToBeRemoved(EnhancedBy target, int time, int waitForTargetToLoadInSeconds)
    • waitForElementToBeRemoved

      public boolean waitForElementToBeRemoved(EnhancedBy target, int time)
      waits for element to not be displayed
      Parameters:
      target -
      time - : maximum amount of time in seconds to wait
    • waitForSeconds

      public void waitForSeconds(double seconds)
      waits for number of seconds
      Parameters:
      seconds -
    • waitForPageToLoad

      public void waitForPageToLoad()
      waits for web page to load
    • waitForListItemToLoad_Contains

      public void waitForListItemToLoad_Contains(EnhancedBy list, String option)
      waits for item containing in list to load
      Parameters:
      list -
      option -
      time -
    • waitForTextToLoad

      public void waitForTextToLoad(EnhancedBy target, String text)
      waits for text to be loaded for amount of time specified by 60 seconds
      Parameters:
      target -
    • waitForTextToLoad

      public void waitForTextToLoad(EnhancedBy target, int time, String text)
      make sure only one element And caller needs to take responsibility to have text in the element
      Parameters:
      target -
      time -
    • waitForElementToBeClickable

      public boolean waitForElementToBeClickable(EnhancedBy selector)
    • waitForElementToBeClickable

      public boolean waitForElementToBeClickable(EnhancedBy target, int time)
    • waitForClassContain

      public boolean waitForClassContain(EnhancedBy target, int index, String value)
      wait for class to contain value
      Parameters:
      target -
      index -
      value -
      Returns:
    • waitForClassContain

      public boolean waitForClassContain(EnhancedBy target, int index, String value, int time)
      wait for class to contain value
      Parameters:
      target -
      index -
      value -
      time -
      Returns:
    • waitForAnyTextToLoadContaining

      public boolean waitForAnyTextToLoadContaining(EnhancedBy target, String... text)
      wait for any text strings to become available
      Parameters:
      target -
      text -
      time -
      Returns:
    • waitForAnyTextToLoadContaining

      public boolean waitForAnyTextToLoadContaining(EnhancedBy target, int time, String... text)
      wait for any text strings to become available
      Parameters:
      target -
      time -
      text -
      Returns:
    • waitForAnyTextToLoad

      public boolean waitForAnyTextToLoad(EnhancedBy target, String... text)
      wait for any text strings to become available
      Parameters:
      target -
      text -
      time -
      Returns:
    • waitForAnyTextToLoad

      public boolean waitForAnyTextToLoad(EnhancedBy target, int time, String... text)
      wait for any text strings to become available
      Parameters:
      target -
      time -
      text -
      Returns:
    • waitForCondition

      public boolean waitForCondition(org.openqa.selenium.support.ui.ExpectedCondition<Boolean> condition, EnhancedBy target, int time)
      wait for condition to be true
      Parameters:
      condition -
      target -
      time -
      Returns:
    • waitForCondition2

      public boolean waitForCondition2(org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> condition2, EnhancedBy target, int time)
    • ajaxComplete

      public void ajaxComplete()
    • waitForJQueryLoad

      public void waitForJQueryLoad(int time)
    • waitForAngularLoad

      public void waitForAngularLoad(int time)
    • waitUntilJSReady

      public void waitUntilJSReady(int time)
    • waitUntilJQueryReady

      public void waitUntilJQueryReady(int time)
    • waitUntilAngularReady

      public void waitUntilAngularReady(int time)
    • waitUntilAngular5Ready

      public void waitUntilAngular5Ready(int time)
    • waitForAngular5Load

      public void waitForAngular5Load(int time)
    • angularLoads

      public void angularLoads(String angularReadyScript, int time)
    • waitAllJSRequests

      public void waitAllJSRequests(int time)