Skip to content

Commit ab1eb22

Browse files
committed
Bold text for xfail
1 parent 8a36ee8 commit ab1eb22

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

test/appium/support/base_test_report.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,14 @@ def is_test_successful(test):
130130
@staticmethod
131131
def separate_xfail_error(error):
132132
issue_id_list = re.findall(r'#\d+', error)
133-
main_error, no_code_error_str, issue_id = error, '', ''
134-
if issue_id_list:
135-
issue_id = issue_id_list[0]
136-
xfail_error = re.findall(r'\[\[.*\]\]', error)
137-
if xfail_error:
138-
no_code_error_str = xfail_error[0]
139-
main_error = error.replace(no_code_error_str, '')
140-
return (main_error, no_code_error_str, issue_id)
133+
issue_id = issue_id_list[0] if issue_id_list else ''
134+
135+
xfail_error = re.findall(r'\[\[.*\]\]', error)
136+
if xfail_error:
137+
no_code_error_str = xfail_error[0]
138+
main_error = error.replace(no_code_error_str, '')
139+
else:
140+
no_code_error_str = ''
141+
main_error = error
142+
143+
return main_error, no_code_error_str, issue_id

test/appium/support/github_report.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ def build_test_row_html(self, index, test, run_id):
118118
html += "%s" % ''.join(test_steps_html[-2:])
119119
html += "</blockquote>"
120120
html += "</p>"
121-
(code_error, no_code_error_str, issue_id) = self.separate_xfail_error(error)
121+
code_error, no_code_error_str, _ = self.separate_xfail_error(error)
122122
if no_code_error_str:
123123
html += "<code>%s</code>" % code_error
124-
html += no_code_error_str
124+
html += "<b>%s</b>" % no_code_error_str
125125
else:
126-
html += "<code>%s</code>" % error
126+
html += "<code>%s</code>" % error.replace("[[", "<b>[[").replace("]]", "]]</b>")
127127
html += "<br/><br/>"
128128
if test.group_name:
129129
html += "<p><b>Class: %s</b></p>" % test.group_name
@@ -140,9 +140,8 @@ def build_device_sessions_html(self, test_run):
140140
html += "Device %d:" % i
141141
html += "<ul>"
142142
if test_run.first_commands:
143-
html += "<li><a href=\"%s\">Steps, video, logs</a></li>" % self.get_sauce_job_url(job_id,
144-
test_run.first_commands[
145-
job_id])
143+
html += "<li><a href=\"%s\">Steps, video, logs</a></li>" % \
144+
self.get_sauce_job_url(job_id, test_run.first_commands[job_id])
146145
else:
147146
html += "<li><a href=\"%s\">Steps, video, logs</a></li>" % self.get_sauce_job_url(job_id)
148147
if test_run.error:

test/appium/support/testrail_report.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def add_results(self):
189189
error = "%s %s" % (code_error, test_rail_xfail)
190190
else:
191191
error = full_error
192+
error = error.replace("[[", "**").replace("]]", "**")
192193
comment += '%s' % ('# Error: \n %s \n' % emoji.demojize(error)) + devices + test_steps
193194
else:
194195
comment += devices + test_steps
@@ -257,9 +258,9 @@ def change_test_run_description(self):
257258
(code_error, no_code_error_str, issue_id) = self.separate_xfail_error(full_error)
258259
if issue_id:
259260
test_rail_xfail = self.make_error_with_gh_issue_link(no_code_error_str, issue_id)
260-
error = "```%s```\n %s \n" % (code_error, test_rail_xfail)
261+
error = "```%s```\n **%s** \n" % (code_error, test_rail_xfail)
261262
else:
262-
error = "```%s```\n" % full_error
263+
error = "```%s```\n **%s** \n" % (code_error, no_code_error_str)
263264
for job_id, f in last_testrun.jobs.items():
264265
if last_testrun.first_commands:
265266
job_url = self.get_sauce_job_url(job_id=job_id,
@@ -305,5 +306,5 @@ def get_not_executed_tests(self, test_run_id):
305306

306307
@staticmethod
307308
def make_error_with_gh_issue_link(error, issue_id):
308-
return error.replace(issue_id, '[%s](https://github.com/status-im/status-react/issues/%s)' % (issue_id, issue_id[1:]))
309-
309+
return error.replace(issue_id,
310+
'[%s](https://github.com/status-im/status-react/issues/%s)' % (issue_id, issue_id[1:]))

0 commit comments

Comments
 (0)