e2e: report fixes

This commit is contained in:
Churikova Tetiana 2022-08-23 17:14:56 +02:00
parent 53770725e5
commit 62a4c40afa
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
3 changed files with 10 additions and 13 deletions

View File

@ -120,7 +120,7 @@ class GithubHtmlReport(BaseTestReport):
for step in last_testrun.steps: for step in last_testrun.steps:
test_steps_html.append("<div>%s</div>" % step) test_steps_html.append("<div>%s</div>" % step)
if last_testrun.error: if last_testrun.error:
error = last_testrun.error[:255] error = last_testrun.error
if test_steps_html: if test_steps_html:
html += "<p>" html += "<p>"
html += "<blockquote>" html += "<blockquote>"
@ -130,13 +130,11 @@ class GithubHtmlReport(BaseTestReport):
html += "</p>" html += "</p>"
code_error, no_code_error_str, _ = self.separate_xfail_error(error) code_error, no_code_error_str, _ = self.separate_xfail_error(error)
if no_code_error_str: if no_code_error_str:
html += "<code>%s</code>" % code_error html += "\n\n```\n%s\n```\n\n" % code_error
html += "<b>%s</b>" % no_code_error_str html += "<b>%s</b>" % no_code_error_str
else: else:
html += "<code>%s</code>" % error.replace("[[", "<b>[[").replace("]]", "]]</b>") html += "\n\n```\n%s\n```\n\n" % error.replace("[[", "<b>[[").replace("]]", "]]</b>")
html += "<br/><br/>" html += "<br/><br/>"
if test.group_name:
html += "<p><b>Class: %s</b></p>" % test.group_name
if last_testrun.jobs: if last_testrun.jobs:
html += self.build_device_sessions_html(last_testrun) html += self.build_device_sessions_html(last_testrun)
html += "</td></tr>" html += "</td></tr>"

View File

@ -249,14 +249,14 @@ class TestrailReport(BaseTestReport):
if failed_tests: if failed_tests:
for test in failed_tests: for test in failed_tests:
if test.group_name: if test.group_name:
group_blocks[test.group_name] = "-------\n## Class: %s:\n" % test.group_name group_blocks[test.group_name] = "\n-------\n## Class: %s:\n" % test.group_name
for test in failed_tests: for test in failed_tests:
last_testrun = test.testruns[-1] last_testrun = test.testruns[-1]
test_rail_link = self.get_test_result_link(self.run_id, test.testrail_case_id) test_rail_link = self.get_test_result_link(self.run_id, test.testrail_case_id)
ids_failed_test.append(test.testrail_case_id) ids_failed_test.append(test.testrail_case_id)
case_title = '\n' case_title = '\n'
case_title += '-------\n' case_title += '-------\n'
case_title += "## ID %s: [%s](%s) \n" % (test.testrail_case_id, test.name, test_rail_link) case_title += "### ID %s: [%s](%s) \n" % (test.testrail_case_id, test.name, test_rail_link)
full_error = last_testrun.error[-255:] full_error = last_testrun.error[-255:]
(code_error, no_code_error_str, issue_id) = self.separate_xfail_error(full_error) (code_error, no_code_error_str, issue_id) = self.separate_xfail_error(full_error)
if issue_id: if issue_id:

View File

@ -23,7 +23,6 @@ class BackButton(Button):
return self.navigate() return self.navigate()
class AllowButton(Button): class AllowButton(Button):
def __init__(self, driver): def __init__(self, driver):
super().__init__(driver, translation_id="allow", uppercase=True) super().__init__(driver, translation_id="allow", uppercase=True)
@ -539,16 +538,16 @@ class BaseView(object):
def get_back_to_home_view(self, times_to_click_on_back_btn=3): def get_back_to_home_view(self, times_to_click_on_back_btn=3):
counter = 0 counter = 0
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): 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):
try: try:
if counter >= times_to_click_on_back_btn: if counter >= times_to_click_on_back_btn:
break break
if BackButton(self.driver).is_element_displayed(2): if self.back_button.is_element_displayed(2):
self.back_button.click() self.back_button.click_until_presence_of_element(self.home_button)
elif self.close_button.is_element_displayed(2): elif self.close_button.is_element_displayed(2):
self.close_button.click() self.close_button.click_until_presence_of_element(self.home_button)
else: else:
self.navigate_up_button.click() self.navigate_up_button.click_until_presence_of_element(self.home_button)
counter += 1 counter += 1
except (NoSuchElementException, TimeoutException): except (NoSuchElementException, TimeoutException):
continue continue