nerodia.wait package

Submodules

nerodia.wait.timer module

class nerodia.wait.timer.Timer(timeout=None)[source]

Bases: object

locked
remaining_time
reset()[source]
wait(timeout, method, interval=0, object=None, expected=True)[source]

Executes the given method until it returns True or exceeds the timeout :param timeout: time in seconds to timeout after :param method: method to call (typically a lambda) :param interval: interval to wait between calls :param obect: object to call in the method :param expected: expected outcome :type expected: bool :rtype: bool

nerodia.wait.wait module

exception nerodia.wait.wait.TimeoutError[source]

Bases: exceptions.Exception

class nerodia.wait.wait.Wait[source]

Bases: object

INTERVAL = 0.1
timer = <nerodia.wait.timer.Timer object>
classmethod until(method=None, timeout=None, message=None, interval=None, object=None)[source]

Waits until the method evaluates to True or times out :param method: method to run, typically lambda :param object: object to evaluate method with :param timeout: time to wait :type timeout: float :param message: message to raise if timeout is exceeded :type message: str :param interval: time to wait between each check :type interval: float :Example:

Wait.until(lambda: browser.text_field(name=’abrakadbra’).present)

classmethod until_not(method=None, timeout=None, message=None, interval=None, object=None)[source]

Waits while the method evaluates to True or times out :param method: method to run, typically lambda :param object: object to evaluate method with :param timeout: time to wait :type timeout: float :param message: message to raise if timeout is exceeded :type message: str :param interval: time to wait between each check :type interval: float :Example:

Wait.until_not(lambda: browser.text_field(name=’abrakadbra’).present)

classmethod whilst(method=None, timeout=None, message=None, interval=None, object=None)

Waits while the method evaluates to True or times out :param method: method to run, typically lambda :param object: object to evaluate method with :param timeout: time to wait :type timeout: float :param message: message to raise if timeout is exceeded :type message: str :param interval: time to wait between each check :type interval: float :Example:

Wait.until_not(lambda: browser.text_field(name=’abrakadbra’).present)

class nerodia.wait.wait.Waitable[source]

Bases: object

wait_until(method=None, timeout=None, message=None, interval=None, object=None, **kwargs)[source]

Waits until the condition is True :param method: method to run, typically lambda :param object: object to evaluate method with :param timeout: time to wait :type timeout: int :param message: message to raise if timeout is exceeded :type message: str :param interval: time to wait between each check :type interval: float :Example:

browser.text_field(name=’new_user_first_name’).wait_until(lambda x: x.present).click browser.text_field(name=’new_user_first_name’).wait_until(name=’new_user_first_name’).click

wait_until_not(method=None, timeout=None, message=None, interval=None, object=None, **kwargs)[source]

Waits while the condition is True :param method: method to run, typically lambda :param object: object to evaluate method with :param timeout: time to wait :type timeout: int :param message: message to raise if timeout is exceeded :type message: str :param interval: time to wait between each check :type interval: float :Example:

browser.wait_until_not(lambda x: not x.exists, timeout=2)] browser.wait_until_not(title=’no’)

wait_until_not_present(timeout=None, interval=None, message=None)[source]

Waits while the element is present :param timeout: time to wait :type timeout: int :param interval: time to wait between each check :type interval: float :param message: message error message for when times out :type message: str :Example:

browser.text_field(name=’abrakadbra’).wait_until_not_present

wait_until_present(timeout=None, interval=None, message=None)[source]

Waits until the element is present :param timeout: time to wait :type timeout: int :param interval: time to wait between each check :type interval: float :param message: message error message for when times out :type message: str :Example:

browser.text_field(name=’new_user_first_name’).wait_until_present()

Module contents