QWeb 3.2.1__tar.gz → 3.3.1__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.
Files changed (85) hide show
  1. {QWeb-3.2.1 → QWeb-3.3.1}/PKG-INFO +1 -1
  2. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/__init__.py +75 -29
  3. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/__main__.py +17 -14
  4. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/_version.py +3 -3
  5. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/custom_config.py +1 -1
  6. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/actions.py +162 -131
  7. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/ajax.py +24 -24
  8. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/alert.py +5 -4
  9. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/blocks.py +17 -16
  10. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/browser/__init__.py +70 -68
  11. QWeb-3.3.1/QWeb/internal/browser/android.py +42 -0
  12. QWeb-3.3.1/QWeb/internal/browser/bs_desktop.py +79 -0
  13. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/browser/bs_mobile.py +14 -13
  14. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/browser/chrome.py +44 -40
  15. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/browser/edge.py +21 -15
  16. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/browser/firefox.py +29 -22
  17. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/browser/safari.py +12 -10
  18. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/checkbox.py +23 -22
  19. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/config.py +7 -8
  20. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/config_defaults.py +20 -11
  21. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/decorators.py +84 -49
  22. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/download.py +19 -18
  23. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/dragdrop.py +23 -16
  24. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/dropdown.py +178 -169
  25. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/element.py +199 -156
  26. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/exceptions.py +8 -4
  27. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/file.py +89 -90
  28. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/frame.py +50 -38
  29. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/frame_checker.py +5 -5
  30. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/icon.py +34 -31
  31. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/input_.py +73 -67
  32. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/input_handler.py +42 -36
  33. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/javascript.py +50 -27
  34. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/lists.py +84 -68
  35. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/meas.py +6 -7
  36. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/screenshot.py +82 -69
  37. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/search_strategy.py +4 -4
  38. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/secrets.py +26 -26
  39. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/table.py +113 -99
  40. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/text.py +161 -96
  41. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/user.py +6 -5
  42. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/util.py +110 -87
  43. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/window.py +24 -26
  44. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/xhr.py +7 -8
  45. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/ajax.py +120 -112
  46. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/alert.py +1 -1
  47. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/blocks.py +13 -12
  48. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/browser.py +21 -27
  49. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/checkbox.py +44 -40
  50. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/config.py +6 -4
  51. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/cookies.py +1 -0
  52. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/debug.py +13 -11
  53. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/download.py +10 -7
  54. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/dragdrop.py +29 -24
  55. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/dropdown.py +58 -35
  56. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/element.py +113 -85
  57. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/file.py +101 -53
  58. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/frame.py +4 -2
  59. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/icon.py +117 -28
  60. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/input_.py +133 -128
  61. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/javascript.py +1 -1
  62. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/lists.py +36 -25
  63. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/screenshot.py +7 -7
  64. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/search_strategy.py +9 -7
  65. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/table.py +55 -49
  66. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/text.py +281 -247
  67. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/window.py +30 -31
  68. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb.egg-info/PKG-INFO +1 -1
  69. QWeb-3.2.1/QWeb/internal/browser/android.py +0 -40
  70. QWeb-3.2.1/QWeb/internal/browser/bs_desktop.py +0 -78
  71. {QWeb-3.2.1 → QWeb-3.3.1}/LICENSE +0 -0
  72. {QWeb-3.2.1 → QWeb-3.3.1}/MANIFEST.in +0 -0
  73. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/__init__.py +0 -0
  74. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/cookies.py +0 -0
  75. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/internal/platform.py +0 -0
  76. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb/keywords/__init__.py +0 -0
  77. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb.egg-info/SOURCES.txt +0 -0
  78. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb.egg-info/dependency_links.txt +0 -0
  79. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb.egg-info/not-zip-safe +0 -0
  80. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb.egg-info/requires.txt +0 -0
  81. {QWeb-3.2.1 → QWeb-3.3.1}/QWeb.egg-info/top_level.txt +0 -0
  82. {QWeb-3.2.1 → QWeb-3.3.1}/README.md +0 -0
  83. {QWeb-3.2.1 → QWeb-3.3.1}/setup.cfg +0 -0
  84. {QWeb-3.2.1 → QWeb-3.3.1}/setup.py +0 -0
  85. {QWeb-3.2.1 → QWeb-3.3.1}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: QWeb
3
- Version: 3.2.1
3
+ Version: 3.3.1
4
4
  Summary: Keyword driven automation for the web
5
5
  Home-page: https://github.com/qentinelqi/qweb/
6
6
  Author: Qentinel Group
@@ -23,9 +23,31 @@ from functools import wraps
23
23
  from QWeb import custom_config
24
24
 
25
25
  try:
26
- from QWeb.keywords import (alert, browser, window, frame, element, text, checkbox, input_,
27
- javascript, screenshot, download, table, search_strategy, dropdown,
28
- cookies, config, icon, dragdrop, lists, file, debug, ajax, blocks)
26
+ from QWeb.keywords import (
27
+ alert,
28
+ browser,
29
+ window,
30
+ frame,
31
+ element,
32
+ text,
33
+ checkbox,
34
+ input_,
35
+ javascript,
36
+ screenshot,
37
+ download,
38
+ table,
39
+ search_strategy,
40
+ dropdown,
41
+ cookies,
42
+ config,
43
+ icon,
44
+ dragdrop,
45
+ lists,
46
+ file,
47
+ debug,
48
+ ajax,
49
+ blocks,
50
+ )
29
51
 
30
52
  from QWeb.internal import util
31
53
  from QWeb.internal.config_defaults import CONFIG
@@ -271,19 +293,43 @@ class QWeb:
271
293
  then continue.
272
294
 
273
295
  """
274
- ROBOT_LIBRARY_SCOPE = 'Global'
296
+
297
+ ROBOT_LIBRARY_SCOPE = "Global"
275
298
 
276
299
  def __init__(self, run_on_failure_keyword: str = "Log Screenshot") -> None:
277
- '''Initializes the QWeb library and adds all the keywords to the instance.
300
+ """Initializes the QWeb library and adds all the keywords to the instance.
278
301
 
279
302
  - ``run_on_failure_keyword``:
280
303
  The keyword to run when a failure occurs. Default is "Log Screenshot".
281
304
 
282
- '''
305
+ """
283
306
  self._run_on_failure_keyword = run_on_failure_keyword
284
- for module in (alert, browser, window, frame, element, text, checkbox, input_, javascript,
285
- screenshot, custom_config, download, search_strategy, table, dropdown,
286
- cookies, config, icon, dragdrop, lists, file, debug, ajax, blocks):
307
+ for module in (
308
+ alert,
309
+ browser,
310
+ window,
311
+ frame,
312
+ element,
313
+ text,
314
+ checkbox,
315
+ input_,
316
+ javascript,
317
+ screenshot,
318
+ custom_config,
319
+ download,
320
+ search_strategy,
321
+ table,
322
+ dropdown,
323
+ cookies,
324
+ config,
325
+ icon,
326
+ dragdrop,
327
+ lists,
328
+ file,
329
+ debug,
330
+ ajax,
331
+ blocks,
332
+ ):
287
333
  for name in dir(module):
288
334
  if not name.startswith("_"):
289
335
  attr = getattr(module, name)
@@ -301,14 +347,14 @@ class QWeb:
301
347
  @wraps(keyword_method) # Preserves docstring of the original method.
302
348
  def inner(*args: Any, **kwargs: Any) -> None: # pylint: disable=R1710
303
349
  kwargs = {k.lower(): v for k, v in kwargs.items()} # Kwargs keys to lowercase
304
- if 'type_secret' not in str(keyword_method):
305
- logger.debug('args: {}, kwargs: {}'.format(args, kwargs))
350
+ if "type_secret" not in str(keyword_method):
351
+ logger.debug("args: {}, kwargs: {}".format(args, kwargs))
306
352
  try:
307
- time.sleep(_timestr_to_secs(kwargs.get('delay', CONFIG['Delay'])))
308
- run_before = CONFIG['RunBefore']
309
- valid_pw = ['click', 'get_text', 'drop_down']
353
+ time.sleep(_timestr_to_secs(kwargs.get("delay", CONFIG["Delay"])))
354
+ run_before = CONFIG["RunBefore"]
355
+ valid_pw = ["click", "get_text", "drop_down"]
310
356
  if run_before and any(pw in str(keyword_method) for pw in valid_pw):
311
- logger.info('executing run before kw {}'.format(run_before))
357
+ logger.info("executing run before kw {}".format(run_before))
312
358
  # robot fw or python syntax
313
359
  if isinstance(run_before, list):
314
360
  BuiltIn().run_keyword(run_before[0], *run_before[1:])
@@ -322,17 +368,18 @@ class QWeb:
322
368
  except Exception as e: # pylint: disable=W0703
323
369
  logger.debug(traceback.format_exc())
324
370
  if not self._is_run_on_failure_keyword(keyword_method):
325
- if not util.par2bool(kwargs.get('skip_screenshot', False)):
371
+ if not util.par2bool(kwargs.get("skip_screenshot", False)):
326
372
  try:
327
373
  BuiltIn().run_keyword(self._run_on_failure_keyword)
328
374
  except RobotNotRunningError:
329
375
  logger.debug("Robot not running")
330
- devmode = util.par2bool(util.get_rfw_variable_value('${DEV_MODE}', False))
331
- if devmode and not config.get_config('Debug_Run'):
332
- Dialogs.pause_execution('Keyword {} {} {} failed. \n'
333
- 'Got {}'.format(
334
- str(keyword_method).split(' ')[1].upper(),
335
- str(args), str(kwargs), e))
376
+ devmode = util.par2bool(util.get_rfw_variable_value("${DEV_MODE}", False))
377
+ if devmode and not config.get_config("Debug_Run"):
378
+ Dialogs.pause_execution(
379
+ "Keyword {} {} {} failed. \n" "Got {}".format(
380
+ str(keyword_method).split(" ")[1].upper(), str(args), str(kwargs), e
381
+ )
382
+ )
336
383
  debug.debug_on()
337
384
  else:
338
385
  raise
@@ -348,13 +395,12 @@ class QWeb:
348
395
 
349
396
  @wraps(keyword_method) # Preserves docstring of the original method.
350
397
  def create_xpath(*args: Any, **kwargs: Any) -> Callable[..., Any]:
351
- """Handle xpath before passing it to keyword.
352
- """
398
+ """Handle xpath before passing it to keyword."""
353
399
  args_list = list(args)
354
- if 'selector' in kwargs:
400
+ if "selector" in kwargs:
355
401
  attr_value = str(args_list[0])
356
- args_list[0] = '//*[@{}="{}"]'.format(kwargs['selector'], attr_value)
357
- del kwargs['selector']
402
+ args_list[0] = '//*[@{}="{}"]'.format(kwargs["selector"], attr_value)
403
+ del kwargs["selector"]
358
404
  args = tuple(args_list)
359
405
  return keyword_method(*args, **kwargs)
360
406
 
@@ -362,12 +408,12 @@ class QWeb:
362
408
 
363
409
  def _is_run_on_failure_keyword(self, method: Callable[..., Any]) -> bool:
364
410
  """Helper function to find out if method name is the
365
- one registered as kw to run on failure"""
411
+ one registered as kw to run on failure"""
366
412
  return self._run_on_failure_keyword.replace(" ", "_").lower() == method.__name__
367
413
 
368
414
 
369
415
  # pylint: disable=wrong-import-position
370
416
  from ._version import get_versions # noqa: E402
371
417
 
372
- __version__ = get_versions()['version']
418
+ __version__ = get_versions()["version"]
373
419
  del get_versions
@@ -22,21 +22,24 @@ from robot import libdoc # type: ignore
22
22
 
23
23
  def cli() -> None:
24
24
  parser = argparse.ArgumentParser(
25
- prog='QWeb',
26
- usage='python %(prog)s [options] INPUT'
27
- '\n\nEXAMPLES:\n'
28
- '%(prog)s --all (lists all keywords)\n'
25
+ prog="QWeb",
26
+ usage="python %(prog)s [options] INPUT"
27
+ "\n\nEXAMPLES:\n"
28
+ "%(prog)s --all (lists all keywords)\n"
29
29
  '%(prog)s --list Get (lists all keywords startin with "Get")\n'
30
30
  '%(prog)s --show TypeText (displays documentation for keyword "TypeText")',
31
- description='Note: This module is meant to be used as a robot famework library.'
32
- 'Command line interface only provides access to keyword documentation.')
33
- parser.add_argument('-V',
34
- '--version',
35
- action='version',
36
- version='%(prog)s {version}'.format(version=__version__))
37
- parser.add_argument('-A', '--all', action='store_true', help='lists ALL keywords')
38
- parser.add_argument('-L', '--list', action='store', help='lists keywords based on input string')
39
- parser.add_argument('-S', '--show', action='store', help='show docs for keyword(s)')
31
+ description="Note: This module is meant to be used as a robot famework library."
32
+ "Command line interface only provides access to keyword documentation.",
33
+ )
34
+ parser.add_argument(
35
+ "-V",
36
+ "--version",
37
+ action="version",
38
+ version="%(prog)s {version}".format(version=__version__),
39
+ )
40
+ parser.add_argument("-A", "--all", action="store_true", help="lists ALL keywords")
41
+ parser.add_argument("-L", "--list", action="store", help="lists keywords based on input string")
42
+ parser.add_argument("-S", "--show", action="store", help="show docs for keyword(s)")
40
43
  if len(sys.argv) == 1:
41
44
  parser.print_help()
42
45
  args = parser.parse_args()
@@ -51,6 +54,6 @@ def cli() -> None:
51
54
 
52
55
 
53
56
  if __name__ == "__main__":
54
- __version__ = get_versions()['version']
57
+ __version__ = get_versions()["version"]
55
58
  del get_versions
56
59
  cli()
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-04-08T09:18:30+0300",
11
+ "date": "2024-05-22T15:39:23+0300",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "8340ddbaf3eff96259c8c3b07467fdba9a27e331",
15
- "version": "v3.2.1"
14
+ "full-revisionid": "17e1c21838fcba8fb0a839efefe66df28dd0d45e",
15
+ "version": "v3.3.1"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -32,7 +32,7 @@ def set_wait_function(function: Callable[..., Any]) -> Callable[..., Any]:
32
32
  if callable(function):
33
33
  frame.wait_page_loaded = function
34
34
  else:
35
- raise ValueError('Argument needs to be callable: {}'.format(function))
35
+ raise ValueError("Argument needs to be callable: {}".format(function))
36
36
  return previous
37
37
 
38
38