cucu 1.0.2__py3-none-any.whl → 1.0.4__py3-none-any.whl

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.

Potentially problematic release.


This version of cucu might be problematic. Click here for more details.

@@ -2,7 +2,7 @@ import os
2
2
 
3
3
  import humanize
4
4
 
5
- from cucu import fuzzy, logger, step
5
+ from cucu import fuzzy, logger, retry, step
6
6
  from cucu.utils import take_saw_element_screenshot
7
7
 
8
8
 
@@ -69,7 +69,6 @@ JS_DROP_FILE = """
69
69
  """
70
70
 
71
71
 
72
- @step('I drag and drop the file "{filepath}" to "{name}"')
73
72
  def drag_and_drop_file(ctx, name, filepath):
74
73
  drop_target = fuzzy.find(ctx.browser, name, ["*"])
75
74
  drop_target_html = drop_target.get_attribute("outerHTML")
@@ -78,3 +77,13 @@ def drag_and_drop_file(ctx, name, filepath):
78
77
  )
79
78
  file_input = ctx.browser.execute(JS_DROP_FILE, drop_target, 0, 0)
80
79
  file_input.send_keys(os.path.abspath(filepath))
80
+
81
+
82
+ @step('I drag and drop the file "{filepath}" to "{name}"')
83
+ def should_drag_and_drop_file(ctx, filepath, name):
84
+ drag_and_drop_file(ctx, name, filepath)
85
+
86
+
87
+ @step('I wait to drag and drop the file "{filepath}" to "{name}"')
88
+ def wait_to_drag_and_drop_file(ctx, filepath, name):
89
+ retry(drag_and_drop_file)(ctx, name, filepath)
cucu/utils.py CHANGED
@@ -11,6 +11,8 @@ import shutil
11
11
  import humanize
12
12
  from tabulate import DataRow, TableFormat, tabulate
13
13
  from tenacity import (
14
+ after_log,
15
+ before_log,
14
16
  before_sleep_log,
15
17
  retry_if_not_exception_type,
16
18
  stop_after_delay,
@@ -119,6 +121,8 @@ def retry(func, wait_up_to_s=None, retry_after_s=None):
119
121
  stop=stop_after_delay(wait_up_to_s),
120
122
  wait=wait_fixed(retry_after_s),
121
123
  retry=retry_if_not_exception_type(StopRetryException),
124
+ before=before_log(logger, logging.DEBUG),
125
+ after=after_log(logger, logging.DEBUG),
122
126
  before_sleep=before_sleep_log(logger, logging.DEBUG),
123
127
  )
124
128
  def new_decorator(*args, **kwargs):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cucu
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Easy BDD web testing
5
5
  Project-URL: Homepage, https://github.com/dominodatalab/cucu
6
6
  Project-URL: Download, https://pypi.org/project/cucu/
@@ -7,7 +7,7 @@ cucu/helpers.py,sha256=l_YMmbuXjtBRo-MER-qe6soUIyjt0ey2BoSgWs4zYwA,36285
7
7
  cucu/hooks.py,sha256=3Z1mavU42XMQ0DZ7lVWwTB-BJYHRyYUOzzOtmkdIsow,7117
8
8
  cucu/logger.py,sha256=LjJEzAKySlEiSmarpoeiMN4c29RIfrrERIk1swbdU4s,3343
9
9
  cucu/page_checks.py,sha256=vkkZ9EyLCNBAwriED8ur3zS3flOYchXx-mMcrZF5dgY,2176
10
- cucu/utils.py,sha256=eaGbrqVSdi4b59U2BjqRl-Yp7DsVTAlkN8DrFxQsX_o,8482
10
+ cucu/utils.py,sha256=608b28WVWgzmFMAMLXpFWeXe3NjRZEhpEfcTnYy2JRM,8611
11
11
  cucu/browser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  cucu/browser/core.py,sha256=YAHhj6AMf7kpZR57thQaPHVHVHwnMBzCI0yofIYtfaY,2355
13
13
  cucu/browser/frames.py,sha256=IW7kzRJn5PkbMaovIelAeCWO-T-2sOTwqaYBw-0-LKU,3545
@@ -60,7 +60,7 @@ cucu/steps/command_steps.py,sha256=nVCc8-TEitetk-zhk4z1wa0owqLQyHeQVH5THioUw-k,5
60
60
  cucu/steps/comment_steps.py,sha256=KcU0Ya8XSjYEh8gdUGh0qsAxgB_Ru977E84yJaXrvz0,379
61
61
  cucu/steps/draggable_steps.py,sha256=lnQLicp0GZJaxD_Qm2P13ruUZAsl3mptwaI5-SQ6XJ0,4655
62
62
  cucu/steps/dropdown_steps.py,sha256=abykG--m79kDQ4LU1tm73fNLFPmrKDavyFzJb2MYCu0,15601
63
- cucu/steps/file_input_steps.py,sha256=ng6cnLVKO0yAtd5HWy4AWomRbmYfxSIhhGDbOVZyRIA,2534
63
+ cucu/steps/file_input_steps.py,sha256=U-glhJN62cBGZMsqhegoCVvqo_GLGQowVb9VO2WmQ98,2812
64
64
  cucu/steps/filesystem_steps.py,sha256=8l37A-yPxT4Mzdi1JNSTShZkwyFxgSwnh6C0V-hM_RA,4741
65
65
  cucu/steps/flow_control_steps.py,sha256=vlW0CsphVS9NvrOnpT8wSS2ngHmO3Z87H9siKIQwsAw,6365
66
66
  cucu/steps/image_steps.py,sha256=4X6bdumsIybcJBuao83TURxWAIshZyCvKi1uTJEoy1k,941
@@ -76,8 +76,8 @@ cucu/steps/tables.js,sha256=Os2a7Fo-cg03XVli7USvcnBVad4N7idXr-HBuzdLvVQ,945
76
76
  cucu/steps/text_steps.py,sha256=Jj_GHoHeemNwVdUOdqcehArNp7WM-WMjljA4w0pLXuw,2576
77
77
  cucu/steps/variable_steps.py,sha256=WSctH3_xcxjijGPYZlxp-foC_SIAAKtF__saNtgZJbk,2966
78
78
  cucu/steps/webserver_steps.py,sha256=_bvqJxF8BSIIufNItZMSyjijEJEEPJbEvwnqPHoM9Tg,1259
79
- cucu-1.0.2.dist-info/METADATA,sha256=N7sYUoJnlT2VqkESiGX_pB4KhFHD7Ojvz9utNSQrwYg,16238
80
- cucu-1.0.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
81
- cucu-1.0.2.dist-info/entry_points.txt,sha256=YEXTyEfIZbcV0GJ9R3Gfu3j6DcOJJK7_XHkJqE3Yiao,39
82
- cucu-1.0.2.dist-info/licenses/LICENSE,sha256=WfgJYF9EaQoL_OeWr2Qd0MxhhFegDfzWSUmvDTwFxis,1721
83
- cucu-1.0.2.dist-info/RECORD,,
79
+ cucu-1.0.4.dist-info/METADATA,sha256=yLEP4pCBUrnEfeASyxMahBAy6SEX47S_hAt5HzkmPOk,16238
80
+ cucu-1.0.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
81
+ cucu-1.0.4.dist-info/entry_points.txt,sha256=YEXTyEfIZbcV0GJ9R3Gfu3j6DcOJJK7_XHkJqE3Yiao,39
82
+ cucu-1.0.4.dist-info/licenses/LICENSE,sha256=WfgJYF9EaQoL_OeWr2Qd0MxhhFegDfzWSUmvDTwFxis,1721
83
+ cucu-1.0.4.dist-info/RECORD,,
File without changes