Package core.helpers
Class WaitHelper
- java.lang.Object
-
- core.helpers.WaitHelper
-
public class WaitHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description WaitHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidajaxComplete()voidangularLoads(String angularReadyScript, int time)voidmobile_waitAndRefreshForElementToLoad(EnhancedBy target)waits for element to load And refreshes the app each time to renew the domvoidmobile_waitAndRefreshForElementToLoad(EnhancedBy target, int time)waits for element to load And refreshes the app each time to renew the domvoidwaitAllJSRequests(int time)booleanwaitForAdditionalElementsToLoad(EnhancedBy target, int originalCount)waits for element count to increase from the originalCount Usefull When waiting for a list to expand with additional itemsbooleanwaitForAdditionalElementsToLoad(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 itemsvoidwaitForAngular5Load(int time)voidwaitForAngularLoad(int time)booleanwaitForAnyTextToLoad(EnhancedBy target, int time, String... text)wait for any text strings to become availablebooleanwaitForAnyTextToLoad(EnhancedBy target, String... text)wait for any text strings to become availablebooleanwaitForAnyTextToLoadContaining(EnhancedBy target, int time, String... text)wait for any text strings to become availablebooleanwaitForAnyTextToLoadContaining(EnhancedBy target, String... text)wait for any text strings to become availablebooleanwaitForClassContain(EnhancedBy target, int index, String value)wait for class to contain valuebooleanwaitForClassContain(EnhancedBy target, int index, String value, int time)wait for class to contain valuebooleanwaitForCondition(org.openqa.selenium.support.ui.ExpectedCondition<Boolean> condition, EnhancedBy target, int time)wait for condition to be truebooleanwaitForElementToBeClickable(EnhancedBy selector)booleanwaitForElementToBeClickable(EnhancedBy target, int time)booleanwaitForElementToBeRemoved(EnhancedBy target)waits for element to not be displayed wait for maximum of 60 secondsbooleanwaitForElementToBeRemoved(EnhancedBy target, int time)waits for element to not be displayedbooleanwaitForElementToBeRemoved(EnhancedBy target, int time, int waitForTargetToLoadInSeconds)booleanwaitForElementToLoad(EnhancedBy target)waits for element to be displayed for amount of time specified by 60 secondsbooleanwaitForElementToLoad(EnhancedBy target, int time)waits for element to load count() checks if the element is displayed Then gets the count numberbooleanwaitForElementToLoad(EnhancedBy target, int time, int count)waits for element to load If mobile device, scrolls down the page until element is visiblebooleanwaitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2)waits for either element to load returns true When first item loadsbooleanwaitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2, int time)waits for either element to load returns true When first item loadsbooleanwaitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2, EnhancedBy element3)waits for either element to load returns true When first item loadsbooleanwaitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2, EnhancedBy element3, int time)waits for either element to load returns true When first item loadsvoidwaitForJQueryLoad(int time)voidwaitForListItemToLoad_Contains(EnhancedBy list, String option)waits for item containing in list to loadvoidwaitForPageToLoad()waits for web page to loadvoidwaitForSeconds(double seconds)waits for number of secondsvoidwaitForTextToLoad(EnhancedBy target, int time, String text)make sure only one element And caller needs to take responsibility to have text in the elementvoidwaitForTextToLoad(EnhancedBy target, String text)waits for text to be loaded for amount of time specified by 60 secondsvoidwaitUntilAngular5Ready(int time)voidwaitUntilAngularReady(int time)voidwaitUntilJQueryReady(int time)voidwaitUntilJSReady(int time)
-
-
-
Method Detail
-
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-
-
waitForElementToLoad
public boolean waitForElementToLoad(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 fortime- : max time to waitcount- : minimum count of elements to wait for in list- Returns:
-
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-time-text-- 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-time-text-- 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:
-
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)
-
-