repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper._find_immediately
def _find_immediately(self, locator, search_object=None): ''' Attempts to immediately find elements on the page without waiting @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @type search_object: webdriverwra...
python
def _find_immediately(self, locator, search_object=None): ''' Attempts to immediately find elements on the page without waiting @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @type search_object: webdriverwra...
[ "def", "_find_immediately", "(", "self", ",", "locator", ",", "search_object", "=", "None", ")", ":", "search_object", "=", "self", ".", "driver", "if", "search_object", "is", "None", "else", "search_object", "elements", "=", "self", ".", "locator_handler", "....
Attempts to immediately find elements on the page without waiting @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @type search_object: webdriverwrapper.WebElementWrapper @param search_object: Optional WebElement to ...
[ "Attempts", "to", "immediately", "find", "elements", "on", "the", "page", "without", "waiting" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L389-L404
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.find_all
def find_all(self, locator, search_object=None, force_find=False): ''' Find all elements matching locator @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @rtype: list[WebElementWrapper] @...
python
def find_all(self, locator, search_object=None, force_find=False): ''' Find all elements matching locator @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @rtype: list[WebElementWrapper] @...
[ "def", "find_all", "(", "self", ",", "locator", ",", "search_object", "=", "None", ",", "force_find", "=", "False", ")", ":", "return", "self", ".", "find", "(", "locator", "=", "locator", ",", "find_all", "=", "True", ",", "search_object", "=", "search_...
Find all elements matching locator @type locator: webdriverwrapper.support.locator.Locator @param locator: Locator object describing @rtype: list[WebElementWrapper] @return: list of WebElementWrappers
[ "Find", "all", "elements", "matching", "locator" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L406-L416
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.find_by_dynamic_locator
def find_by_dynamic_locator(self, template_locator, variables, find_all=False, search_object=None): ''' Find with dynamic locator @type template_locator: webdriverwrapper.support.locator.Locator @param template_locator: Template locator w/ formatting bits to insert ...
python
def find_by_dynamic_locator(self, template_locator, variables, find_all=False, search_object=None): ''' Find with dynamic locator @type template_locator: webdriverwrapper.support.locator.Locator @param template_locator: Template locator w/ formatting bits to insert ...
[ "def", "find_by_dynamic_locator", "(", "self", ",", "template_locator", ",", "variables", ",", "find_all", "=", "False", ",", "search_object", "=", "None", ")", ":", "template_variable_character", "=", "'%'", "# raise an exception if user passed non-dictionary variables", ...
Find with dynamic locator @type template_locator: webdriverwrapper.support.locator.Locator @param template_locator: Template locator w/ formatting bits to insert @type variables: dict @param variables: Dictionary of variable substitutions ...
[ "Find", "with", "dynamic", "locator" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L418-L446
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.is_present
def is_present(self, locator, search_object=None): """ Determines whether an element is present on the page, retrying once if unable to locate @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query...
python
def is_present(self, locator, search_object=None): """ Determines whether an element is present on the page, retrying once if unable to locate @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query...
[ "def", "is_present", "(", "self", ",", "locator", ",", "search_object", "=", "None", ")", ":", "all_elements", "=", "self", ".", "_find_immediately", "(", "locator", ",", "search_object", "=", "search_object", ")", "if", "all_elements", "is", "not", "None", ...
Determines whether an element is present on the page, retrying once if unable to locate @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query the element @type search_object: webdriverwrapper.W...
[ "Determines", "whether", "an", "element", "is", "present", "on", "the", "page", "retrying", "once", "if", "unable", "to", "locate" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L463-L478
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.is_present_no_wait
def is_present_no_wait(self, locator): """ Determines whether an element is present on the page with no wait @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query the element """ # first attempt to locate the el...
python
def is_present_no_wait(self, locator): """ Determines whether an element is present on the page with no wait @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query the element """ # first attempt to locate the el...
[ "def", "is_present_no_wait", "(", "self", ",", "locator", ")", ":", "# first attempt to locate the element", "def", "execute", "(", ")", ":", "'''\n Generic function to execute wait\n '''", "return", "True", "if", "len", "(", "self", ".", "locator_ha...
Determines whether an element is present on the page with no wait @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string used to query the element
[ "Determines", "whether", "an", "element", "is", "present", "on", "the", "page", "with", "no", "wait" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L481-L498
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until
def wait_until(self, wait_function, failure_message=None, timeout=None): """ Base wait method: called by other wait functions to execute wait @type wait_function: types.FunctionType @param wait_function: Generic function to be executed @type failure_message: str @p...
python
def wait_until(self, wait_function, failure_message=None, timeout=None): """ Base wait method: called by other wait functions to execute wait @type wait_function: types.FunctionType @param wait_function: Generic function to be executed @type failure_message: str @p...
[ "def", "wait_until", "(", "self", ",", "wait_function", ",", "failure_message", "=", "None", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "failure_message", "=", "fa...
Base wait method: called by other wait functions to execute wait @type wait_function: types.FunctionType @param wait_function: Generic function to be executed @type failure_message: str @param failure_message: Message to fail with if exception is raised @type timeout: ...
[ "Base", "wait", "method", ":", "called", "by", "other", "wait", "functions", "to", "execute", "wait" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L505-L529
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_present
def wait_until_present(self, locator, timeout=None, failure_message='Timeout waiting for element to be present'): """ Waits for an element to be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @...
python
def wait_until_present(self, locator, timeout=None, failure_message='Timeout waiting for element to be present'): """ Waits for an element to be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @...
[ "def", "wait_until_present", "(", "self", ",", "locator", ",", "timeout", "=", "None", ",", "failure_message", "=", "'Timeout waiting for element to be present'", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "ti...
Waits for an element to be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: ...
[ "Waits", "for", "an", "element", "to", "be", "present" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L544-L567
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_not_present
def wait_until_not_present(self, locator, timeout=None): """ Waits for an element to no longer be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the...
python
def wait_until_not_present(self, locator, timeout=None): """ Waits for an element to no longer be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the...
[ "def", "wait_until_not_present", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "# TODO: rethink about neg case with is_present and waiting too long", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout",...
Waits for an element to no longer be present @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @r...
[ "Waits", "for", "an", "element", "to", "no", "longer", "be", "present" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L569-L592
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_invisibility_of
def wait_until_invisibility_of(self, locator, timeout=None): """ Waits for an element to be invisible @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the max...
python
def wait_until_invisibility_of(self, locator, timeout=None): """ Waits for an element to be invisible @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the max...
[ "def", "wait_until_invisibility_of", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait fun...
Waits for an element to be invisible @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: ...
[ "Waits", "for", "an", "element", "to", "be", "invisible" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L624-L647
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_clickable
def wait_until_clickable(self, locator, timeout=None): """ Waits for an element to be clickable @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum n...
python
def wait_until_clickable(self, locator, timeout=None): """ Waits for an element to be clickable @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum n...
[ "def", "wait_until_clickable", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait function ...
Waits for an element to be clickable @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: ...
[ "Waits", "for", "an", "element", "to", "be", "clickable" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L649-L673
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_stale
def wait_until_stale(self, locator, timeout=None): """ Waits for an element to be stale in the DOM @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximu...
python
def wait_until_stale(self, locator, timeout=None): """ Waits for an element to be stale in the DOM @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximu...
[ "def", "wait_until_stale", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait function pass...
Waits for an element to be stale in the DOM @type locator: webdriverwrapper.support.locator.Locator @param locator: the locator or css string to search for the element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rt...
[ "Waits", "for", "an", "element", "to", "be", "stale", "in", "the", "DOM" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L675-L699
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_title_contains
def wait_until_title_contains(self, partial_title, timeout=None): """ Waits for title to contain <partial_title> @type partial_title: str @param partial_title: the partial title to locate @type timeout: int @param timeout: the maximum number of seco...
python
def wait_until_title_contains(self, partial_title, timeout=None): """ Waits for title to contain <partial_title> @type partial_title: str @param partial_title: the partial title to locate @type timeout: int @param timeout: the maximum number of seco...
[ "def", "wait_until_title_contains", "(", "self", ",", "partial_title", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wai...
Waits for title to contain <partial_title> @type partial_title: str @param partial_title: the partial title to locate @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverw...
[ "Waits", "for", "title", "to", "contain", "<partial_title", ">" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L702-L723
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_title_is
def wait_until_title_is(self, title, timeout=None): """ Waits for title to be exactly <partial_title> @type title: str @param title: the exact title to locate @type timeout: int @param timeout: the maximum number of seconds the driver will wait befo...
python
def wait_until_title_is(self, title, timeout=None): """ Waits for title to be exactly <partial_title> @type title: str @param title: the exact title to locate @type timeout: int @param timeout: the maximum number of seconds the driver will wait befo...
[ "def", "wait_until_title_is", "(", "self", ",", "title", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait function pas...
Waits for title to be exactly <partial_title> @type title: str @param title: the exact title to locate @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapper.WebEleme...
[ "Waits", "for", "title", "to", "be", "exactly", "<partial_title", ">" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L725-L746
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_alert_is_present
def wait_until_alert_is_present(self, timeout=None): """ Waits for an alert to be present @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapper.WebElementWrapper ...
python
def wait_until_alert_is_present(self, timeout=None): """ Waits for an alert to be present @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapper.WebElementWrapper ...
[ "def", "wait_until_alert_is_present", "(", "self", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "locator", "=", "None", "def", "wait", "(", ")", ":", "'''\n ...
Waits for an alert to be present @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapper.WebElementWrapper @return: Returns the element found
[ "Waits", "for", "an", "alert", "to", "be", "present" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L747-L767
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_text_contains
def wait_until_text_contains(self, locator, text, timeout=None): """ Waits for an element's text to contain <text> @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type text: str @param tex...
python
def wait_until_text_contains(self, locator, text, timeout=None): """ Waits for an element's text to contain <text> @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type text: str @param tex...
[ "def", "wait_until_text_contains", "(", "self", ",", "locator", ",", "text", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "this", "=", "self", "self", ".", "wait_f...
Waits for an element's text to contain <text> @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type text: str @param text: the text to search for @type timeout: int @par...
[ "Waits", "for", "an", "element", "s", "text", "to", "contain", "<text", ">" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L769-L796
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_text_is_not_empty
def wait_until_text_is_not_empty(self, locator, timeout=None): """ Waits for an element's text to not be empty @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type timeout: int @param timeout...
python
def wait_until_text_is_not_empty(self, locator, timeout=None): """ Waits for an element's text to not be empty @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type timeout: int @param timeout...
[ "def", "wait_until_text_is_not_empty", "(", "self", ",", "locator", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "self", ".", "wait_for", "(", "locator", ")", "# fir...
Waits for an element's text to not be empty @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used to find element @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out ...
[ "Waits", "for", "an", "element", "s", "text", "to", "not", "be", "empty" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L827-L851
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_page_source_contains
def wait_until_page_source_contains(self, text, timeout=None): """ Waits for the page source to contain <text> @type text: str @param text: the text to search for @type timeout: int @param timeout: the maximum number of seconds the...
python
def wait_until_page_source_contains(self, text, timeout=None): """ Waits for the page source to contain <text> @type text: str @param text: the text to search for @type timeout: int @param timeout: the maximum number of seconds the...
[ "def", "wait_until_page_source_contains", "(", "self", ",", "text", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait f...
Waits for the page source to contain <text> @type text: str @param text: the text to search for @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @rtype: webdriverwrapp...
[ "Waits", "for", "the", "page", "source", "to", "contain", "<text", ">" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L853-L875
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.wait_until_jquery_requests_are_closed
def wait_until_jquery_requests_are_closed(self, timeout=None): """Waits for AJAX requests made through @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @return: None """ timeout = timeout if timeout is not Non...
python
def wait_until_jquery_requests_are_closed(self, timeout=None): """Waits for AJAX requests made through @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @return: None """ timeout = timeout if timeout is not Non...
[ "def", "wait_until_jquery_requests_are_closed", "(", "self", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "timeout", "def", "wait", "(", ")", ":", "'''\n Wait function pas...
Waits for AJAX requests made through @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @return: None
[ "Waits", "for", "AJAX", "requests", "made", "through" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L877-L895
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.execute_and_handle_webdriver_exceptions
def execute_and_handle_webdriver_exceptions(self, function_to_execute, timeout=None, locator=None, failure_message=None): """ Executor for wait functions @type function_to_execute: types.FunctionType @param function_to_execute: wait function specifying the type of wait @type ti...
python
def execute_and_handle_webdriver_exceptions(self, function_to_execute, timeout=None, locator=None, failure_message=None): """ Executor for wait functions @type function_to_execute: types.FunctionType @param function_to_execute: wait function specifying the type of wait @type ti...
[ "def", "execute_and_handle_webdriver_exceptions", "(", "self", ",", "function_to_execute", ",", "timeout", "=", "None", ",", "locator", "=", "None", ",", "failure_message", "=", "None", ")", ":", "logger", "=", "logging", ".", "getLogger", "(", "__name__", ")", ...
Executor for wait functions @type function_to_execute: types.FunctionType @param function_to_execute: wait function specifying the type of wait @type timeout: int @param timeout: the maximum number of seconds the driver will wait before timing out @type...
[ "Executor", "for", "wait", "functions" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L897-L948
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.pause_and_wait_for_user
def pause_and_wait_for_user(self, timeout=None, prompt_text='Click to resume (WebDriver is paused)'): """Injects a radio button into the page and waits for the user to click it; will raise an exception if the radio to resume is never checked @return: None """ timeout = timeout i...
python
def pause_and_wait_for_user(self, timeout=None, prompt_text='Click to resume (WebDriver is paused)'): """Injects a radio button into the page and waits for the user to click it; will raise an exception if the radio to resume is never checked @return: None """ timeout = timeout i...
[ "def", "pause_and_wait_for_user", "(", "self", ",", "timeout", "=", "None", ",", "prompt_text", "=", "'Click to resume (WebDriver is paused)'", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "user_wait_timeout", "# ...
Injects a radio button into the page and waits for the user to click it; will raise an exception if the radio to resume is never checked @return: None
[ "Injects", "a", "radio", "button", "into", "the", "page", "and", "waits", "for", "the", "user", "to", "click", "it", ";", "will", "raise", "an", "exception", "if", "the", "radio", "to", "resume", "is", "never", "checked" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L975-L1029
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.get_browser_log
def get_browser_log(self, levels=None): """Gets the console log of the browser @type levels: @return: List of browser log entries """ logs = self.driver.get_log('browser') self.browser_logs += logs if levels is not None: logs = [entry for entry in log...
python
def get_browser_log(self, levels=None): """Gets the console log of the browser @type levels: @return: List of browser log entries """ logs = self.driver.get_log('browser') self.browser_logs += logs if levels is not None: logs = [entry for entry in log...
[ "def", "get_browser_log", "(", "self", ",", "levels", "=", "None", ")", ":", "logs", "=", "self", ".", "driver", ".", "get_log", "(", "'browser'", ")", "self", ".", "browser_logs", "+=", "logs", "if", "levels", "is", "not", "None", ":", "logs", "=", ...
Gets the console log of the browser @type levels: @return: List of browser log entries
[ "Gets", "the", "console", "log", "of", "the", "browser" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L1093-L1103
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py
WebDriverWrapper.quit
def quit(self): """Close driver and kill all associated displays """ # Kill the driver def _quit(): try: self.driver.quit() except Exception, err_driver: os.kill(self.driver_pid, signal.SIGKILL) raise f...
python
def quit(self): """Close driver and kill all associated displays """ # Kill the driver def _quit(): try: self.driver.quit() except Exception, err_driver: os.kill(self.driver_pid, signal.SIGKILL) raise f...
[ "def", "quit", "(", "self", ")", ":", "# Kill the driver", "def", "_quit", "(", ")", ":", "try", ":", "self", ".", "driver", ".", "quit", "(", ")", "except", "Exception", ",", "err_driver", ":", "os", ".", "kill", "(", "self", ".", "driver_pid", ",",...
Close driver and kill all associated displays
[ "Close", "driver", "and", "kill", "all", "associated", "displays" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebDriverWrapper.py#L1120-L1140
train
Shapeways/coyote_framework
coyote_framework/drivers/coyote_driver.py
CoyoteDriver.visit
def visit(self, url=''): """Visit the url, checking for rr errors in the response @param url: URL @return: Visit result """ result = super(CoyoteDriver, self).visit(url) source = self.page_source() return result
python
def visit(self, url=''): """Visit the url, checking for rr errors in the response @param url: URL @return: Visit result """ result = super(CoyoteDriver, self).visit(url) source = self.page_source() return result
[ "def", "visit", "(", "self", ",", "url", "=", "''", ")", ":", "result", "=", "super", "(", "CoyoteDriver", ",", "self", ")", ".", "visit", "(", "url", ")", "source", "=", "self", ".", "page_source", "(", ")", "return", "result" ]
Visit the url, checking for rr errors in the response @param url: URL @return: Visit result
[ "Visit", "the", "url", "checking", "for", "rr", "errors", "in", "the", "response" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/drivers/coyote_driver.py#L8-L16
train
Shapeways/coyote_framework
coyote_framework/config/abstract_config.py
load_config_vars
def load_config_vars(target_config, source_config): """Loads all attributes from source config into target config @type target_config: TestRunConfigManager @param target_config: Config to dump variables into @type source_config: TestRunConfigManager @param source_config: The other config @retur...
python
def load_config_vars(target_config, source_config): """Loads all attributes from source config into target config @type target_config: TestRunConfigManager @param target_config: Config to dump variables into @type source_config: TestRunConfigManager @param source_config: The other config @retur...
[ "def", "load_config_vars", "(", "target_config", ",", "source_config", ")", ":", "# Overwrite all attributes in config with new config", "for", "attr", "in", "dir", "(", "source_config", ")", ":", "# skip all private class attrs", "if", "attr", ".", "startswith", "(", "...
Loads all attributes from source config into target config @type target_config: TestRunConfigManager @param target_config: Config to dump variables into @type source_config: TestRunConfigManager @param source_config: The other config @return: True
[ "Loads", "all", "attributes", "from", "source", "config", "into", "target", "config" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/config/abstract_config.py#L100-L116
train
Shapeways/coyote_framework
coyote_framework/config/abstract_config.py
ConfigBase._readall
def _readall(self): """Read configs from all available configs. It will read files in the following order: 1.) Read all default settings: These are located under: `<project_root>/config/*/default.cfg` 2.) Read the user's config settings: This is locate...
python
def _readall(self): """Read configs from all available configs. It will read files in the following order: 1.) Read all default settings: These are located under: `<project_root>/config/*/default.cfg` 2.) Read the user's config settings: This is locate...
[ "def", "_readall", "(", "self", ")", ":", "# First priority -- read all default configs", "config_path", "=", "os", ".", "path", ".", "dirname", "(", "__file__", ")", "config_defaults", "=", "[", "os", ".", "path", ".", "join", "(", "dirpath", ",", "f", ")",...
Read configs from all available configs. It will read files in the following order: 1.) Read all default settings: These are located under: `<project_root>/config/*/default.cfg` 2.) Read the user's config settings: This is located on the path: `~/.aftrc` ...
[ "Read", "configs", "from", "all", "available", "configs", ".", "It", "will", "read", "files", "in", "the", "following", "order", ":" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/config/abstract_config.py#L52-L97
train
Shapeways/coyote_framework
coyote_framework/util/apps/parallel.py
run_parallel
def run_parallel(*functions): """Runs a series of functions in parallel. Return values are ordered by the order in which their functions were passed. >>> val1, val2 = run_parallel( >>> lambda: 1 + 1 >>> lambda: 0 >>> ) If an exception is raised within one of the pro...
python
def run_parallel(*functions): """Runs a series of functions in parallel. Return values are ordered by the order in which their functions were passed. >>> val1, val2 = run_parallel( >>> lambda: 1 + 1 >>> lambda: 0 >>> ) If an exception is raised within one of the pro...
[ "def", "run_parallel", "(", "*", "functions", ")", ":", "def", "target", "(", "fn", ")", ":", "def", "wrapped", "(", "results_queue", ",", "error_queue", ",", "index", ")", ":", "result", "=", "None", "try", ":", "result", "=", "fn", "(", ")", "excep...
Runs a series of functions in parallel. Return values are ordered by the order in which their functions were passed. >>> val1, val2 = run_parallel( >>> lambda: 1 + 1 >>> lambda: 0 >>> ) If an exception is raised within one of the processes, that exception will be caught...
[ "Runs", "a", "series", "of", "functions", "in", "parallel", ".", "Return", "values", "are", "ordered", "by", "the", "order", "in", "which", "their", "functions", "were", "passed", "." ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/util/apps/parallel.py#L17-L76
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriver/browsercapabilities.py
copy_and_update
def copy_and_update(dictionary, update): """Returns an updated copy of the dictionary without modifying the original""" newdict = dictionary.copy() newdict.update(update) return newdict
python
def copy_and_update(dictionary, update): """Returns an updated copy of the dictionary without modifying the original""" newdict = dictionary.copy() newdict.update(update) return newdict
[ "def", "copy_and_update", "(", "dictionary", ",", "update", ")", ":", "newdict", "=", "dictionary", ".", "copy", "(", ")", "newdict", ".", "update", "(", "update", ")", "return", "newdict" ]
Returns an updated copy of the dictionary without modifying the original
[ "Returns", "an", "updated", "copy", "of", "the", "dictionary", "without", "modifying", "the", "original" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriver/browsercapabilities.py#L4-L8
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/staticreader.py
get_static_directory
def get_static_directory(): """Retrieves the full path of the static directory @return: Full path of the static directory """ directory = templates_dir = os.path.join(os.path.dirname(__file__), 'static') return directory
python
def get_static_directory(): """Retrieves the full path of the static directory @return: Full path of the static directory """ directory = templates_dir = os.path.join(os.path.dirname(__file__), 'static') return directory
[ "def", "get_static_directory", "(", ")", ":", "directory", "=", "templates_dir", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "'static'", ")", "return", "directory" ]
Retrieves the full path of the static directory @return: Full path of the static directory
[ "Retrieves", "the", "full", "path", "of", "the", "static", "directory" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/staticreader.py#L10-L16
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/staticreader.py
read_html_file
def read_html_file(filename): """Reads the contents of an html file in the css directory @return: Contents of the specified file """ with open(os.path.join(get_static_directory(), 'html/{filename}'.format(filename=filename))) as f: contents = f.read() return contents
python
def read_html_file(filename): """Reads the contents of an html file in the css directory @return: Contents of the specified file """ with open(os.path.join(get_static_directory(), 'html/{filename}'.format(filename=filename))) as f: contents = f.read() return contents
[ "def", "read_html_file", "(", "filename", ")", ":", "with", "open", "(", "os", ".", "path", ".", "join", "(", "get_static_directory", "(", ")", ",", "'html/{filename}'", ".", "format", "(", "filename", "=", "filename", ")", ")", ")", "as", "f", ":", "c...
Reads the contents of an html file in the css directory @return: Contents of the specified file
[ "Reads", "the", "contents", "of", "an", "html", "file", "in", "the", "css", "directory" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/staticreader.py#L29-L36
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/LocatorHandler.py
LocatorHandler.parse_locator
def parse_locator(locator): """ Parses a valid selenium By and value from a locator; returns as a named tuple with properties 'By' and 'value' locator -- a valid element locator or css string """ # handle backwards compatibility to support new Locator class if i...
python
def parse_locator(locator): """ Parses a valid selenium By and value from a locator; returns as a named tuple with properties 'By' and 'value' locator -- a valid element locator or css string """ # handle backwards compatibility to support new Locator class if i...
[ "def", "parse_locator", "(", "locator", ")", ":", "# handle backwards compatibility to support new Locator class", "if", "isinstance", "(", "locator", ",", "loc", ".", "Locator", ")", ":", "locator", "=", "'{by}={locator}'", ".", "format", "(", "by", "=", "locator",...
Parses a valid selenium By and value from a locator; returns as a named tuple with properties 'By' and 'value' locator -- a valid element locator or css string
[ "Parses", "a", "valid", "selenium", "By", "and", "value", "from", "a", "locator", ";", "returns", "as", "a", "named", "tuple", "with", "properties", "By", "and", "value" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/LocatorHandler.py#L16-L36
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/LocatorHandler.py
LocatorHandler.find_by_locator
def find_by_locator(webdriver_or_element, locator, find_all_elements=False): """ Locate an element using either a webdriver or webelement @param webdriver_or_element: Webdriver or Webelement object used for search @type locator: webdriver.webdriverwrapper.support.loc...
python
def find_by_locator(webdriver_or_element, locator, find_all_elements=False): """ Locate an element using either a webdriver or webelement @param webdriver_or_element: Webdriver or Webelement object used for search @type locator: webdriver.webdriverwrapper.support.loc...
[ "def", "find_by_locator", "(", "webdriver_or_element", ",", "locator", ",", "find_all_elements", "=", "False", ")", ":", "# handle backwards compatibility to support new Locator class", "if", "isinstance", "(", "locator", ",", "loc", ".", "Locator", ")", ":", "locator",...
Locate an element using either a webdriver or webelement @param webdriver_or_element: Webdriver or Webelement object used for search @type locator: webdriver.webdriverwrapper.support.locator.Locator @param locator: locator used in search @type find_al...
[ "Locate", "an", "element", "using", "either", "a", "webdriver", "or", "webelement" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/LocatorHandler.py#L39-L111
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.spin_assert
def spin_assert(self, assertion, failure_message='Failed Assertion', timeout=None): """ Asserts that assertion function passed to it will return True, trying every 'step' seconds until 'timeout' seconds have passed. """ timeout = self.timeout if timeout is None else timeout ...
python
def spin_assert(self, assertion, failure_message='Failed Assertion', timeout=None): """ Asserts that assertion function passed to it will return True, trying every 'step' seconds until 'timeout' seconds have passed. """ timeout = self.timeout if timeout is None else timeout ...
[ "def", "spin_assert", "(", "self", ",", "assertion", ",", "failure_message", "=", "'Failed Assertion'", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "self", ".", "timeout", "if", "timeout", "is", "None", "else", "timeout", "time_spent", "=", "0", ...
Asserts that assertion function passed to it will return True, trying every 'step' seconds until 'timeout' seconds have passed.
[ "Asserts", "that", "assertion", "function", "passed", "to", "it", "will", "return", "True", "trying", "every", "step", "seconds", "until", "timeout", "seconds", "have", "passed", "." ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L29-L44
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.webdriver_assert
def webdriver_assert(self, assertion, failure_message='Failed Assertion'): """ Assert the assertion, but throw a WebDriverAssertionException if assertion fails """ try: assert assertion() is True except AssertionError: raise WebDriverAssertionException.Web...
python
def webdriver_assert(self, assertion, failure_message='Failed Assertion'): """ Assert the assertion, but throw a WebDriverAssertionException if assertion fails """ try: assert assertion() is True except AssertionError: raise WebDriverAssertionException.Web...
[ "def", "webdriver_assert", "(", "self", ",", "assertion", ",", "failure_message", "=", "'Failed Assertion'", ")", ":", "try", ":", "assert", "assertion", "(", ")", "is", "True", "except", "AssertionError", ":", "raise", "WebDriverAssertionException", ".", "WebDriv...
Assert the assertion, but throw a WebDriverAssertionException if assertion fails
[ "Assert", "the", "assertion", "but", "throw", "a", "WebDriverAssertionException", "if", "assertion", "fails" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L46-L55
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_true
def assert_true(self, value, failure_message='Expected value to be True, was: {}'): """ Asserts that a value is true @type value: bool @param value: value to test for True """ assertion = lambda: bool(value) self.webdriver_assert(assertion, unicode(failure_m...
python
def assert_true(self, value, failure_message='Expected value to be True, was: {}'): """ Asserts that a value is true @type value: bool @param value: value to test for True """ assertion = lambda: bool(value) self.webdriver_assert(assertion, unicode(failure_m...
[ "def", "assert_true", "(", "self", ",", "value", ",", "failure_message", "=", "'Expected value to be True, was: {}'", ")", ":", "assertion", "=", "lambda", ":", "bool", "(", "value", ")", "self", ".", "webdriver_assert", "(", "assertion", ",", "unicode", "(", ...
Asserts that a value is true @type value: bool @param value: value to test for True
[ "Asserts", "that", "a", "value", "is", "true" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L63-L71
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_equals
def assert_equals(self, actual_val, expected_val, failure_message='Expected values to be equal: "{}" and "{}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the '==' operator """ assertion = lambda: expected_val == act...
python
def assert_equals(self, actual_val, expected_val, failure_message='Expected values to be equal: "{}" and "{}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the '==' operator """ assertion = lambda: expected_val == act...
[ "def", "assert_equals", "(", "self", ",", "actual_val", ",", "expected_val", ",", "failure_message", "=", "'Expected values to be equal: \"{}\" and \"{}\"'", ")", ":", "assertion", "=", "lambda", ":", "expected_val", "==", "actual_val", "self", ".", "webdriver_assert", ...
Calls smart_assert, but creates its own assertion closure using the expected and provided values with the '==' operator
[ "Calls", "smart_assert", "but", "creates", "its", "own", "assertion", "closure", "using", "the", "expected", "and", "provided", "values", "with", "the", "==", "operator" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L83-L89
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_numbers_almost_equal
def assert_numbers_almost_equal(self, actual_val, expected_val, allowed_delta=0.0001, failure_message='Expected numbers to be within {} of each other: "{}" and "{}"'): """ Asserts that two numbers are within an allowed delta of each other """ assertion...
python
def assert_numbers_almost_equal(self, actual_val, expected_val, allowed_delta=0.0001, failure_message='Expected numbers to be within {} of each other: "{}" and "{}"'): """ Asserts that two numbers are within an allowed delta of each other """ assertion...
[ "def", "assert_numbers_almost_equal", "(", "self", ",", "actual_val", ",", "expected_val", ",", "allowed_delta", "=", "0.0001", ",", "failure_message", "=", "'Expected numbers to be within {} of each other: \"{}\" and \"{}\"'", ")", ":", "assertion", "=", "lambda", ":", "...
Asserts that two numbers are within an allowed delta of each other
[ "Asserts", "that", "two", "numbers", "are", "within", "an", "allowed", "delta", "of", "each", "other" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L91-L97
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_not_equal
def assert_not_equal(self, actual_val, unexpected_val, failure_message='Expected values to differ: "{}" and "{}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the '!=' operator """ assertion = lambda: unexpected_val !...
python
def assert_not_equal(self, actual_val, unexpected_val, failure_message='Expected values to differ: "{}" and "{}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the '!=' operator """ assertion = lambda: unexpected_val !...
[ "def", "assert_not_equal", "(", "self", ",", "actual_val", ",", "unexpected_val", ",", "failure_message", "=", "'Expected values to differ: \"{}\" and \"{}\"'", ")", ":", "assertion", "=", "lambda", ":", "unexpected_val", "!=", "actual_val", "self", ".", "webdriver_asse...
Calls smart_assert, but creates its own assertion closure using the expected and provided values with the '!=' operator
[ "Calls", "smart_assert", "but", "creates", "its", "own", "assertion", "closure", "using", "the", "expected", "and", "provided", "values", "with", "the", "!", "=", "operator" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L99-L105
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_is
def assert_is(self, actual_val, expected_type, failure_message='Expected type to be "{1}," but was "{0}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'is' operator """ assertion = lambda: expected_type is actual_...
python
def assert_is(self, actual_val, expected_type, failure_message='Expected type to be "{1}," but was "{0}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'is' operator """ assertion = lambda: expected_type is actual_...
[ "def", "assert_is", "(", "self", ",", "actual_val", ",", "expected_type", ",", "failure_message", "=", "'Expected type to be \"{1},\" but was \"{0}\"'", ")", ":", "assertion", "=", "lambda", ":", "expected_type", "is", "actual_val", "self", ".", "webdriver_assert", "(...
Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'is' operator
[ "Calls", "smart_assert", "but", "creates", "its", "own", "assertion", "closure", "using", "the", "expected", "and", "provided", "values", "with", "the", "is", "operator" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L107-L113
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_is_not
def assert_is_not(self, actual_val, unexpected_type, failure_message='Expected type not to be "{1}," but was "{0}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'is not' operator """ assertio...
python
def assert_is_not(self, actual_val, unexpected_type, failure_message='Expected type not to be "{1}," but was "{0}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'is not' operator """ assertio...
[ "def", "assert_is_not", "(", "self", ",", "actual_val", ",", "unexpected_type", ",", "failure_message", "=", "'Expected type not to be \"{1},\" but was \"{0}\"'", ")", ":", "assertion", "=", "lambda", ":", "unexpected_type", "is", "not", "actual_val", "self", ".", "we...
Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'is not' operator
[ "Calls", "smart_assert", "but", "creates", "its", "own", "assertion", "closure", "using", "the", "expected", "and", "provided", "values", "with", "the", "is", "not", "operator" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L115-L122
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_in
def assert_in(self, actual_collection_or_string, expected_value, failure_message='Expected "{1}" to be in "{0}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'in' operator """ assertion = lambda: expected_value in...
python
def assert_in(self, actual_collection_or_string, expected_value, failure_message='Expected "{1}" to be in "{0}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'in' operator """ assertion = lambda: expected_value in...
[ "def", "assert_in", "(", "self", ",", "actual_collection_or_string", ",", "expected_value", ",", "failure_message", "=", "'Expected \"{1}\" to be in \"{0}\"'", ")", ":", "assertion", "=", "lambda", ":", "expected_value", "in", "actual_collection_or_string", "self", ".", ...
Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'in' operator
[ "Calls", "smart_assert", "but", "creates", "its", "own", "assertion", "closure", "using", "the", "expected", "and", "provided", "values", "with", "the", "in", "operator" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L124-L130
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_not_in
def assert_not_in(self, actual_collection_or_string, unexpected_value, failure_message='Expected "{1}" not to be in "{0}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'not in' operator """ a...
python
def assert_not_in(self, actual_collection_or_string, unexpected_value, failure_message='Expected "{1}" not to be in "{0}"'): """ Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'not in' operator """ a...
[ "def", "assert_not_in", "(", "self", ",", "actual_collection_or_string", ",", "unexpected_value", ",", "failure_message", "=", "'Expected \"{1}\" not to be in \"{0}\"'", ")", ":", "assertion", "=", "lambda", ":", "unexpected_value", "not", "in", "actual_collection_or_string...
Calls smart_assert, but creates its own assertion closure using the expected and provided values with the 'not in' operator
[ "Calls", "smart_assert", "but", "creates", "its", "own", "assertion", "closure", "using", "the", "expected", "and", "provided", "values", "with", "the", "not", "in", "operator" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L132-L139
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_page_source_contains
def assert_page_source_contains(self, expected_value, failure_message='Expected page source to contain: "{}"'): """ Asserts that the page source contains the string passed in expected_value """ assertion = lambda: expected_value in self.driver_wrapper.page_source() self.webdriver...
python
def assert_page_source_contains(self, expected_value, failure_message='Expected page source to contain: "{}"'): """ Asserts that the page source contains the string passed in expected_value """ assertion = lambda: expected_value in self.driver_wrapper.page_source() self.webdriver...
[ "def", "assert_page_source_contains", "(", "self", ",", "expected_value", ",", "failure_message", "=", "'Expected page source to contain: \"{}\"'", ")", ":", "assertion", "=", "lambda", ":", "expected_value", "in", "self", ".", "driver_wrapper", ".", "page_source", "(",...
Asserts that the page source contains the string passed in expected_value
[ "Asserts", "that", "the", "page", "source", "contains", "the", "string", "passed", "in", "expected_value" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L141-L146
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_union
def assert_union(self, collection1, collection2, failure_message='Expected overlap between collections: "{}" and "{}"'): """ Asserts that the union of two sets has at least one member (collections share at least one member) """ assertion = lambda: len(collection1 or ...
python
def assert_union(self, collection1, collection2, failure_message='Expected overlap between collections: "{}" and "{}"'): """ Asserts that the union of two sets has at least one member (collections share at least one member) """ assertion = lambda: len(collection1 or ...
[ "def", "assert_union", "(", "self", ",", "collection1", ",", "collection2", ",", "failure_message", "=", "'Expected overlap between collections: \"{}\" and \"{}\"'", ")", ":", "assertion", "=", "lambda", ":", "len", "(", "collection1", "or", "collection2", ")", ">", ...
Asserts that the union of two sets has at least one member (collections share at least one member)
[ "Asserts", "that", "the", "union", "of", "two", "sets", "has", "at", "least", "one", "member", "(", "collections", "share", "at", "least", "one", "member", ")" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L148-L155
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_no_union
def assert_no_union(self, collection1, collection2, failure_message='Expected no overlap between collections: "{}" and "{}"'): """ Asserts that the union of two sets is empty (collections are unique) """ assertion = lambda: len(set(collection1).intersection(set(co...
python
def assert_no_union(self, collection1, collection2, failure_message='Expected no overlap between collections: "{}" and "{}"'): """ Asserts that the union of two sets is empty (collections are unique) """ assertion = lambda: len(set(collection1).intersection(set(co...
[ "def", "assert_no_union", "(", "self", ",", "collection1", ",", "collection2", ",", "failure_message", "=", "'Expected no overlap between collections: \"{}\" and \"{}\"'", ")", ":", "assertion", "=", "lambda", ":", "len", "(", "set", "(", "collection1", ")", ".", "i...
Asserts that the union of two sets is empty (collections are unique)
[ "Asserts", "that", "the", "union", "of", "two", "sets", "is", "empty", "(", "collections", "are", "unique", ")" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L157-L164
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py
WebDriverWrapperAssertion.assert_subset
def assert_subset(self, subset, superset, failure_message='Expected collection "{}" to be a subset of "{}'): """ Asserts that a superset contains all elements of a subset """ assertion = lambda: set(subset).issubset(set(superset)) failure_message = unicode(failure_message).format...
python
def assert_subset(self, subset, superset, failure_message='Expected collection "{}" to be a subset of "{}'): """ Asserts that a superset contains all elements of a subset """ assertion = lambda: set(subset).issubset(set(superset)) failure_message = unicode(failure_message).format...
[ "def", "assert_subset", "(", "self", ",", "subset", ",", "superset", ",", "failure_message", "=", "'Expected collection \"{}\" to be a subset of \"{}'", ")", ":", "assertion", "=", "lambda", ":", "set", "(", "subset", ")", ".", "issubset", "(", "set", "(", "supe...
Asserts that a superset contains all elements of a subset
[ "Asserts", "that", "a", "superset", "contains", "all", "elements", "of", "a", "subset" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/WebDriverWrapperAssertion.py#L166-L172
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.clear
def clear(self): """ Clears the field represented by this element @rtype: WebElementWrapper @return: Returns itself """ def clear_element(): """ Wrapper to clear element """ return self.element.clear() self.e...
python
def clear(self): """ Clears the field represented by this element @rtype: WebElementWrapper @return: Returns itself """ def clear_element(): """ Wrapper to clear element """ return self.element.clear() self.e...
[ "def", "clear", "(", "self", ")", ":", "def", "clear_element", "(", ")", ":", "\"\"\"\n Wrapper to clear element\n \"\"\"", "return", "self", ".", "element", ".", "clear", "(", ")", "self", ".", "execute_and_handle_webelement_exceptions", "(", "c...
Clears the field represented by this element @rtype: WebElementWrapper @return: Returns itself
[ "Clears", "the", "field", "represented", "by", "this", "element" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L94-L107
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.delete_content
def delete_content(self, max_chars=100): """ Deletes content in the input field by repeatedly typing HOME, then DELETE @rtype: WebElementWrapper @return: Returns itself """ def delete_content_element(): chars_deleted = 0 while len(self.get_...
python
def delete_content(self, max_chars=100): """ Deletes content in the input field by repeatedly typing HOME, then DELETE @rtype: WebElementWrapper @return: Returns itself """ def delete_content_element(): chars_deleted = 0 while len(self.get_...
[ "def", "delete_content", "(", "self", ",", "max_chars", "=", "100", ")", ":", "def", "delete_content_element", "(", ")", ":", "chars_deleted", "=", "0", "while", "len", "(", "self", ".", "get_attribute", "(", "'value'", ")", ")", ">", "0", "and", "chars_...
Deletes content in the input field by repeatedly typing HOME, then DELETE @rtype: WebElementWrapper @return: Returns itself
[ "Deletes", "content", "in", "the", "input", "field", "by", "repeatedly", "typing", "HOME", "then", "DELETE" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L109-L125
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.click
def click(self, force_click=False): """ Clicks the element @type force_click: bool @param force_click: force a click on the element using javascript, skipping webdriver @rtype: WebElementWrapper @return: Returns itself """ js_exec...
python
def click(self, force_click=False): """ Clicks the element @type force_click: bool @param force_click: force a click on the element using javascript, skipping webdriver @rtype: WebElementWrapper @return: Returns itself """ js_exec...
[ "def", "click", "(", "self", ",", "force_click", "=", "False", ")", ":", "js_executor", "=", "self", ".", "driver_wrapper", ".", "js_executor", "def", "click_element", "(", ")", ":", "\"\"\"\n Wrapper to call click\n \"\"\"", "return", "self", ...
Clicks the element @type force_click: bool @param force_click: force a click on the element using javascript, skipping webdriver @rtype: WebElementWrapper @return: Returns itself
[ "Clicks", "the", "element" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L127-L157
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.get_value
def get_value(self): """Gets the value of a select or input element @rtype: str @return: The value of the element @raise: ValueError if element is not of type input or select, or has multiple selected options """ def get_element_value(): if self.tag_name() ==...
python
def get_value(self): """Gets the value of a select or input element @rtype: str @return: The value of the element @raise: ValueError if element is not of type input or select, or has multiple selected options """ def get_element_value(): if self.tag_name() ==...
[ "def", "get_value", "(", "self", ")", ":", "def", "get_element_value", "(", ")", ":", "if", "self", ".", "tag_name", "(", ")", "==", "'input'", ":", "return", "self", ".", "get_attribute", "(", "'value'", ")", "elif", "self", ".", "tag_name", "(", ")",...
Gets the value of a select or input element @rtype: str @return: The value of the element @raise: ValueError if element is not of type input or select, or has multiple selected options
[ "Gets", "the", "value", "of", "a", "select", "or", "input", "element" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L159-L180
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.get_attribute
def get_attribute(self, name): """ Retrieves specified attribute from WebElement @type name: str @param name: Attribute to retrieve @rtype: str @return: String representation of the attribute """ def get_attribute_element(): ...
python
def get_attribute(self, name): """ Retrieves specified attribute from WebElement @type name: str @param name: Attribute to retrieve @rtype: str @return: String representation of the attribute """ def get_attribute_element(): ...
[ "def", "get_attribute", "(", "self", ",", "name", ")", ":", "def", "get_attribute_element", "(", ")", ":", "\"\"\"\n Wrapper to retrieve element\n \"\"\"", "return", "self", ".", "element", ".", "get_attribute", "(", "name", ")", "return", "self"...
Retrieves specified attribute from WebElement @type name: str @param name: Attribute to retrieve @rtype: str @return: String representation of the attribute
[ "Retrieves", "specified", "attribute", "from", "WebElement" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L182-L197
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.is_on_screen
def is_on_screen(self): """Tests if the element is within the viewport of the screen (partially hidden by overflow will return true) @return: True if on screen, False otherwise """ width = self.get_width() height = self.get_height() loc = self.location() el_x_lef...
python
def is_on_screen(self): """Tests if the element is within the viewport of the screen (partially hidden by overflow will return true) @return: True if on screen, False otherwise """ width = self.get_width() height = self.get_height() loc = self.location() el_x_lef...
[ "def", "is_on_screen", "(", "self", ")", ":", "width", "=", "self", ".", "get_width", "(", ")", "height", "=", "self", ".", "get_height", "(", ")", "loc", "=", "self", ".", "location", "(", ")", "el_x_left", "=", "loc", "[", "'x'", "]", "el_x_right",...
Tests if the element is within the viewport of the screen (partially hidden by overflow will return true) @return: True if on screen, False otherwise
[ "Tests", "if", "the", "element", "is", "within", "the", "viewport", "of", "the", "screen", "(", "partially", "hidden", "by", "overflow", "will", "return", "true", ")" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L230-L251
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.send_special_keys
def send_special_keys(self, value): """ Send special keys such as <enter> or <delete> @rtype: WebElementWrapper @return: Self """ def send_keys_element(): """ Wrapper to send keys """ return self.element.send_keys(va...
python
def send_special_keys(self, value): """ Send special keys such as <enter> or <delete> @rtype: WebElementWrapper @return: Self """ def send_keys_element(): """ Wrapper to send keys """ return self.element.send_keys(va...
[ "def", "send_special_keys", "(", "self", ",", "value", ")", ":", "def", "send_keys_element", "(", ")", ":", "\"\"\"\n Wrapper to send keys\n \"\"\"", "return", "self", ".", "element", ".", "send_keys", "(", "value", ")", "self", ".", "execute_a...
Send special keys such as <enter> or <delete> @rtype: WebElementWrapper @return: Self
[ "Send", "special", "keys", "such", "as", "<enter", ">", "or", "<delete", ">" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L281-L294
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.set
def set(self, val, force_set=False): """ Sets an input with a specified value; if force_set=True, will set through javascript if webdriver fails NOTE: if val is None, this function will interpret this to be an empty string @type val: str @param val: string to se...
python
def set(self, val, force_set=False): """ Sets an input with a specified value; if force_set=True, will set through javascript if webdriver fails NOTE: if val is None, this function will interpret this to be an empty string @type val: str @param val: string to se...
[ "def", "set", "(", "self", ",", "val", ",", "force_set", "=", "False", ")", ":", "if", "val", "is", "None", ":", "val", "=", "\"\"", "self", ".", "click", "(", "force_click", "=", "True", "if", "force_set", "else", "False", ")", "self", ".", "clear...
Sets an input with a specified value; if force_set=True, will set through javascript if webdriver fails NOTE: if val is None, this function will interpret this to be an empty string @type val: str @param val: string to send to element @type force_set: bool @p...
[ "Sets", "an", "input", "with", "a", "specified", "value", ";", "if", "force_set", "=", "True", "will", "set", "through", "javascript", "if", "webdriver", "fails", "NOTE", ":", "if", "val", "is", "None", "this", "function", "will", "interpret", "this", "to"...
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L311-L347
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.submit
def submit(self): """ Submit a webe element @rtype: WebElementWrapper @return: Self """ def submit_element(): """ Wrapper to submit element """ return self.element.submit() self.execute_and_handle_webelement_...
python
def submit(self): """ Submit a webe element @rtype: WebElementWrapper @return: Self """ def submit_element(): """ Wrapper to submit element """ return self.element.submit() self.execute_and_handle_webelement_...
[ "def", "submit", "(", "self", ")", ":", "def", "submit_element", "(", ")", ":", "\"\"\"\n Wrapper to submit element\n \"\"\"", "return", "self", ".", "element", ".", "submit", "(", ")", "self", ".", "execute_and_handle_webelement_exceptions", "(", ...
Submit a webe element @rtype: WebElementWrapper @return: Self
[ "Submit", "a", "webe", "element" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L349-L362
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.value_of_css_property
def value_of_css_property(self, property_name): """ Get value of CSS property for element @rtype: str @return: value of CSS property """ def value_of_css_property_element(): """ Wrapper to get css property """ return...
python
def value_of_css_property(self, property_name): """ Get value of CSS property for element @rtype: str @return: value of CSS property """ def value_of_css_property_element(): """ Wrapper to get css property """ return...
[ "def", "value_of_css_property", "(", "self", ",", "property_name", ")", ":", "def", "value_of_css_property_element", "(", ")", ":", "\"\"\"\n Wrapper to get css property\n \"\"\"", "return", "self", ".", "element", ".", "value_of_css_property", "(", "p...
Get value of CSS property for element @rtype: str @return: value of CSS property
[ "Get", "value", "of", "CSS", "property", "for", "element" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L364-L377
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.has_class
def has_class(self, classname): """Test if an element has a specific classname @type classname: str @param classname: Classname to test for; cannot contain spaces @rtype: bool @return: True if classname exists; false otherwise """ def element_has_class(): ...
python
def has_class(self, classname): """Test if an element has a specific classname @type classname: str @param classname: Classname to test for; cannot contain spaces @rtype: bool @return: True if classname exists; false otherwise """ def element_has_class(): ...
[ "def", "has_class", "(", "self", ",", "classname", ")", ":", "def", "element_has_class", "(", ")", ":", "\"\"\"Wrapper to test if element has a class\"\"\"", "pattern", "=", "re", ".", "compile", "(", "'(\\s|^){classname}(\\s|$)'", ".", "format", "(", "classname", "...
Test if an element has a specific classname @type classname: str @param classname: Classname to test for; cannot contain spaces @rtype: bool @return: True if classname exists; false otherwise
[ "Test", "if", "an", "element", "has", "a", "specific", "classname" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L379-L400
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.parent
def parent(self): """ Get the parent of the element @rtype: WebElementWrapper @return: Parent of webelementwrapper on which this was invoked """ def parent_element(): """ Wrapper to retrieve parent element """ return...
python
def parent(self): """ Get the parent of the element @rtype: WebElementWrapper @return: Parent of webelementwrapper on which this was invoked """ def parent_element(): """ Wrapper to retrieve parent element """ return...
[ "def", "parent", "(", "self", ")", ":", "def", "parent_element", "(", ")", ":", "\"\"\"\n Wrapper to retrieve parent element\n \"\"\"", "return", "WebElementWrapper", "(", "self", ".", "driver_wrapper", ",", "self", ".", "locator", ",", "self", "...
Get the parent of the element @rtype: WebElementWrapper @return: Parent of webelementwrapper on which this was invoked
[ "Get", "the", "parent", "of", "the", "element" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L431-L443
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.parent_element
def parent_element(self): """ Get the parent of the element @rtype: WebElementWrapper @return: Parent of webelementwrapper on which this was invoked """ def parent_element(): """ Wrapper to get parent element """ par...
python
def parent_element(self): """ Get the parent of the element @rtype: WebElementWrapper @return: Parent of webelementwrapper on which this was invoked """ def parent_element(): """ Wrapper to get parent element """ par...
[ "def", "parent_element", "(", "self", ")", ":", "def", "parent_element", "(", ")", ":", "\"\"\"\n Wrapper to get parent element\n \"\"\"", "parent", "=", "self", ".", "driver_wrapper", ".", "execute_script", "(", "'return arguments[0].parentNode;'", ",...
Get the parent of the element @rtype: WebElementWrapper @return: Parent of webelementwrapper on which this was invoked
[ "Get", "the", "parent", "of", "the", "element" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L445-L460
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.text
def text(self, force_get=False): """ Get the text of the element @rtype: str @return: Text of the element """ def text_element(): """ Wrapper to get text of element """ return self.element.text def force_tex...
python
def text(self, force_get=False): """ Get the text of the element @rtype: str @return: Text of the element """ def text_element(): """ Wrapper to get text of element """ return self.element.text def force_tex...
[ "def", "text", "(", "self", ",", "force_get", "=", "False", ")", ":", "def", "text_element", "(", ")", ":", "\"\"\"\n Wrapper to get text of element\n \"\"\"", "return", "self", ".", "element", ".", "text", "def", "force_text_element", "(", ")"...
Get the text of the element @rtype: str @return: Text of the element
[ "Get", "the", "text", "of", "the", "element" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L490-L512
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.highlight
def highlight(self): """ Draws a dotted red box around the wrapped element using javascript @rtype: WebElementWrapper @return: Self """ js_executor = self.driver_wrapper.js_executor def highlight_element(): """ Wrapper to highlight ...
python
def highlight(self): """ Draws a dotted red box around the wrapped element using javascript @rtype: WebElementWrapper @return: Self """ js_executor = self.driver_wrapper.js_executor def highlight_element(): """ Wrapper to highlight ...
[ "def", "highlight", "(", "self", ")", ":", "js_executor", "=", "self", ".", "driver_wrapper", ".", "js_executor", "def", "highlight_element", "(", ")", ":", "\"\"\"\n Wrapper to highlight elements\n \"\"\"", "location", "=", "self", ".", "element",...
Draws a dotted red box around the wrapped element using javascript @rtype: WebElementWrapper @return: Self
[ "Draws", "a", "dotted", "red", "box", "around", "the", "wrapped", "element", "using", "javascript" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L514-L535
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.set_attribute
def set_attribute(self, name, value): """Sets the attribute of the element to a specified value @type name: str @param name: the name of the attribute @type value: str @param value: the attribute of the value """ js_executor = self.driver_wrapper.js_e...
python
def set_attribute(self, name, value): """Sets the attribute of the element to a specified value @type name: str @param name: the name of the attribute @type value: str @param value: the attribute of the value """ js_executor = self.driver_wrapper.js_e...
[ "def", "set_attribute", "(", "self", ",", "name", ",", "value", ")", ":", "js_executor", "=", "self", ".", "driver_wrapper", ".", "js_executor", "def", "set_attribute_element", "(", ")", ":", "\"\"\"\n Wrapper to set attribute\n \"\"\"", "js_execut...
Sets the attribute of the element to a specified value @type name: str @param name: the name of the attribute @type value: str @param value: the attribute of the value
[ "Sets", "the", "attribute", "of", "the", "element", "to", "a", "specified", "value" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L537-L556
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.select_option
def select_option(self, value=None, text=None, index=None): """ Selects an option by value, text, or index. You must name the parameter @type value: str @param value: the value of the option @type text: str @param text: the option's visible text @type...
python
def select_option(self, value=None, text=None, index=None): """ Selects an option by value, text, or index. You must name the parameter @type value: str @param value: the value of the option @type text: str @param text: the option's visible text @type...
[ "def", "select_option", "(", "self", ",", "value", "=", "None", ",", "text", "=", "None", ",", "index", "=", "None", ")", ":", "def", "do_select", "(", ")", ":", "\"\"\"\n Perform selection\n \"\"\"", "return", "self", ".", "set_select", ...
Selects an option by value, text, or index. You must name the parameter @type value: str @param value: the value of the option @type text: str @param text: the option's visible text @type index: int @param index: the zero-based index of the option ...
[ "Selects", "an", "option", "by", "value", "text", "or", "index", ".", "You", "must", "name", "the", "parameter" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L560-L579
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.deselect_option
def deselect_option(self, value=None, text=None, index=None): """ De-selects an option by value, text, or index. You must name the parameter @type value: str @param value: the value of the option @type text: str @param text: the option's visible text ...
python
def deselect_option(self, value=None, text=None, index=None): """ De-selects an option by value, text, or index. You must name the parameter @type value: str @param value: the value of the option @type text: str @param text: the option's visible text ...
[ "def", "deselect_option", "(", "self", ",", "value", "=", "None", ",", "text", "=", "None", ",", "index", "=", "None", ")", ":", "def", "do_deselect", "(", ")", ":", "\"\"\"\n Perform selection\n \"\"\"", "return", "self", ".", "set_select"...
De-selects an option by value, text, or index. You must name the parameter @type value: str @param value: the value of the option @type text: str @param text: the option's visible text @type index: int @param index: the zero-based index of the option ...
[ "De", "-", "selects", "an", "option", "by", "value", "text", "or", "index", ".", "You", "must", "name", "the", "parameter" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L581-L600
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.set_select
def set_select(self, select_or_deselect = 'select', value=None, text=None, index=None): """ Private method used by select methods @type select_or_deselect: str @param select_or_deselect: Should I select or deselect the element @type value: str @type val...
python
def set_select(self, select_or_deselect = 'select', value=None, text=None, index=None): """ Private method used by select methods @type select_or_deselect: str @param select_or_deselect: Should I select or deselect the element @type value: str @type val...
[ "def", "set_select", "(", "self", ",", "select_or_deselect", "=", "'select'", ",", "value", "=", "None", ",", "text", "=", "None", ",", "index", "=", "None", ")", ":", "# TODO: raise exception if element is not select element", "if", "select_or_deselect", "is", "'...
Private method used by select methods @type select_or_deselect: str @param select_or_deselect: Should I select or deselect the element @type value: str @type value: Value to be selected @type text: str @type text: ...
[ "Private", "method", "used", "by", "select", "methods" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L616-L653
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.checkbox_check
def checkbox_check(self, force_check=False): """ Wrapper to check a checkbox """ if not self.get_attribute('checked'): self.click(force_click=force_check)
python
def checkbox_check(self, force_check=False): """ Wrapper to check a checkbox """ if not self.get_attribute('checked'): self.click(force_click=force_check)
[ "def", "checkbox_check", "(", "self", ",", "force_check", "=", "False", ")", ":", "if", "not", "self", ".", "get_attribute", "(", "'checked'", ")", ":", "self", ".", "click", "(", "force_click", "=", "force_check", ")" ]
Wrapper to check a checkbox
[ "Wrapper", "to", "check", "a", "checkbox" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L655-L660
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.checkbox_uncheck
def checkbox_uncheck(self, force_check=False): """ Wrapper to uncheck a checkbox """ if self.get_attribute('checked'): self.click(force_click=force_check)
python
def checkbox_uncheck(self, force_check=False): """ Wrapper to uncheck a checkbox """ if self.get_attribute('checked'): self.click(force_click=force_check)
[ "def", "checkbox_uncheck", "(", "self", ",", "force_check", "=", "False", ")", ":", "if", "self", ".", "get_attribute", "(", "'checked'", ")", ":", "self", ".", "click", "(", "force_click", "=", "force_check", ")" ]
Wrapper to uncheck a checkbox
[ "Wrapper", "to", "uncheck", "a", "checkbox" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L662-L667
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.hover
def hover(self): """ Hovers the element """ def do_hover(): """ Perform hover """ ActionChains(self.driver_wrapper.driver).move_to_element(self.element).perform() return self.execute_and_handle_webelement_exceptions(do_hover, 'hover...
python
def hover(self): """ Hovers the element """ def do_hover(): """ Perform hover """ ActionChains(self.driver_wrapper.driver).move_to_element(self.element).perform() return self.execute_and_handle_webelement_exceptions(do_hover, 'hover...
[ "def", "hover", "(", "self", ")", ":", "def", "do_hover", "(", ")", ":", "\"\"\"\n Perform hover\n \"\"\"", "ActionChains", "(", "self", ".", "driver_wrapper", ".", "driver", ")", ".", "move_to_element", "(", "self", ".", "element", ")", "....
Hovers the element
[ "Hovers", "the", "element" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L677-L686
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.find
def find(self, locator, find_all=False, search_object=None, exclude_invisible=None, *args, **kwargs): """ Find wrapper, invokes webDriverWrapper find with the current element as the search object @type locator: webdriverwrapper.support.locator.Locator @param locator: lo...
python
def find(self, locator, find_all=False, search_object=None, exclude_invisible=None, *args, **kwargs): """ Find wrapper, invokes webDriverWrapper find with the current element as the search object @type locator: webdriverwrapper.support.locator.Locator @param locator: lo...
[ "def", "find", "(", "self", ",", "locator", ",", "find_all", "=", "False", ",", "search_object", "=", "None", ",", "exclude_invisible", "=", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "search_object", "=", "self", ".", "element", "if"...
Find wrapper, invokes webDriverWrapper find with the current element as the search object @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @type find_all: bool @param find_all: should I find all elements, or j...
[ "Find", "wrapper", "invokes", "webDriverWrapper", "find", "with", "the", "current", "element", "as", "the", "search", "object" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L688-L708
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.find_once
def find_once(self, locator): """ Find wrapper to run a single find @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @type find_all: bool @param find_all: should I find all elements, or just on...
python
def find_once(self, locator): """ Find wrapper to run a single find @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @type find_all: bool @param find_all: should I find all elements, or just on...
[ "def", "find_once", "(", "self", ",", "locator", ")", ":", "params", "=", "[", "]", "params", ".", "append", "(", "self", ".", "driver_wrapper", ".", "find_attempts", ")", "params", ".", "append", "(", "self", ".", "driver_wrapper", ".", "implicit_wait", ...
Find wrapper to run a single find @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @type find_all: bool @param find_all: should I find all elements, or just one? @rtype: WebElementWrap...
[ "Find", "wrapper", "to", "run", "a", "single", "find" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L710-L735
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.find_all
def find_all(self, locator): """ Find wrapper, finds all elements @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @rtype: list @return: A list of WebElementWrappers ""...
python
def find_all(self, locator): """ Find wrapper, finds all elements @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @rtype: list @return: A list of WebElementWrappers ""...
[ "def", "find_all", "(", "self", ",", "locator", ")", ":", "return", "self", ".", "driver_wrapper", ".", "find", "(", "locator", ",", "True", ",", "self", ".", "element", ")" ]
Find wrapper, finds all elements @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @rtype: list @return: A list of WebElementWrappers
[ "Find", "wrapper", "finds", "all", "elements" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L737-L747
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.is_present
def is_present(self, locator): """ Tests to see if an element is present @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @rtype: bool @return: True if present, False if not pr...
python
def is_present(self, locator): """ Tests to see if an element is present @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @rtype: bool @return: True if present, False if not pr...
[ "def", "is_present", "(", "self", ",", "locator", ")", ":", "return", "self", ".", "driver_wrapper", ".", "is_present", "(", "locator", ",", "search_object", "=", "self", ".", "element", ")" ]
Tests to see if an element is present @type locator: webdriverwrapper.support.locator.Locator @param locator: locator used in search @rtype: bool @return: True if present, False if not present
[ "Tests", "to", "see", "if", "an", "element", "is", "present" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L749-L759
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.wait_until_stale
def wait_until_stale(self, timeout=None): """ Waits for the element to go stale in the DOM @type timeout: int @param timeout: override for default timeout @rtype: WebElementWrapper @return: Self """ timeout...
python
def wait_until_stale(self, timeout=None): """ Waits for the element to go stale in the DOM @type timeout: int @param timeout: override for default timeout @rtype: WebElementWrapper @return: Self """ timeout...
[ "def", "wait_until_stale", "(", "self", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "if", "timeout", "is", "not", "None", "else", "self", ".", "driver_wrapper", ".", "timeout", "def", "wait", "(", ")", ":", "\"\"\"\n Wrapper ...
Waits for the element to go stale in the DOM @type timeout: int @param timeout: override for default timeout @rtype: WebElementWrapper @return: Self
[ "Waits", "for", "the", "element", "to", "go", "stale", "in", "the", "DOM" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L774-L793
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py
WebElementWrapper.execute_and_handle_webelement_exceptions
def execute_and_handle_webelement_exceptions(self, function_to_execute, name_of_action): """ Private method to be called by other methods to handle common WebDriverExceptions or throw a custom exception @type function_to_execute: types.FunctionType @param function_to_execut...
python
def execute_and_handle_webelement_exceptions(self, function_to_execute, name_of_action): """ Private method to be called by other methods to handle common WebDriverExceptions or throw a custom exception @type function_to_execute: types.FunctionType @param function_to_execut...
[ "def", "execute_and_handle_webelement_exceptions", "(", "self", ",", "function_to_execute", ",", "name_of_action", ")", ":", "if", "self", ".", "element", "is", "not", "None", ":", "attempts", "=", "0", "while", "attempts", "<", "self", ".", "driver_wrapper", "....
Private method to be called by other methods to handle common WebDriverExceptions or throw a custom exception @type function_to_execute: types.FunctionType @param function_to_execute: A function containing some webdriver calls @type name_of_action: str @param ...
[ "Private", "method", "to", "be", "called", "by", "other", "methods", "to", "handle", "common", "WebDriverExceptions", "or", "throw", "a", "custom", "exception" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/WebElementWrapper.py#L795-L850
train
Shapeways/coyote_framework
coyote_framework/requests/requestdriver.py
RequestDriver.request
def request(self, uri, method=GET, headers=None, cookies=None, params=None, data=None, post_files=None,**kwargs): """Makes a request using requests @param uri: The uri to send request @param method: Method to use to send request @param headers: Any headers to send with request @...
python
def request(self, uri, method=GET, headers=None, cookies=None, params=None, data=None, post_files=None,**kwargs): """Makes a request using requests @param uri: The uri to send request @param method: Method to use to send request @param headers: Any headers to send with request @...
[ "def", "request", "(", "self", ",", "uri", ",", "method", "=", "GET", ",", "headers", "=", "None", ",", "cookies", "=", "None", ",", "params", "=", "None", ",", "data", "=", "None", ",", "post_files", "=", "None", ",", "*", "*", "kwargs", ")", ":...
Makes a request using requests @param uri: The uri to send request @param method: Method to use to send request @param headers: Any headers to send with request @param cookies: Request cookies (in addition to session cookies) @param params: Request parameters @param data...
[ "Makes", "a", "request", "using", "requests" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/requests/requestdriver.py#L34-L80
train
Shapeways/coyote_framework
coyote_framework/requests/requestdriver.py
RequestDriver.save_last_response_to_file
def save_last_response_to_file(self, filename): """Saves the body of the last response to a file @param filename: Filename to save to @return: Returns False if there is an OS error, True if successful """ response = self.get_last_response() return self.save_response_to_f...
python
def save_last_response_to_file(self, filename): """Saves the body of the last response to a file @param filename: Filename to save to @return: Returns False if there is an OS error, True if successful """ response = self.get_last_response() return self.save_response_to_f...
[ "def", "save_last_response_to_file", "(", "self", ",", "filename", ")", ":", "response", "=", "self", ".", "get_last_response", "(", ")", "return", "self", ".", "save_response_to_file", "(", "response", ",", "filename", ")" ]
Saves the body of the last response to a file @param filename: Filename to save to @return: Returns False if there is an OS error, True if successful
[ "Saves", "the", "body", "of", "the", "last", "response", "to", "a", "file" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/requests/requestdriver.py#L96-L103
train
Shapeways/coyote_framework
coyote_framework/requests/requestdriver.py
RequestDriver.save_response_to_file
def save_response_to_file(self, response, filename): """Saves the body of the last response to a file @param filename: Filename to save to @return: Returns False if there is an OS error, True if successful """ try: last_response = self.get_last_response() ...
python
def save_response_to_file(self, response, filename): """Saves the body of the last response to a file @param filename: Filename to save to @return: Returns False if there is an OS error, True if successful """ try: last_response = self.get_last_response() ...
[ "def", "save_response_to_file", "(", "self", ",", "response", ",", "filename", ")", ":", "try", ":", "last_response", "=", "self", ".", "get_last_response", "(", ")", "with", "open", "(", "filename", ",", "'w'", ")", "as", "f", ":", "f", ".", "write", ...
Saves the body of the last response to a file @param filename: Filename to save to @return: Returns False if there is an OS error, True if successful
[ "Saves", "the", "body", "of", "the", "last", "response", "to", "a", "file" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/requests/requestdriver.py#L105-L117
train
Shapeways/coyote_framework
coyote_framework/mixins/URLValidator.py
validate_url
def validate_url(url, allowed_response_codes=None): """Validates that the url can be opened and responds with an allowed response code; ignores javascript: urls url -- the string url to ping allowed_response_codes -- a list of response codes that the validator will ignore """ allowed_response_codes...
python
def validate_url(url, allowed_response_codes=None): """Validates that the url can be opened and responds with an allowed response code; ignores javascript: urls url -- the string url to ping allowed_response_codes -- a list of response codes that the validator will ignore """ allowed_response_codes...
[ "def", "validate_url", "(", "url", ",", "allowed_response_codes", "=", "None", ")", ":", "allowed_response_codes", "=", "[", "200", "]", "if", "allowed_response_codes", "is", "None", "else", "allowed_response_codes", "# link calls a js function, do not try to open", "if",...
Validates that the url can be opened and responds with an allowed response code; ignores javascript: urls url -- the string url to ping allowed_response_codes -- a list of response codes that the validator will ignore
[ "Validates", "that", "the", "url", "can", "be", "opened", "and", "responds", "with", "an", "allowed", "response", "code", ";", "ignores", "javascript", ":", "urls" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/mixins/URLValidator.py#L6-L26
train
Shapeways/coyote_framework
coyote_framework/mixins/URLValidator.py
validate_urls
def validate_urls(urls, allowed_response_codes=None): """Validates that a list of urls can be opened and each responds with an allowed response code urls -- the list of urls to ping allowed_response_codes -- a list of response codes that the validator will ignore """ for url in urls: valid...
python
def validate_urls(urls, allowed_response_codes=None): """Validates that a list of urls can be opened and each responds with an allowed response code urls -- the list of urls to ping allowed_response_codes -- a list of response codes that the validator will ignore """ for url in urls: valid...
[ "def", "validate_urls", "(", "urls", ",", "allowed_response_codes", "=", "None", ")", ":", "for", "url", "in", "urls", ":", "validate_url", "(", "url", ",", "allowed_response_codes", "=", "allowed_response_codes", ")", "return", "True" ]
Validates that a list of urls can be opened and each responds with an allowed response code urls -- the list of urls to ping allowed_response_codes -- a list of response codes that the validator will ignore
[ "Validates", "that", "a", "list", "of", "urls", "can", "be", "opened", "and", "each", "responds", "with", "an", "allowed", "response", "code" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/mixins/URLValidator.py#L29-L38
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriver/driverfactory.py
DriverFactory.new_driver
def new_driver(browser_name, *args, **kwargs): """Instantiates a new WebDriver instance, determining class by environment variables """ if browser_name == FIREFOX: return webdriver.Firefox(*args, **kwargs) # elif options['local'] and options['browser_name'] == CHROME: ...
python
def new_driver(browser_name, *args, **kwargs): """Instantiates a new WebDriver instance, determining class by environment variables """ if browser_name == FIREFOX: return webdriver.Firefox(*args, **kwargs) # elif options['local'] and options['browser_name'] == CHROME: ...
[ "def", "new_driver", "(", "browser_name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "browser_name", "==", "FIREFOX", ":", "return", "webdriver", ".", "Firefox", "(", "*", "args", ",", "*", "*", "kwargs", ")", "# elif options['local'] and o...
Instantiates a new WebDriver instance, determining class by environment variables
[ "Instantiates", "a", "new", "WebDriver", "instance", "determining", "class", "by", "environment", "variables" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriver/driverfactory.py#L16-L39
train
Shapeways/coyote_framework
example/example_app/utility/urlbuilder.py
ExampleUrlBuilder.build_follow_url
def build_follow_url(host=None, **params): """ Build a URL for the /follow page """ # template = '?{params}' config = ExampleConfig() template = '/follow?{params}' if not host: host = config.get('example_web_hostname') return ExampleUrlBuild...
python
def build_follow_url(host=None, **params): """ Build a URL for the /follow page """ # template = '?{params}' config = ExampleConfig() template = '/follow?{params}' if not host: host = config.get('example_web_hostname') return ExampleUrlBuild...
[ "def", "build_follow_url", "(", "host", "=", "None", ",", "*", "*", "params", ")", ":", "# template = '?{params}'", "config", "=", "ExampleConfig", "(", ")", "template", "=", "'/follow?{params}'", "if", "not", "host", ":", "host", "=", "config", ".", "get", ...
Build a URL for the /follow page
[ "Build", "a", "URL", "for", "the", "/", "follow", "page" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/example/example_app/utility/urlbuilder.py#L14-L30
train
Shapeways/coyote_framework
coyote_framework/mixins/stringconversion.py
encode_collection
def encode_collection(collection, encoding='utf-8'): """Encodes all the string keys and values in a collection with specified encoding""" if isinstance(collection, dict): return dict((encode_collection(key), encode_collection(value)) for key, value in collection.iteritems()) elif isinstance(collect...
python
def encode_collection(collection, encoding='utf-8'): """Encodes all the string keys and values in a collection with specified encoding""" if isinstance(collection, dict): return dict((encode_collection(key), encode_collection(value)) for key, value in collection.iteritems()) elif isinstance(collect...
[ "def", "encode_collection", "(", "collection", ",", "encoding", "=", "'utf-8'", ")", ":", "if", "isinstance", "(", "collection", ",", "dict", ")", ":", "return", "dict", "(", "(", "encode_collection", "(", "key", ")", ",", "encode_collection", "(", "value", ...
Encodes all the string keys and values in a collection with specified encoding
[ "Encodes", "all", "the", "string", "keys", "and", "values", "in", "a", "collection", "with", "specified", "encoding" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/mixins/stringconversion.py#L4-L14
train
Shapeways/coyote_framework
coyote_framework/mixins/stringconversion.py
get_delimited_string_from_list
def get_delimited_string_from_list(_list, delimiter=', ', wrap_values_with_char=None, wrap_strings_with_char=None): """Given a list, returns a string representation of that list with specified delimiter and optional string chars _list -- the list or tuple to stringify delimiter -- the the character to sepe...
python
def get_delimited_string_from_list(_list, delimiter=', ', wrap_values_with_char=None, wrap_strings_with_char=None): """Given a list, returns a string representation of that list with specified delimiter and optional string chars _list -- the list or tuple to stringify delimiter -- the the character to sepe...
[ "def", "get_delimited_string_from_list", "(", "_list", ",", "delimiter", "=", "', '", ",", "wrap_values_with_char", "=", "None", ",", "wrap_strings_with_char", "=", "None", ")", ":", "if", "wrap_values_with_char", "is", "not", "None", ":", "return", "delimiter", "...
Given a list, returns a string representation of that list with specified delimiter and optional string chars _list -- the list or tuple to stringify delimiter -- the the character to seperate all values wrap_values_with_char -- if specified, will wrap all values in list with this character in the represen...
[ "Given", "a", "list", "returns", "a", "string", "representation", "of", "that", "list", "with", "specified", "delimiter", "and", "optional", "string", "chars" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/mixins/stringconversion.py#L17-L37
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/JavascriptExecutor.py
JavascriptExecutor.execute_script
def execute_script(self, string, args=None): """ Execute script passed in to function @type string: str @value string: Script to execute @type args: dict @value args: Dictionary representing command line args @rtype: int @rtype: ...
python
def execute_script(self, string, args=None): """ Execute script passed in to function @type string: str @value string: Script to execute @type args: dict @value args: Dictionary representing command line args @rtype: int @rtype: ...
[ "def", "execute_script", "(", "self", ",", "string", ",", "args", "=", "None", ")", ":", "result", "=", "None", "try", ":", "result", "=", "self", ".", "driver_wrapper", ".", "driver", ".", "execute_script", "(", "string", ",", "args", ")", "return", "...
Execute script passed in to function @type string: str @value string: Script to execute @type args: dict @value args: Dictionary representing command line args @rtype: int @rtype: response code
[ "Execute", "script", "passed", "in", "to", "function" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/JavascriptExecutor.py#L21-L44
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/JavascriptExecutor.py
JavascriptExecutor.execute_template
def execute_template(self, template_name, variables, args=None): """ Execute script from a template @type template_name: str @value template_name: Script template to implement @type args: dict @value args: Dictionary representing command line ...
python
def execute_template(self, template_name, variables, args=None): """ Execute script from a template @type template_name: str @value template_name: Script template to implement @type args: dict @value args: Dictionary representing command line ...
[ "def", "execute_template", "(", "self", ",", "template_name", ",", "variables", ",", "args", "=", "None", ")", ":", "js_text", "=", "self", ".", "build_js_from_template", "(", "template_name", ",", "variables", ")", "try", ":", "self", ".", "execute_script", ...
Execute script from a template @type template_name: str @value template_name: Script template to implement @type args: dict @value args: Dictionary representing command line args @rtype: bool @rtype: Success or...
[ "Execute", "script", "from", "a", "template" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/JavascriptExecutor.py#L46-L63
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/JavascriptExecutor.py
JavascriptExecutor.execute_template_and_return_result
def execute_template_and_return_result(self, template_name, variables, args=None): """ Execute script from a template and return result @type template_name: str @value template_name: Script template to implement @type variables: dict @value variables: D...
python
def execute_template_and_return_result(self, template_name, variables, args=None): """ Execute script from a template and return result @type template_name: str @value template_name: Script template to implement @type variables: dict @value variables: D...
[ "def", "execute_template_and_return_result", "(", "self", ",", "template_name", ",", "variables", ",", "args", "=", "None", ")", ":", "js_text", "=", "self", ".", "build_js_from_template", "(", "template_name", ",", "variables", ")", "return", "self", ".", "exec...
Execute script from a template and return result @type template_name: str @value template_name: Script template to implement @type variables: dict @value variables: Dictionary representing template construction args @type args: dict @value a...
[ "Execute", "script", "from", "a", "template", "and", "return", "result" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/JavascriptExecutor.py#L65-L80
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/JavascriptExecutor.py
JavascriptExecutor.build_js_from_template
def build_js_from_template(self, template_file, variables): """ Build a JS script from a template and args @type template_file: str @param template_file: Script template to implement; can be the name of a built-in script or full filepath to a js file...
python
def build_js_from_template(self, template_file, variables): """ Build a JS script from a template and args @type template_file: str @param template_file: Script template to implement; can be the name of a built-in script or full filepath to a js file...
[ "def", "build_js_from_template", "(", "self", ",", "template_file", ",", "variables", ")", ":", "template_variable_character", "=", "'%'", "# raise an exception if user passed non-dictionary variables", "if", "not", "isinstance", "(", "variables", ",", "dict", ")", ":", ...
Build a JS script from a template and args @type template_file: str @param template_file: Script template to implement; can be the name of a built-in script or full filepath to a js file that contains the script. E.g. 'clickElementTemplate.js', ...
[ "Build", "a", "JS", "script", "from", "a", "template", "and", "args" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/JavascriptExecutor.py#L82-L136
train
Shapeways/coyote_framework
coyote_framework/util/urls/urlbuilder.py
UrlBuilder.build
def build(template='/', host=None, scheme=None, port=None, **template_vars): """Builds a url with a string template and template variables; relative path if host is None, abs otherwise: template format: "/staticendpoint/{dynamic_endpoint}?{params}" """ # TODO: refactor to build_absol...
python
def build(template='/', host=None, scheme=None, port=None, **template_vars): """Builds a url with a string template and template variables; relative path if host is None, abs otherwise: template format: "/staticendpoint/{dynamic_endpoint}?{params}" """ # TODO: refactor to build_absol...
[ "def", "build", "(", "template", "=", "'/'", ",", "host", "=", "None", ",", "scheme", "=", "None", ",", "port", "=", "None", ",", "*", "*", "template_vars", ")", ":", "# TODO: refactor to build_absolute and build_relative instead of handling based on params", "parse...
Builds a url with a string template and template variables; relative path if host is None, abs otherwise: template format: "/staticendpoint/{dynamic_endpoint}?{params}"
[ "Builds", "a", "url", "with", "a", "string", "template", "and", "template", "variables", ";", "relative", "path", "if", "host", "is", "None", "abs", "otherwise", ":", "template", "format", ":", "/", "staticendpoint", "/", "{", "dynamic_endpoint", "}", "?", ...
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/util/urls/urlbuilder.py#L13-L45
train
Shapeways/coyote_framework
coyote_framework/util/apps/polling/polling.py
poll
def poll(function, step=0.5, timeout=3, ignore_exceptions=(), exception_message='', message_builder=None, args=(), kwargs=None, ontimeout=()): """Calls the function until bool(return value) is truthy @param step: Wait time between each function call @param timeout: Max amount of time that will ela...
python
def poll(function, step=0.5, timeout=3, ignore_exceptions=(), exception_message='', message_builder=None, args=(), kwargs=None, ontimeout=()): """Calls the function until bool(return value) is truthy @param step: Wait time between each function call @param timeout: Max amount of time that will ela...
[ "def", "poll", "(", "function", ",", "step", "=", "0.5", ",", "timeout", "=", "3", ",", "ignore_exceptions", "=", "(", ")", ",", "exception_message", "=", "''", ",", "message_builder", "=", "None", ",", "args", "=", "(", ")", ",", "kwargs", "=", "Non...
Calls the function until bool(return value) is truthy @param step: Wait time between each function call @param timeout: Max amount of time that will elapse. If the function is in progress when timeout has passed, the function will be allowed to complete. @type ignore_exceptions: tuple @param ignore...
[ "Calls", "the", "function", "until", "bool", "(", "return", "value", ")", "is", "truthy" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/util/apps/polling/polling.py#L6-L50
train
Shapeways/coyote_framework
coyote_framework/webdriver/webdriverwrapper/support/locator.py
Locator.build
def build(self, **variables): """Formats the locator with specified parameters""" return Locator(self.by, self.locator.format(**variables), self.description)
python
def build(self, **variables): """Formats the locator with specified parameters""" return Locator(self.by, self.locator.format(**variables), self.description)
[ "def", "build", "(", "self", ",", "*", "*", "variables", ")", ":", "return", "Locator", "(", "self", ".", "by", ",", "self", ".", "locator", ".", "format", "(", "*", "*", "variables", ")", ",", "self", ".", "description", ")" ]
Formats the locator with specified parameters
[ "Formats", "the", "locator", "with", "specified", "parameters" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/webdriver/webdriverwrapper/support/locator.py#L32-L34
train
Shapeways/coyote_framework
coyote_framework/util/apps/randomwords/words.py
random_words_string
def random_words_string(count=1, maxchars=None, sep=''): """Gets a """ nouns = sep.join([random_word() for x in xrange(0, count)]) if maxchars is not None and nouns > maxchars: nouns = nouns[0:maxchars-1] return nouns
python
def random_words_string(count=1, maxchars=None, sep=''): """Gets a """ nouns = sep.join([random_word() for x in xrange(0, count)]) if maxchars is not None and nouns > maxchars: nouns = nouns[0:maxchars-1] return nouns
[ "def", "random_words_string", "(", "count", "=", "1", ",", "maxchars", "=", "None", ",", "sep", "=", "''", ")", ":", "nouns", "=", "sep", ".", "join", "(", "[", "random_word", "(", ")", "for", "x", "in", "xrange", "(", "0", ",", "count", ")", "]"...
Gets a
[ "Gets", "a" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/util/apps/randomwords/words.py#L25-L33
train
Shapeways/coyote_framework
coyote_framework/util/apps/driver_interop/drivercookies.py
is_subdomain
def is_subdomain(domain, reference): """Tests if a hostname is a subdomain of a reference hostname e.g. www.domain.com is subdomain of reference @param domain: Domain to test if it is a subdomain @param reference: Reference "parent" domain """ index_of_reference = domain.find(reference) if ...
python
def is_subdomain(domain, reference): """Tests if a hostname is a subdomain of a reference hostname e.g. www.domain.com is subdomain of reference @param domain: Domain to test if it is a subdomain @param reference: Reference "parent" domain """ index_of_reference = domain.find(reference) if ...
[ "def", "is_subdomain", "(", "domain", ",", "reference", ")", ":", "index_of_reference", "=", "domain", ".", "find", "(", "reference", ")", "if", "index_of_reference", ">", "0", "and", "domain", "[", "index_of_reference", ":", "]", "==", "reference", ":", "re...
Tests if a hostname is a subdomain of a reference hostname e.g. www.domain.com is subdomain of reference @param domain: Domain to test if it is a subdomain @param reference: Reference "parent" domain
[ "Tests", "if", "a", "hostname", "is", "a", "subdomain", "of", "a", "reference", "hostname", "e", ".", "g", ".", "www", ".", "domain", ".", "com", "is", "subdomain", "of", "reference" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/util/apps/driver_interop/drivercookies.py#L7-L17
train
Shapeways/coyote_framework
coyote_framework/util/apps/driver_interop/drivercookies.py
dump_requestdriver_cookies_into_webdriver
def dump_requestdriver_cookies_into_webdriver(requestdriver, webdriverwrapper, handle_sub_domain=True): """Adds all cookies in the RequestDriver session to Webdriver @type requestdriver: RequestDriver @param requestdriver: RequestDriver with cookies @type webdriverwrapper: WebDriverWrapper @param w...
python
def dump_requestdriver_cookies_into_webdriver(requestdriver, webdriverwrapper, handle_sub_domain=True): """Adds all cookies in the RequestDriver session to Webdriver @type requestdriver: RequestDriver @param requestdriver: RequestDriver with cookies @type webdriverwrapper: WebDriverWrapper @param w...
[ "def", "dump_requestdriver_cookies_into_webdriver", "(", "requestdriver", ",", "webdriverwrapper", ",", "handle_sub_domain", "=", "True", ")", ":", "driver_hostname", "=", "urlparse", "(", "webdriverwrapper", ".", "current_url", "(", ")", ")", ".", "netloc", "for", ...
Adds all cookies in the RequestDriver session to Webdriver @type requestdriver: RequestDriver @param requestdriver: RequestDriver with cookies @type webdriverwrapper: WebDriverWrapper @param webdriverwrapper: WebDriverWrapper to receive cookies @param handle_sub_domain: If True, will check driver u...
[ "Adds", "all", "cookies", "in", "the", "RequestDriver", "session", "to", "Webdriver" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/util/apps/driver_interop/drivercookies.py#L21-L61
train
Shapeways/coyote_framework
coyote_framework/util/apps/driver_interop/drivercookies.py
dump_webdriver_cookies_into_requestdriver
def dump_webdriver_cookies_into_requestdriver(requestdriver, webdriverwrapper): """Adds all cookies in the Webdriver session to requestdriver @type requestdriver: RequestDriver @param requestdriver: RequestDriver with cookies @type webdriver: WebDriverWrapper @param webdriver: WebDriverWrapper to r...
python
def dump_webdriver_cookies_into_requestdriver(requestdriver, webdriverwrapper): """Adds all cookies in the Webdriver session to requestdriver @type requestdriver: RequestDriver @param requestdriver: RequestDriver with cookies @type webdriver: WebDriverWrapper @param webdriver: WebDriverWrapper to r...
[ "def", "dump_webdriver_cookies_into_requestdriver", "(", "requestdriver", ",", "webdriverwrapper", ")", ":", "for", "cookie", "in", "webdriverwrapper", ".", "get_cookies", "(", ")", ":", "# Wedbriver uses \"expiry\"; requests uses \"expires\", adjust for this", "expires", "=", ...
Adds all cookies in the Webdriver session to requestdriver @type requestdriver: RequestDriver @param requestdriver: RequestDriver with cookies @type webdriver: WebDriverWrapper @param webdriver: WebDriverWrapper to receive cookies @rtype: None @return: None
[ "Adds", "all", "cookies", "in", "the", "Webdriver", "session", "to", "requestdriver" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/util/apps/driver_interop/drivercookies.py#L64-L80
train
Shapeways/coyote_framework
coyote_framework/drivers/coyote_driverfactory.py
get_firefox_binary
def get_firefox_binary(): """Gets the firefox binary @rtype: FirefoxBinary """ browser_config = BrowserConfig() constants_config = ConstantsConfig() log_dir = os.path.join(constants_config.get('logs_dir'), 'firefox') create_directory(log_dir) log_path = os.path.join(log_dir, '{}_{}.log...
python
def get_firefox_binary(): """Gets the firefox binary @rtype: FirefoxBinary """ browser_config = BrowserConfig() constants_config = ConstantsConfig() log_dir = os.path.join(constants_config.get('logs_dir'), 'firefox') create_directory(log_dir) log_path = os.path.join(log_dir, '{}_{}.log...
[ "def", "get_firefox_binary", "(", ")", ":", "browser_config", "=", "BrowserConfig", "(", ")", "constants_config", "=", "ConstantsConfig", "(", ")", "log_dir", "=", "os", ".", "path", ".", "join", "(", "constants_config", ".", "get", "(", "'logs_dir'", ")", "...
Gets the firefox binary @rtype: FirefoxBinary
[ "Gets", "the", "firefox", "binary" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/drivers/coyote_driverfactory.py#L51-L67
train
Shapeways/coyote_framework
coyote_framework/drivers/coyote_driverfactory.py
_log_fail_callback
def _log_fail_callback(driver, *args, **kwargs): """Raises an assertion error if the page has severe console errors @param driver: ShapewaysDriver @return: None """ try: logs = driver.get_browser_log(levels=[BROWSER_LOG_LEVEL_SEVERE]) failure_message = 'There were severe console er...
python
def _log_fail_callback(driver, *args, **kwargs): """Raises an assertion error if the page has severe console errors @param driver: ShapewaysDriver @return: None """ try: logs = driver.get_browser_log(levels=[BROWSER_LOG_LEVEL_SEVERE]) failure_message = 'There were severe console er...
[ "def", "_log_fail_callback", "(", "driver", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "try", ":", "logs", "=", "driver", ".", "get_browser_log", "(", "levels", "=", "[", "BROWSER_LOG_LEVEL_SEVERE", "]", ")", "failure_message", "=", "'There were se...
Raises an assertion error if the page has severe console errors @param driver: ShapewaysDriver @return: None
[ "Raises", "an", "assertion", "error", "if", "the", "page", "has", "severe", "console", "errors" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/drivers/coyote_driverfactory.py#L70-L87
train
Shapeways/coyote_framework
coyote_framework/database/coyote_entity_abstract.py
CoyoteEntityAbstract.clone_and_update
def clone_and_update(self, **kwargs): """Clones the object and updates the clone with the args @param kwargs: Keyword arguments to set @return: The cloned copy with updated values """ cloned = self.clone() cloned.update(**kwargs) return cloned
python
def clone_and_update(self, **kwargs): """Clones the object and updates the clone with the args @param kwargs: Keyword arguments to set @return: The cloned copy with updated values """ cloned = self.clone() cloned.update(**kwargs) return cloned
[ "def", "clone_and_update", "(", "self", ",", "*", "*", "kwargs", ")", ":", "cloned", "=", "self", ".", "clone", "(", ")", "cloned", ".", "update", "(", "*", "*", "kwargs", ")", "return", "cloned" ]
Clones the object and updates the clone with the args @param kwargs: Keyword arguments to set @return: The cloned copy with updated values
[ "Clones", "the", "object", "and", "updates", "the", "clone", "with", "the", "args" ]
cb29899b984a21d56bf65d0b1d907073948fe16c
https://github.com/Shapeways/coyote_framework/blob/cb29899b984a21d56bf65d0b1d907073948fe16c/coyote_framework/database/coyote_entity_abstract.py#L12-L20
train
ubernostrum/django-contact-form
src/contact_form/forms.py
ContactForm.message
def message(self): """ Render the body of the message to a string. """ template_name = self.template_name() if \ callable(self.template_name) \ else self.template_name return loader.render_to_string( template_name, self.get_context(), request=...
python
def message(self): """ Render the body of the message to a string. """ template_name = self.template_name() if \ callable(self.template_name) \ else self.template_name return loader.render_to_string( template_name, self.get_context(), request=...
[ "def", "message", "(", "self", ")", ":", "template_name", "=", "self", ".", "template_name", "(", ")", "if", "callable", "(", "self", ".", "template_name", ")", "else", "self", ".", "template_name", "return", "loader", ".", "render_to_string", "(", "template...
Render the body of the message to a string.
[ "Render", "the", "body", "of", "the", "message", "to", "a", "string", "." ]
7dd8491cd75fc39d0edfb2c14c270a130d5afa9e
https://github.com/ubernostrum/django-contact-form/blob/7dd8491cd75fc39d0edfb2c14c270a130d5afa9e/src/contact_form/forms.py#L45-L55
train
ubernostrum/django-contact-form
src/contact_form/forms.py
ContactForm.subject
def subject(self): """ Render the subject of the message to a string. """ template_name = self.subject_template_name() if \ callable(self.subject_template_name) \ else self.subject_template_name subject = loader.render_to_string( template_name...
python
def subject(self): """ Render the subject of the message to a string. """ template_name = self.subject_template_name() if \ callable(self.subject_template_name) \ else self.subject_template_name subject = loader.render_to_string( template_name...
[ "def", "subject", "(", "self", ")", ":", "template_name", "=", "self", ".", "subject_template_name", "(", ")", "if", "callable", "(", "self", ".", "subject_template_name", ")", "else", "self", ".", "subject_template_name", "subject", "=", "loader", ".", "rende...
Render the subject of the message to a string.
[ "Render", "the", "subject", "of", "the", "message", "to", "a", "string", "." ]
7dd8491cd75fc39d0edfb2c14c270a130d5afa9e
https://github.com/ubernostrum/django-contact-form/blob/7dd8491cd75fc39d0edfb2c14c270a130d5afa9e/src/contact_form/forms.py#L57-L68
train
ubernostrum/django-contact-form
src/contact_form/forms.py
ContactForm.get_context
def get_context(self): """ Return the context used to render the templates for the email subject and body. By default, this context includes: * All of the validated values in the form, as variables of the same names as their fields. * The current ``Site`` obj...
python
def get_context(self): """ Return the context used to render the templates for the email subject and body. By default, this context includes: * All of the validated values in the form, as variables of the same names as their fields. * The current ``Site`` obj...
[ "def", "get_context", "(", "self", ")", ":", "if", "not", "self", ".", "is_valid", "(", ")", ":", "raise", "ValueError", "(", "\"Cannot generate Context from invalid contact form\"", ")", "return", "dict", "(", "self", ".", "cleaned_data", ",", "site", "=", "g...
Return the context used to render the templates for the email subject and body. By default, this context includes: * All of the validated values in the form, as variables of the same names as their fields. * The current ``Site`` object, as the variable ``site``. * A...
[ "Return", "the", "context", "used", "to", "render", "the", "templates", "for", "the", "email", "subject", "and", "body", "." ]
7dd8491cd75fc39d0edfb2c14c270a130d5afa9e
https://github.com/ubernostrum/django-contact-form/blob/7dd8491cd75fc39d0edfb2c14c270a130d5afa9e/src/contact_form/forms.py#L70-L90
train
ubernostrum/django-contact-form
src/contact_form/forms.py
ContactForm.get_message_dict
def get_message_dict(self): """ Generate the various parts of the message and return them in a dictionary, suitable for passing directly as keyword arguments to ``django.core.mail.send_mail()``. By default, the following values are returned: * ``from_email`` * ...
python
def get_message_dict(self): """ Generate the various parts of the message and return them in a dictionary, suitable for passing directly as keyword arguments to ``django.core.mail.send_mail()``. By default, the following values are returned: * ``from_email`` * ...
[ "def", "get_message_dict", "(", "self", ")", ":", "if", "not", "self", ".", "is_valid", "(", ")", ":", "raise", "ValueError", "(", "\"Message cannot be sent from invalid contact form\"", ")", "message_dict", "=", "{", "}", "for", "message_part", "in", "(", "'fro...
Generate the various parts of the message and return them in a dictionary, suitable for passing directly as keyword arguments to ``django.core.mail.send_mail()``. By default, the following values are returned: * ``from_email`` * ``message`` * ``recipient_list`` ...
[ "Generate", "the", "various", "parts", "of", "the", "message", "and", "return", "them", "in", "a", "dictionary", "suitable", "for", "passing", "directly", "as", "keyword", "arguments", "to", "django", ".", "core", ".", "mail", ".", "send_mail", "()", "." ]
7dd8491cd75fc39d0edfb2c14c270a130d5afa9e
https://github.com/ubernostrum/django-contact-form/blob/7dd8491cd75fc39d0edfb2c14c270a130d5afa9e/src/contact_form/forms.py#L92-L118
train