Skip to content

Commit 62a4c40

Browse files
committed
e2e: report fixes
1 parent 5377072 commit 62a4c40

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

test/appium/support/github_report.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def build_test_row_html(self, index, test, run_id):
120120
for step in last_testrun.steps:
121121
test_steps_html.append("<div>%s</div>" % step)
122122
if last_testrun.error:
123-
error = last_testrun.error[:255]
123+
error = last_testrun.error
124124
if test_steps_html:
125125
html += "<p>"
126126
html += "<blockquote>"
@@ -130,13 +130,11 @@ def build_test_row_html(self, index, test, run_id):
130130
html += "</p>"
131131
code_error, no_code_error_str, _ = self.separate_xfail_error(error)
132132
if no_code_error_str:
133-
html += "<code>%s</code>" % code_error
133+
html += "\n\n```\n%s\n```\n\n" % code_error
134134
html += "<b>%s</b>" % no_code_error_str
135135
else:
136-
html += "<code>%s</code>" % error.replace("[[", "<b>[[").replace("]]", "]]</b>")
136+
html += "\n\n```\n%s\n```\n\n" % error.replace("[[", "<b>[[").replace("]]", "]]</b>")
137137
html += "<br/><br/>"
138-
if test.group_name:
139-
html += "<p><b>Class: %s</b></p>" % test.group_name
140138
if last_testrun.jobs:
141139
html += self.build_device_sessions_html(last_testrun)
142140
html += "</td></tr>"

test/appium/support/testrail_report.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@ def change_test_run_description(self):
249249
if failed_tests:
250250
for test in failed_tests:
251251
if test.group_name:
252-
group_blocks[test.group_name] = "-------\n## Class: %s:\n" % test.group_name
252+
group_blocks[test.group_name] = "\n-------\n## Class: %s:\n" % test.group_name
253253
for test in failed_tests:
254254
last_testrun = test.testruns[-1]
255255
test_rail_link = self.get_test_result_link(self.run_id, test.testrail_case_id)
256256
ids_failed_test.append(test.testrail_case_id)
257257
case_title = '\n'
258258
case_title += '-------\n'
259-
case_title += "## ID %s: [%s](%s) \n" % (test.testrail_case_id, test.name, test_rail_link)
259+
case_title += "### ID %s: [%s](%s) \n" % (test.testrail_case_id, test.name, test_rail_link)
260260
full_error = last_testrun.error[-255:]
261261
(code_error, no_code_error_str, issue_id) = self.separate_xfail_error(full_error)
262262
if issue_id:

test/appium/views/base_view.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def click(self, times_to_click: int = 1):
2323
return self.navigate()
2424

2525

26-
2726
class AllowButton(Button):
2827
def __init__(self, driver):
2928
super().__init__(driver, translation_id="allow", uppercase=True)
@@ -539,16 +538,16 @@ def get_random_message():
539538

540539
def get_back_to_home_view(self, times_to_click_on_back_btn=3):
541540
counter = 0
542-
while BackButton(self.driver).is_element_displayed(2) or self.close_button.is_element_displayed(2) or self.navigate_up_button.is_element_displayed(2):
541+
while self.back_button.is_element_displayed(2) or self.close_button.is_element_displayed(2) or self.navigate_up_button.is_element_displayed(2):
543542
try:
544543
if counter >= times_to_click_on_back_btn:
545544
break
546-
if BackButton(self.driver).is_element_displayed(2):
547-
self.back_button.click()
545+
if self.back_button.is_element_displayed(2):
546+
self.back_button.click_until_presence_of_element(self.home_button)
548547
elif self.close_button.is_element_displayed(2):
549-
self.close_button.click()
548+
self.close_button.click_until_presence_of_element(self.home_button)
550549
else:
551-
self.navigate_up_button.click()
550+
self.navigate_up_button.click_until_presence_of_element(self.home_button)
552551
counter += 1
553552
except (NoSuchElementException, TimeoutException):
554553
continue

0 commit comments

Comments
 (0)