Skip to content

Commit

Permalink
Merge adab0c6 into 13c9dbe
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfe1 committed Nov 2, 2023
2 parents 13c9dbe + adab0c6 commit 7b9e6da
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/APILibraryDocumentation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/GUILibraryDocumentation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/SOAPLibraryDocumentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@
jQuery.extend({highlight:function(e,t,n,r){if(e.nodeType===3){var i=e.data.match(t);if(i){var s=document.createElement(n||"span");s.className=r||"highlight";var o=e.splitText(i.index);o.splitText(i[0].length);var u=o.cloneNode(true);s.appendChild(u);o.parentNode.replaceChild(s,o);return 1}}else if(e.nodeType===1&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&!(e.tagName===n.toUpperCase()&&e.className===r)){for(var a=0;a<e.childNodes.length;a++){a+=jQuery.highlight(e.childNodes[a],t,n,r)}}return 0}});jQuery.fn.unhighlight=function(e){var t={className:"highlight",element:"span"};jQuery.extend(t,e);return this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this);e.normalize()}).end()};jQuery.fn.highlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:false,wordsOnly:false};jQuery.extend(n,t);if(e.constructor===String){e=[e]}e=jQuery.grep(e,function(e,t){return e!=""});e=jQuery.map(e,function(e,t){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")});if(e.length==0){return this}var r=n.caseSensitive?"":"i";var i="("+e.join("|")+")";if(n.wordsOnly){i="\\b"+i+"\\b"}var s=new RegExp(i,r);return this.each(function(){jQuery.highlight(this,s,n.element,n.className)})}
</script>
<script type="text/javascript">
libdoc = {"specversion": 2, "name": "SOAP_Library", "doc": "<p>Zoomba SOAP Library</p>\n<p>This class is the base Library used to generate automated SOAP Tests in the Zoomba Automation Framework.</p>", "version": "3.6.0", "generated": "2023-08-17T13:47:51+00:00", "type": "LIBRARY", "scope": "TEST", "docFormat": "HTML", "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 43, "tags": [], "inits": [], "keywords": [{"name": "Call Soap Method With List Object", "args": [{"name": "action", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "action=None"}, {"name": "soap_object", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "soap_object=None"}], "doc": "<p>Call Soap Method. Calls soap method with list object</p>\n<p>action: (string) SOAP Action to be called.</p>\n<p>soap_object: (list) Soap Object in list format, list must be ordered wrt schema</p>", "shortdoc": "Call Soap Method. Calls soap method with list object ", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 100}, {"name": "Call Soap Method With Object", "args": [{"name": "action", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "action=None"}, {"name": "soap_object", "type": null, "types": [], "typedocs": {}, "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**soap_object"}], "doc": "<p>Call Soap Method with dictionary object. Calls soap method</p>\n<p>action: (string) SOAP Action to be called.</p>\n<p>soap_object: (dict) Soap Object in dict format, dict must contain all required parts of schema object.</p>", "shortdoc": "Call Soap Method with dictionary object. Calls soap method ", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 109}, {"name": "Convert Soap Response To Json", "args": [{"name": "soap_response", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "soap_response=None"}], "doc": "<p>Convert Soap Response To Dictionary: This keyword builds a dictionary from the sudsLibrary response</p>\n<p>json_actual_response: (request response object) The response from an API.</p>\n<p>return: There is no actual returned output, other than error messages when comparisons fail.</p>", "shortdoc": "Convert Soap Response To Dictionary: This keyword builds a dictionary from the sudsLibrary response", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 138}, {"name": "Create Soap Session", "args": [{"name": "host", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "kwargs", "type": null, "types": [], "typedocs": {}, "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**kwargs"}], "doc": "<p>Create Soap Session. This Keyword utilizes the WSDL to create a soap client.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>**kwargs: (optional) Parameters that could be included to add options to client creation. Current supported parameters are:</p>\n<p>set_location: http address</p>", "shortdoc": "Create Soap Session. This Keyword utilizes the WSDL to create a soap client.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 68}, {"name": "Create Soap Session And Fix Wsdl", "args": [{"name": "host", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "kwargs", "type": null, "types": [], "typedocs": {}, "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**kwargs"}], "doc": "<p>Create Soap Session. This Keyword utilizes the WSDL and directly accesses calls from sudsLibrary.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>alias: (string} Sets the alias for the SudsLibrary Framework **kwargs: (optional) Parameters that could be included to add options to client creation. Current supported parameters are:</p>\n<p>set_location: http address</p>", "shortdoc": "Create Soap Session. This Keyword utilizes the WSDL and directly accesses calls from sudsLibrary.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 51}, {"name": "Create Soap Session And Set Location", "args": [{"name": "host", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "set_location", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "set_location=None"}, {"name": "fix", "type": null, "types": [], "typedocs": {}, "defaultValue": "False", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "fix=False"}], "doc": "<p>Create Soap Session and Set Location. In addition to the client creation, this keyword sets the location as specified.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>set_location: (string) If set will overwrite the WSDL location with specified address.</p>\n<p>If set to None will replace location with host and endpoint specified</p>", "shortdoc": "Create Soap Session and Set Location. In addition to the client creation, this keyword sets the location as specified.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 84}, {"name": "Create Wsdl Objects", "args": [{"name": "wsdl_type", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "wsdl_type=None"}, {"name": "object_dict", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "object_dict=None"}], "doc": "<p>Create Wsdl Objects. This Keyword utilizes the WSDL to create a WSDL object based on the information provided.</p>\n<p>wsdl_type: (string) Wsdl object to be created.</p>\n<p>object_dict: (dict) Python Dictionary containing values and nested dictionaries with construction similar to wsdl defined objects.</p>\n<p>return: (response object) Returns the SOAP client object.</p>", "shortdoc": "Create Wsdl Objects. This Keyword utilizes the WSDL to create a WSDL object based on the information provided.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 124}], "dataTypes": {"enums": [], "typedDicts": []}, "typedocs": []}
libdoc = {"specversion": 2, "name": "SOAP_Library", "doc": "<p>Zoomba SOAP Library</p>\n<p>This class is the base Library used to generate automated SOAP Tests in the Zoomba Automation Framework.</p>", "version": "3.7.2", "generated": "2023-11-02T15:40:53+00:00", "type": "LIBRARY", "scope": "TEST", "docFormat": "HTML", "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 43, "tags": [], "inits": [], "keywords": [{"name": "Call Soap Method With List Object", "args": [{"name": "action", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "action=None"}, {"name": "soap_object", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "soap_object=None"}], "doc": "<p>Call Soap Method. Calls soap method with list object</p>\n<p>action: (string) SOAP Action to be called.</p>\n<p>soap_object: (list) Soap Object in list format, list must be ordered wrt schema</p>", "shortdoc": "Call Soap Method. Calls soap method with list object ", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 100}, {"name": "Call Soap Method With Object", "args": [{"name": "action", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "action=None"}, {"name": "soap_object", "type": null, "types": [], "typedocs": {}, "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**soap_object"}], "doc": "<p>Call Soap Method with dictionary object. Calls soap method</p>\n<p>action: (string) SOAP Action to be called.</p>\n<p>soap_object: (dict) Soap Object in dict format, dict must contain all required parts of schema object.</p>", "shortdoc": "Call Soap Method with dictionary object. Calls soap method ", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 109}, {"name": "Convert Soap Response To Json", "args": [{"name": "soap_response", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "soap_response=None"}], "doc": "<p>Convert Soap Response To Dictionary: This keyword builds a dictionary from the sudsLibrary response</p>\n<p>json_actual_response: (request response object) The response from an API.</p>\n<p>return: There is no actual returned output, other than error messages when comparisons fail.</p>", "shortdoc": "Convert Soap Response To Dictionary: This keyword builds a dictionary from the sudsLibrary response", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 138}, {"name": "Create Soap Session", "args": [{"name": "host", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "kwargs", "type": null, "types": [], "typedocs": {}, "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**kwargs"}], "doc": "<p>Create Soap Session. This Keyword utilizes the WSDL to create a soap client.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>**kwargs: (optional) Parameters that could be included to add options to client creation. Current supported parameters are:</p>\n<p>set_location: http address</p>", "shortdoc": "Create Soap Session. This Keyword utilizes the WSDL to create a soap client.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 68}, {"name": "Create Soap Session And Fix Wsdl", "args": [{"name": "host", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "kwargs", "type": null, "types": [], "typedocs": {}, "defaultValue": null, "kind": "VAR_NAMED", "required": false, "repr": "**kwargs"}], "doc": "<p>Create Soap Session. This Keyword utilizes the WSDL and directly accesses calls from sudsLibrary.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>alias: (string} Sets the alias for the SudsLibrary Framework **kwargs: (optional) Parameters that could be included to add options to client creation. Current supported parameters are:</p>\n<p>set_location: http address</p>", "shortdoc": "Create Soap Session. This Keyword utilizes the WSDL and directly accesses calls from sudsLibrary.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 51}, {"name": "Create Soap Session And Set Location", "args": [{"name": "host", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "host=None"}, {"name": "endpoint", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "endpoint=None"}, {"name": "alias", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "alias=None"}, {"name": "set_location", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "set_location=None"}, {"name": "fix", "type": null, "types": [], "typedocs": {}, "defaultValue": "False", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "fix=False"}], "doc": "<p>Create Soap Session and Set Location. In addition to the client creation, this keyword sets the location as specified.</p>\n<p>host: (string) The host url.</p>\n<p>endpoint: (string) SOAP API endpoint containing the actions to be referenced.</p>\n<p>set_location: (string) If set will overwrite the WSDL location with specified address.</p>\n<p>If set to None will replace location with host and endpoint specified</p>", "shortdoc": "Create Soap Session and Set Location. In addition to the client creation, this keyword sets the location as specified.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 84}, {"name": "Create Wsdl Objects", "args": [{"name": "wsdl_type", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "wsdl_type=None"}, {"name": "object_dict", "type": null, "types": [], "typedocs": {}, "defaultValue": "None", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "object_dict=None"}], "doc": "<p>Create Wsdl Objects. This Keyword utilizes the WSDL to create a WSDL object based on the information provided.</p>\n<p>wsdl_type: (string) Wsdl object to be created.</p>\n<p>object_dict: (dict) Python Dictionary containing values and nested dictionaries with construction similar to wsdl defined objects.</p>\n<p>return: (response object) Returns the SOAP client object.</p>", "shortdoc": "Create Wsdl Objects. This Keyword utilizes the WSDL to create a WSDL object based on the information provided.", "tags": [], "source": "C:\\Git\\robotframework-zoomba\\src\\Zoomba\\SOAPLibrary.py", "lineno": 124}], "dataTypes": {"enums": [], "typedDicts": []}, "typedocs": []}
</script>
<title></title>
</head>
Expand Down
54 changes: 41 additions & 13 deletions src/Zoomba/GUILibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,20 +275,48 @@ def scroll_to_bottom_of_page(self):
self.execute_javascript(f"window.scrollTo(0,{height})")

@keyword("Wait Until Javascript Is Complete")
def wait_until_javascript_is_complete(self):
"""This keyword polls the jQuery.active flag, to track execution of AJAX requests. The web application needs
to have jQuery in order for this to work.
"""
for each in range(1, 20):
jquery_started = self.execute_javascript("return jQuery.active==1")
if jquery_started:
break
for _ in range(1, 50):
jquery_completed = self.execute_javascript("return window.jQuery!=undefined && jQuery.active==0")
if jquery_completed:
def wait_until_javascript_is_complete(self, timeout=30):
"""This keyword waits for JavaScript execution by checking document.readyState and pending AJAX requests.\n
timeout (float): The maximum time to wait for the JavaScript to complete, in seconds.
Note: Currently, it seems that the JavaScript execution check is not working properly, so this keyword will
just run `Wait For Page To Load` for now.
"""

self.wait_for_page_to_load(timeout)
# def is_javascript_complete():
# try:
# fetch_complete = self.execute_javascript(
# "return window.fetch && fetch.polyfill ? window.fetch.polyfill.active === 0 : true")
# jQuery_complete = self.execute_javascript(
# "return window.jQuery ? jQuery.active === 0 : true")
# print("jquery:")
# print(self.execute_javascript("jQuery.active"))
# xhr_complete = self.execute_javascript(
# "return window.XMLHttpRequest ? XMLHttpRequest.active === 0 : true")
# print("xhr:")
# print(self.execute_javascript("XMLHttpRequest.active"))
# return fetch_complete and jQuery_complete and xhr_complete
# except Exception:
# return False
# end_time = time() + timeout
# while time() < end_time:
# ready_state = self.execute_javascript("return document.readyState")
# javascript_complete = is_javascript_complete()
# if ready_state == 'complete' and javascript_complete:
# break
# zoomba.sleep(0.5)

@keyword("Wait For Page To Load")
def wait_for_page_to_load(self, timeout=30):
"""This keyword waits for the page to load by checking document.readyState.\n
timeout (float): The maximum time to wait for the page to load, in seconds."""
end_time = time() + timeout
while time() < end_time:
ready_state = self.execute_javascript("return document.readyState")
if ready_state == 'complete':
break
zoomba.sleep("0.5s")
zoomba.sleep(0.5)

@keyword("Get Text From Web Elements List")
def get_text_from_web_elements_list(self, web_elements_list):
Expand Down
Loading

0 comments on commit 7b9e6da

Please sign in to comment.