cucu 1.3.7__py3-none-any.whl → 1.3.9__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.

cucu/ansi_parser.py CHANGED
@@ -25,12 +25,13 @@ TRANSLATION = (
25
25
  ESC_SEQ + "55": "", # ignore HOME (num keypad)
26
26
  ESC_SEQ + "56": "", # ignore UP ARROW (num keypad)
27
27
  ESC_SEQ + "57": "", # ignore PAGE UP (num keypad)
28
+ ESC_SEQ + "1A": "", # ignore move cursor up one line
28
29
  }
29
30
  )
30
31
  RE_TO_HTML = re.compile("|".join(map(re.escape, TRANSLATION)))
31
32
 
32
33
  RE_TO_REMOVE = re.compile(
33
- r"\x1b\[(0;)?[0-9A-F]{1,2}m"
34
+ r"\x1b\[(0;)?[0-9A-F]{1,2}[mA]:?"
34
35
  ) # detect hex values, not just decimal digits
35
36
 
36
37
 
cucu/db.py CHANGED
@@ -123,16 +123,16 @@ class step(BaseModel):
123
123
  duration = FloatField(null=True)
124
124
  start_at = DateTimeField(null=True)
125
125
  end_at = DateTimeField(null=True)
126
- stdout = JSONField(null=True)
127
- stderr = JSONField(null=True)
126
+ stdout = JSONField()
127
+ stderr = JSONField()
128
128
  error_message = JSONField(null=True)
129
129
  exception = JSONField(null=True)
130
- debug_output = TextField(null=True)
131
- browser_info = JSONField(null=True)
130
+ debug_output = TextField()
131
+ browser_info = JSONField()
132
132
  text = JSONField(null=True)
133
133
  table_data = JSONField(null=True)
134
134
  location = TextField()
135
- browser_logs = TextField(null=True)
135
+ browser_logs = TextField()
136
136
  screenshots = JSONField(null=True)
137
137
 
138
138
 
@@ -213,6 +213,11 @@ def start_step_record(step_obj, scenario_run_id):
213
213
  is_substep=getattr(step_obj, "is_substep", False),
214
214
  has_substeps=getattr(step_obj, "has_substeps", False),
215
215
  section_level=getattr(step_obj, "section_level", None),
216
+ browser_info="",
217
+ browser_logs="",
218
+ debug_output="",
219
+ stderr=[],
220
+ stdout=[],
216
221
  )
217
222
 
218
223
 
cucu/formatter/junit.py CHANGED
@@ -10,6 +10,7 @@ from behave.model_core import Status
10
10
  from bs4.formatter import XMLFormatter
11
11
  from tenacity import RetryError
12
12
 
13
+ from cucu.ansi_parser import remove_ansi
13
14
  from cucu.config import CONFIG
14
15
  from cucu.utils import ellipsize_filename
15
16
 
@@ -286,7 +287,8 @@ class CucuJUnitFormatter(Formatter):
286
287
  if scenario["failure"] is not None:
287
288
  failure_message = "\n".join(scenario["failure"])
288
289
  failure = bs4.Tag(name="failure")
289
- failure.append(bs4.CData(failure_message))
290
+ cleaned_failure_message = remove_ansi(failure_message)
291
+ failure.append(bs4.CData(cleaned_failure_message))
290
292
  testcase.append(failure)
291
293
 
292
294
  if scenario["skipped"] is not None:
cucu/formatter/rundb.py CHANGED
@@ -132,6 +132,8 @@ class RundbFormatter(Formatter):
132
132
  def scenario(self, scenario):
133
133
  """Called before a scenario is executed (or ScenarioOutline scenarios)."""
134
134
  self._finish_scenario()
135
+ # Set after CONFIG.restore() in environment.before_scenario()
136
+ CONFIG["FEATURE_RUN_ID"] = scenario.feature.feature_run_id
135
137
 
136
138
  self.this_scenario = scenario
137
139
  self.this_steps = []
@@ -139,7 +141,9 @@ class RundbFormatter(Formatter):
139
141
  scenario_run_id_seed = (
140
142
  f"{scenario.feature.feature_run_id}_{time.perf_counter()}"
141
143
  )
142
- scenario.scenario_run_id = generate_short_id(scenario_run_id_seed)
144
+ CONFIG["SCENARIO_RUN_ID"] = scenario.scenario_run_id = (
145
+ generate_short_id(scenario_run_id_seed)
146
+ )
143
147
  scenario.custom_data = {}
144
148
 
145
149
  # feature.scenarios is a mix of Scenario and ScenarioOutline objects with their own scenarios list
cucu/reporter/html.py CHANGED
@@ -139,14 +139,21 @@ def generate(results, basepath, only_failures=False):
139
139
  if db_step.table_data:
140
140
  step_dict["table"] = db_step.table_data
141
141
 
142
- step_dict["result"]["error_message"] = [
143
- db_step.error_message
144
- ]
145
-
142
+ step_dict["result"]["error_message"] = (
143
+ db_step.error_message.splitlines()
144
+ if db_step.error_message
145
+ else []
146
+ )
146
147
  step_dict["result"]["exception"] = db_step.exception
147
-
148
148
  step_dict["result"]["stdout"] = db_step.stdout
149
149
  step_dict["result"]["stderr"] = db_step.stderr
150
+ step_dict["result"]["browser_logs"] = (
151
+ db_step.browser_logs.splitlines()
152
+ )
153
+ step_dict["result"]["debug_output"] = (
154
+ db_step.debug_output.splitlines()
155
+ )
156
+
150
157
  scenario_dict["steps"].append(step_dict)
151
158
 
152
159
  feature_dict["elements"].append(scenario_dict)
@@ -87,6 +87,9 @@
87
87
  {% endif %}
88
88
  {% if step['result'] is defined %}
89
89
  {% set step_status = step['result']['status'] %}
90
+ {% if step['result']['status'] == 'skipped' %}
91
+ {% set step_status = 'untested' %}
92
+ {% endif %}
90
93
  {% if step['result']['status'] in ('failed', 'passed') and step["result"]["timestamp"] %}
91
94
  {% set step_timing = "{} for {:.3f}s".format(step["result"]["timestamp"].strftime("%H:%M:%S"), step["result"]["duration"]) %}
92
95
  {% set step_start = step["result"]["timestamp"] %}
@@ -131,24 +134,32 @@
131
134
  <tr class="row"><td style="min-width: 0;" class="col-12 collapse multi-collapse" id="collapsable-row-{{ loop.index }}" colspan="2">
132
135
 
133
136
  {% if step['result']['stdout'] %}
137
+ <p>stdout ({{ step['result']['stdout']|length }} lines)</p>
134
138
  <pre style="color: darkgray; margin: 0;">{{ escape("\n".join(step['result']['stdout'])) }}</pre>
135
139
  {% endif %}
136
-
137
- {% if step['images'] is defined %}
138
- {% if step['result']['stdout'] %}
139
- <br/>
140
- {% endif %}
140
+ {% if step['result']['stderr'] %}
141
+ <p>stderr ({{ step['result']['stderr']|length }} lines)</p>
142
+ <pre style="color: darkgray; margin: 0;">{{ escape("\n".join(step['result']['stderr'])) }}</pre>
143
+ {% endif %}
144
+ {% if step['images'] %}
145
+ <p>images ({{ step['images']|length }} images)</p>
141
146
  {% for image in step['images'] %}
142
147
  <img class="mx-auto d-block img-fluid shadow bg-white rounded" style="margin-bottom:15px" alt='{{ image["label"] }}' title='{{ image["label"] }}' src='{{ image["src"] }}'></img>
143
148
  {% endfor %}
144
149
  {% endif %}
145
-
146
- {% if step['result']['error_message'] is defined %}
147
- {% if step['image'] is defined %}
148
- <br/>
149
- {% endif %}
150
+ {% if step['result']['error_message'] %}
151
+ <p>error message ({{ step['result']['error_message']|length }} lines)</p>
150
152
  <pre style="color: gray; margin: 0">{{ escape("\n".join(step['result']['error_message'])) }}</pre>
151
153
  {% endif %}
154
+ {% if step['result']['browser_logs'] %}
155
+ <p>browser logs ({{ step['result']['browser_logs']|length }} lines)</p>
156
+ <pre style="color: gray; margin: 0;">{{ escape("\n".join(step['result']['browser_logs'])) }}</pre>
157
+ {% endif %}
158
+ {% if step['result']['debug_output'] %}
159
+ <p>debug output ({{ step['result']['debug_output']|length }} lines)</p>
160
+ <pre style="color: gray; margin: 0;">{{ escape("\n".join(step['result']['debug_output'])) }}</pre>
161
+ {% endif %}
162
+
152
163
  </td></tr>
153
164
  {% endif %}
154
165
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cucu
3
- Version: 1.3.7
3
+ Version: 1.3.9
4
4
  Summary: Easy BDD web testing
5
5
  Keywords: cucumber,selenium,behave
6
6
  Author: Domino Data Lab, Rodney Gomes, Cedric Young, Xin Dong, Kavya Yakkati, Kevin Garton, Joy Liao
@@ -1,5 +1,5 @@
1
1
  cucu/__init__.py,sha256=YtuajsJBj3_DgNoygHen9gKojeQF523Oc27kyCUzoG0,1013
2
- cucu/ansi_parser.py,sha256=_yTlqr6KruLsqgWR6BkpJUC3bmlQy_9JbkuxFx6Jrbo,2213
2
+ cucu/ansi_parser.py,sha256=gjAWBShqsm0GFdJWv8ptsN8he4HgaT18E7GNl3Po46o,2280
3
3
  cucu/behave_tweaks.py,sha256=MqIL9BDHMvmyXyzkVGbD3wd8IP38_8pgp3NPGDWudm8,6873
4
4
  cucu/browser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  cucu/browser/core.py,sha256=Ixcqr8l4xshzdW4AKcl1IkH98xHwRYsbt4snV7wUDlo,2692
@@ -12,7 +12,7 @@ cucu/cli/run.py,sha256=XIGIACPieywM5Mi3k_CycM9eiRElzGNZdHlV0_TDSVY,6118
12
12
  cucu/cli/steps.py,sha256=lg5itVH_C-0_3RelWXv9X2qQUHggdxuxLCGwH5l1bf4,4210
13
13
  cucu/cli/thread_dumper.py,sha256=Z3XnYSxidx6pqjlQ7zu-TKMIYZWk4z9c5YLdPkcemiU,1593
14
14
  cucu/config.py,sha256=5AE6GrkqzjNhzzrB-eZrINgeztV7CCGuSdWJ-5GtWhk,14939
15
- cucu/db.py,sha256=iJ5NXECcqVbPdqozuQrdRGpCX1EgEENwDEGEsLUxpRs,14513
15
+ cucu/db.py,sha256=0aT4h1hGeToIBXlPoxkuB7dBpQ3lMlUHWfq-J3WJINA,14581
16
16
  cucu/edgedriver_autoinstaller/README.md,sha256=tDkAWIqgRdCjt-oX1nYqikIC_FfiOEM2-pc5S5VbRLo,84
17
17
  cucu/edgedriver_autoinstaller/__init__.py,sha256=fo6xJJPvcc5Xvni8epXfxDoPxJH5_b6Vk2jD9JTwfRs,969
18
18
  cucu/edgedriver_autoinstaller/utils.py,sha256=iRKTww77CGaTAntt_QDvxlKPxpMU4otx95OeD97khcM,6802
@@ -21,8 +21,8 @@ cucu/external/jquery/jquery-3.5.1.min.js,sha256=9_aliU8dGd2tb6OSsuzixeV4y_faTqgF
21
21
  cucu/formatter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  cucu/formatter/cucu.py,sha256=NRLFsd6xl3uwUk45ihKN2OEioOeAqeTURrcQgscDGnU,9351
23
23
  cucu/formatter/json.py,sha256=fJ1dZBGwYD4OkhQFDE49MRKGNzsrhDzQYq-dUfsYh94,10589
24
- cucu/formatter/junit.py,sha256=aJ9dGLbamMH-wUi_msF66_-_c_YUq07-8_wCNEjUju4,10129
25
- cucu/formatter/rundb.py,sha256=7gKVPbSg7bCuAt972XRs5vRjeowLzVZPaOHCIxUazrE,7668
24
+ cucu/formatter/junit.py,sha256=dCyS47iHOqn5AZjsRpWCsDRkxxJ67IZy3wIlE5jjhoM,10249
25
+ cucu/formatter/rundb.py,sha256=dKNlD-LXmrJ1Gm4OHI7Cs49eMuBGlBfwLz7NLISF5sg,7857
26
26
  cucu/fuzzy/__init__.py,sha256=ce4JRmaBF6oab6U99Qbpt7DrD3elhH32__-ND6fw5xc,104
27
27
  cucu/fuzzy/core.py,sha256=tmQKX_Ni-2ohoxzctRUg2x7zMeEW8MlJJmpU3PfTmvQ,3153
28
28
  cucu/fuzzy/fuzzy.js,sha256=ee-TytISLyUo7cMAkuVI5qbLXdt0eoFWczTsoU4zYhg,11618
@@ -56,12 +56,12 @@ cucu/reporter/external/jquery-3.5.1.min.js,sha256=9_aliU8dGd2tb6OSsuzixeV4y_faTq
56
56
  cucu/reporter/external/jquery.dataTables.min.js,sha256=XNhaB1tBOSFMHu96BSAJpZOJzfZ4SZI1nwAbnwry2UY,90265
57
57
  cucu/reporter/external/popper.min.js,sha256=pS96pU17yq-gVu4KBQJi38VpSuKN7otMrDQprzf_DWY,19188
58
58
  cucu/reporter/favicon.png,sha256=9ikXLAmzfQzy2NQps_8CGaZog2FvQrOX8nnSZ0e1UmM,2161
59
- cucu/reporter/html.py,sha256=2BAZMYbB-xMZdQXZeE8FgWJdWmScGY8JHWaQqiBP03I,19143
59
+ cucu/reporter/html.py,sha256=PhITO1Zxc3WVl1nU7maKpDeUvYmlkkv4cMNTFJnnTxM,19516
60
60
  cucu/reporter/templates/feature.html,sha256=IBkwGiul-sRO5lT8q8VFXMUJx1owsAd1YbdDzziSjKw,3645
61
61
  cucu/reporter/templates/flat.html,sha256=JGsMq-IWz6YUpJX9hcN65-15HxcX3NJclOmMDtW3HZE,2358
62
62
  cucu/reporter/templates/index.html,sha256=xgPYNU-sozN-iOaEzyymoQ4LDRI75eHXngbAP0xDYls,2770
63
63
  cucu/reporter/templates/layout.html,sha256=2iDRbm8atO8mgHWgijIvDCrBMKvcP6YHrmr95WtJiE4,4561
64
- cucu/reporter/templates/scenario.html,sha256=Vgl8A2O_hwG2W6JD5XtJi7xmTTWRe4XyqgfjfB1QmgM,10119
64
+ cucu/reporter/templates/scenario.html,sha256=zxVCBLHqaeai6mcRGbpXmREvNeSAyQrygXLzdF30xb0,11120
65
65
  cucu/steps/__init__.py,sha256=seSmASBlWu6-6wbFbvEbPwigBcRXiYP18C4X_2cW8Ng,753
66
66
  cucu/steps/base_steps.py,sha256=0fPvdaKoan8lMAKrDnK0-zrALpxm11P1zVAY5CN7iXA,1893
67
67
  cucu/steps/browser_steps.py,sha256=iTRl5ffpf2YrFk5qh655WFHAeSOwoE3HFhmXhjsZtao,12687
@@ -88,7 +88,7 @@ cucu/steps/text_steps.py,sha256=Jj_GHoHeemNwVdUOdqcehArNp7WM-WMjljA4w0pLXuw,2576
88
88
  cucu/steps/variable_steps.py,sha256=WSctH3_xcxjijGPYZlxp-foC_SIAAKtF__saNtgZJbk,2966
89
89
  cucu/steps/webserver_steps.py,sha256=wWkpSvcSMdiskPkh4cqlepWx1nkvEpTU2tRXQmPDbyo,1410
90
90
  cucu/utils.py,sha256=LCcs8sMzvdvH05N8P5QYO4lO6j-_PQC530mEAD96go8,10957
91
- cucu-1.3.7.dist-info/WHEEL,sha256=-neZj6nU9KAMg2CnCY6T3w8J53nx1kFGw_9HfoSzM60,79
92
- cucu-1.3.7.dist-info/entry_points.txt,sha256=11WRIhQM7LuUnQg1lAoZQoNvvBvYNN1maDgQS4djwJo,40
93
- cucu-1.3.7.dist-info/METADATA,sha256=odrZlSjtaYwYeWjol9l24U6-UFjMCw3WbSQ_X5dgAEw,16721
94
- cucu-1.3.7.dist-info/RECORD,,
91
+ cucu-1.3.9.dist-info/WHEEL,sha256=-neZj6nU9KAMg2CnCY6T3w8J53nx1kFGw_9HfoSzM60,79
92
+ cucu-1.3.9.dist-info/entry_points.txt,sha256=11WRIhQM7LuUnQg1lAoZQoNvvBvYNN1maDgQS4djwJo,40
93
+ cucu-1.3.9.dist-info/METADATA,sha256=3vWeUwEJ0WyZAdYNYAktzlhpWg7vWTz0i_cqiLb2tvk,16721
94
+ cucu-1.3.9.dist-info/RECORD,,
File without changes