Skip to content

Commit

Permalink
Add linebreaks
Browse files Browse the repository at this point in the history
  • Loading branch information
manykarim committed Feb 16, 2024
1 parent f92d085 commit 64211a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions notifications/report_to_msteams.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def start_suite(self, suite):
writer = MarkdownTableWriter(table_name= "Run Overview", headers = run_columns, value_matrix = [[f"{pass_rate:.2f}%", stats.total.passed, stats.total.failed, stats.total.skipped, stats.total.total, result.suite.elapsed_time.total_seconds()]])
writer.stream = f
writer.write_table()
f.write("\n\n<br>\n\n")

suite_results = []
for suite in suites_with_tests:
Expand All @@ -34,6 +35,7 @@ def start_suite(self, suite):
writer = MarkdownTableWriter(table_name= "Test Status", headers = table_columns, value_matrix = suite_results)
writer.stream = f
writer.write_table()
f.write("\n\n<br>\n\n")

test_results = {}
for suite in suites_with_tests:
Expand All @@ -51,6 +53,8 @@ def start_suite(self, suite):
writer = MarkdownTableWriter(table_name= f"Failed and skipped tests in {suite}", headers = table_columns, value_matrix = test_results[suite])
writer.stream = f
writer.write_table()
f.write("\n\n<br>\n\n")


run_overview = open('run_overview.md', "r").read()
suite_overview = open('suite_overview.md', "r").read()
Expand All @@ -66,9 +70,9 @@ def start_suite(self, suite):

if stats.total.failed == 0:
title_message = "Test run completed successfully"
body_message = run_overview + "\n" + suite_overview
body_message = run_overview + suite_overview
apobj.notify(body=body_message, title=title_message, notify_type=NotifyType.SUCCESS)
else:
title_message = f"Test run completed with {stats.total.failed} failures"
body_message = run_overview + "\n" + suite_overview + "\n" + results
body_message = run_overview + suite_overview + results
apobj.notify(body=body_message, title=title_message, notify_type=NotifyType.FAILURE)

0 comments on commit 64211a6

Please sign in to comment.