QWeb 3.7.2__tar.gz → 3.7.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {qweb-3.7.2 → qweb-3.7.4}/PKG-INFO +1 -1
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/__init__.py +21 -7
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/_version.py +4 -4
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/secrets.py +7 -3
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/util.py +3 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/input_.py +14 -3
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/text.py +2 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb.egg-info/PKG-INFO +1 -1
- {qweb-3.7.2 → qweb-3.7.4}/LICENSE +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/MANIFEST.in +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/__main__.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/custom_config.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/__init__.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/actions.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/ajax.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/alert.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/blocks.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/browser/__init__.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/browser/android.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/browser/bs_desktop.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/browser/bs_mobile.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/browser/chrome.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/browser/edge.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/browser/firefox.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/browser/safari.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/checkbox.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/config.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/config_defaults.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/cookies.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/decorators.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/download.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/dragdrop.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/dropdown.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/element.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/exceptions.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/file.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/frame.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/frame_checker.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/icon.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/input_.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/input_handler.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/javascript.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/find_text_from_textnodes.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_all_dropdown_elements_shadow_dom.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_all_frames_from_shadow_dom.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_all_input_elements_from_shadow_dom.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_by_attributes.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_by_label.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_childnodes.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_clickable.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_clickable_from_shadow_dom.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_item_elements_from_shadow_dom.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_parent_list.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_recursive_walk.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_text_elements_from_shadow_dom.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/get_visibility.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/highlight_element.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/install_monitor.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/spinner_busy.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/toast_notification.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/js/wait_status_lite.js +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/lists.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/meas.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/platform.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/screenshot.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/search_strategy.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/table.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/text.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/user.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/window.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/internal/xhr.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/__init__.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/ajax.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/alert.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/blocks.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/browser.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/checkbox.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/config.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/cookies.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/debug.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/download.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/dragdrop.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/dropdown.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/element.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/file.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/frame.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/icon.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/javascript.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/lists.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/mouse.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/screenshot.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/search_strategy.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/table.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb/keywords/window.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb.egg-info/SOURCES.txt +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb.egg-info/dependency_links.txt +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb.egg-info/requires.txt +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/QWeb.egg-info/top_level.txt +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/README.md +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/example/CustomerLibrary/CustomerLib.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/example/CustomerLibrary/decorators.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/pyproject.toml +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/setup.cfg +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/setup.py +0 -0
- {qweb-3.7.2 → qweb-3.7.4}/versioneer.py +0 -0
|
@@ -63,6 +63,9 @@ except SystemExit as se:
|
|
|
63
63
|
raise Exception(se) from se # pylint: disable=W0719
|
|
64
64
|
|
|
65
65
|
|
|
66
|
+
DEFAULT_RUN_ON_FAILURE_KEYWORD = "Log Screenshot"
|
|
67
|
+
|
|
68
|
+
|
|
66
69
|
class QWeb:
|
|
67
70
|
r"""
|
|
68
71
|
.. image:: https://github.com/qentinelqi/qweb/raw/master/images/qweb_logo_256.png
|
|
@@ -298,7 +301,7 @@ class QWeb:
|
|
|
298
301
|
|
|
299
302
|
ROBOT_LIBRARY_SCOPE = "Global"
|
|
300
303
|
|
|
301
|
-
def __init__(self, run_on_failure_keyword: str =
|
|
304
|
+
def __init__(self, run_on_failure_keyword: str = DEFAULT_RUN_ON_FAILURE_KEYWORD) -> None:
|
|
302
305
|
"""Initializes the QWeb library and adds all the keywords to the instance.
|
|
303
306
|
|
|
304
307
|
- ``run_on_failure_keyword``:
|
|
@@ -370,12 +373,12 @@ class QWeb:
|
|
|
370
373
|
return keyword_method(*args, **kwargs)
|
|
371
374
|
except Exception as e: # pylint: disable=W0703
|
|
372
375
|
logger.debug(traceback.format_exc())
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
376
|
+
logger.info(str(e))
|
|
377
|
+
if not self._is_run_on_failure_keyword(keyword_method) and not util.par2bool(
|
|
378
|
+
kwargs.get("skip_screenshot", False)
|
|
379
|
+
):
|
|
380
|
+
self._handle_run_on_failure()
|
|
381
|
+
|
|
379
382
|
devmode = util.par2bool(util.get_rfw_variable_value("${DEV_MODE}", False))
|
|
380
383
|
if devmode and not config.get_config("Debug_Run"):
|
|
381
384
|
Dialogs.pause_execution(
|
|
@@ -389,6 +392,17 @@ class QWeb:
|
|
|
389
392
|
|
|
390
393
|
return inner
|
|
391
394
|
|
|
395
|
+
def _handle_run_on_failure(self) -> None:
|
|
396
|
+
"""Helper function to run the registered run_on_failure keyword."""
|
|
397
|
+
# if default, embed screenshot kw directly for log readability
|
|
398
|
+
if self._run_on_failure_keyword == DEFAULT_RUN_ON_FAILURE_KEYWORD:
|
|
399
|
+
screenshot.log_screenshot()
|
|
400
|
+
else:
|
|
401
|
+
try:
|
|
402
|
+
BuiltIn().run_keyword(self._run_on_failure_keyword)
|
|
403
|
+
except RobotNotRunningError:
|
|
404
|
+
logger.debug("Robot not running")
|
|
405
|
+
|
|
392
406
|
@staticmethod
|
|
393
407
|
def _xpath_decorator(keyword_method: Callable[..., Any]) -> Callable[..., Callable[..., Any]]:
|
|
394
408
|
"""Decorator method for selector-attribute. If selector attribute
|
|
@@ -8,11 +8,11 @@ import json
|
|
|
8
8
|
|
|
9
9
|
version_json = '''
|
|
10
10
|
{
|
|
11
|
-
"date": "
|
|
12
|
-
"dirty":
|
|
11
|
+
"date": "2026-02-12T14:50:40+0200",
|
|
12
|
+
"dirty": true,
|
|
13
13
|
"error": null,
|
|
14
|
-
"full-revisionid": "
|
|
15
|
-
"version": "3.7.
|
|
14
|
+
"full-revisionid": "8f01c3c41892de77c48d5eb4792bd7e4c5134f23",
|
|
15
|
+
"version": "3.7.4"
|
|
16
16
|
}
|
|
17
17
|
''' # END VERSION_JSON
|
|
18
18
|
|
|
@@ -94,7 +94,8 @@ def _filtered_start_keyword(keyword: Keyword) -> None:
|
|
|
94
94
|
censored_args = _hide_keyword_arg_values(keyword)
|
|
95
95
|
_replace_keyword_args(keyword, tuple(censored_args))
|
|
96
96
|
|
|
97
|
-
LOGGER
|
|
97
|
+
if hasattr(LOGGER, "_log_message"):
|
|
98
|
+
LOGGER.log_message = LOGGER._log_message
|
|
98
99
|
for start_logger in LOGGER.start_loggers:
|
|
99
100
|
start_logger.start_keyword(keyword)
|
|
100
101
|
|
|
@@ -126,7 +127,9 @@ def _filtered_start_library_keyword(data: Keyword, implementation: Keyword, resu
|
|
|
126
127
|
_replace_keyword_args(data, tuple(censored_args))
|
|
127
128
|
_replace_keyword_args(result, tuple(censored_args))
|
|
128
129
|
|
|
129
|
-
|
|
130
|
+
# Reset log_message to original function (rfw < 7.4)
|
|
131
|
+
if hasattr(LOGGER, "_log_message"):
|
|
132
|
+
LOGGER.log_message = LOGGER._log_message
|
|
130
133
|
for start_logger in LOGGER.start_loggers:
|
|
131
134
|
start_logger.start_library_keyword(data, implementation, result)
|
|
132
135
|
|
|
@@ -186,7 +189,8 @@ def _filtered_end_library_keyword(data: Keyword, implementation: Keyword, result
|
|
|
186
189
|
for end_logger in LOGGER.end_loggers:
|
|
187
190
|
end_logger.end_library_keyword(data, implementation, result)
|
|
188
191
|
|
|
189
|
-
LOGGER
|
|
192
|
+
if hasattr(LOGGER, "_log_message"):
|
|
193
|
+
LOGGER.log_message = LOGGER.message
|
|
190
194
|
|
|
191
195
|
if apply_filter:
|
|
192
196
|
_replace_keyword_args(result, tuple(original_args))
|
|
@@ -163,6 +163,9 @@ def highlight_validation(color: str) -> str:
|
|
|
163
163
|
def get_substring(text: str, remove_newlines: bool = True, **kwargs) -> Union[int, float, str]:
|
|
164
164
|
if "\xa0" in text:
|
|
165
165
|
text = text.replace("\xa0", " ")
|
|
166
|
+
log_text = kwargs.get("log_text", False)
|
|
167
|
+
if log_text:
|
|
168
|
+
logger.info(f"Full text before substring extraction: {repr(text)}", also_console=True)
|
|
166
169
|
start, end = kwargs.get("between", "{}???{}").format(0, len(text)).split("???")
|
|
167
170
|
include_start = kwargs.get("include_locator", False)
|
|
168
171
|
exclude_end = kwargs.get("exclude_post", True)
|
|
@@ -25,6 +25,13 @@ from selenium.webdriver.common.action_chains import ActionChains
|
|
|
25
25
|
from selenium.webdriver.remote.webelement import WebElement
|
|
26
26
|
from robot.api import logger
|
|
27
27
|
from robot.api.deco import keyword
|
|
28
|
+
try:
|
|
29
|
+
# Use alias as "Secret" could be quite generic type name
|
|
30
|
+
from robot.api.types import Secret as RFSecret
|
|
31
|
+
BUILT_IN_SECRET = True
|
|
32
|
+
except ImportError:
|
|
33
|
+
BUILT_IN_SECRET = False
|
|
34
|
+
RFSecret = str
|
|
28
35
|
from pyautogui import hotkey
|
|
29
36
|
from QWeb.internal.exceptions import QWebFileNotFoundError, QWebValueError
|
|
30
37
|
from QWeb.internal import javascript, secrets, actions, util
|
|
@@ -32,6 +39,8 @@ from QWeb.internal import element, input_, download, decorators
|
|
|
32
39
|
from QWeb.internal.input_handler import INPUT_HANDLER as input_handler
|
|
33
40
|
from QWeb.keywords import browser
|
|
34
41
|
|
|
42
|
+
str_or_secret = Union[str, RFSecret]
|
|
43
|
+
|
|
35
44
|
|
|
36
45
|
@keyword(tags=("Config", "Input"))
|
|
37
46
|
def set_input_handler(input_method: str) -> None:
|
|
@@ -78,7 +87,7 @@ secrets.add_filter("Type Secret3", 1, "hint")
|
|
|
78
87
|
|
|
79
88
|
def type_secret3(
|
|
80
89
|
locator: str,
|
|
81
|
-
input_text:
|
|
90
|
+
input_text: str_or_secret,
|
|
82
91
|
anchor: str = "1",
|
|
83
92
|
timeout: Union[int, float, str] = 0,
|
|
84
93
|
index: int = 1,
|
|
@@ -119,7 +128,7 @@ secrets.add_filter("Type Secret", 1, None)
|
|
|
119
128
|
@keyword(tags=("Input", "Interaction"))
|
|
120
129
|
def type_secret(
|
|
121
130
|
locator: str,
|
|
122
|
-
input_text:
|
|
131
|
+
input_text: str_or_secret,
|
|
123
132
|
anchor: str = "1",
|
|
124
133
|
timeout: Union[int, float, str] = 0,
|
|
125
134
|
index: int = 1,
|
|
@@ -156,7 +165,7 @@ def type_secret(
|
|
|
156
165
|
@decorators.timeout_decorator
|
|
157
166
|
def type_text(
|
|
158
167
|
locator: Union[WebElement, str],
|
|
159
|
-
input_text:
|
|
168
|
+
input_text: str_or_secret,
|
|
160
169
|
anchor: str = "1",
|
|
161
170
|
timeout: Union[int, float, str] = 0,
|
|
162
171
|
index: int = 1,
|
|
@@ -279,6 +288,8 @@ def type_text(
|
|
|
279
288
|
input_element = input_.get_input_elements_from_all_documents(
|
|
280
289
|
locator, anchor, timeout=timeout, index=index, **kwargs
|
|
281
290
|
)
|
|
291
|
+
if BUILT_IN_SECRET and isinstance(input_text, RFSecret):
|
|
292
|
+
input_text = input_text.value
|
|
282
293
|
actions.write(input_element, str(input_text), timeout=timeout, **kwargs)
|
|
283
294
|
|
|
284
295
|
|
|
@@ -884,6 +884,8 @@ def get_text(
|
|
|
884
884
|
| exclude_post : False - Ending text is part of returned string
|
|
885
885
|
| int : True - Return integer instead of string
|
|
886
886
|
| float : int - Return float instead of string
|
|
887
|
+
| log_text : True - Log the original found text to robot log. Useful to see
|
|
888
|
+
| what text was found before substring operations.
|
|
887
889
|
|
|
888
890
|
Returns
|
|
889
891
|
-------
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|