File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import os
21import atexit
2+ import os
33import io
4+ import logging
5+
46from bs4 import BeautifulSoup
57import pytest
6- import logging
78from config .constants import URL
89from playwright .sync_api import sync_playwright
910from py .xml import html # type: ignore
@@ -80,13 +81,15 @@ def pytest_runtest_makereport(item, call):
8081 else :
8182 report .description = ""
8283
84+
8385def pytest_collection_modifyitems (items ):
8486 for item in items :
8587 if hasattr (item , 'callspec' ):
8688 prompt = item .callspec .params .get ("prompt" )
8789 if prompt :
8890 item ._nodeid = prompt # This controls how the test name appears in the report
8991
92+
9093def rename_duration_column ():
9194 report_path = os .path .abspath ("report.html" ) # or your report filename
9295 if not os .path .exists (report_path ):
@@ -109,9 +112,11 @@ def rename_duration_column():
109112 with open (report_path , 'w' , encoding = 'utf-8' ) as f :
110113 f .write (str (soup ))
111114
115+
112116# Register this function to run after everything is done
113117atexit .register (rename_duration_column )
114118
119+
115120# Add logs and docstring to report
116121@pytest .hookimpl (hookwrapper = True )
117122def pytest_runtest_makereport (item , call ):
Original file line number Diff line number Diff line change 11import logging
22import time
3+ from pages .HomePage import HomePage
34
45import pytest
56
6- from pages .HomePage import HomePage
7-
87logger = logging .getLogger (__name__ )
98
109# Define step-wise test actions for Golden Path
You can’t perform that action at this time.
0 commit comments