Skip to content

Commit f38071f

Browse files
committed
try to fix errors during local test execution and coderage don't exists
1 parent 434c546 commit f38071f

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ instrumented
77
node_modules
88
venv
99
coverage
10+
.claude*
11+
.qwen*
12+
.opencode*

tests/testflows/steps/ui.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,15 @@ def save_coverage(self):
259259
with By("executing 'return JSON.stringify(window.__coverage__);' in chrome console"):
260260
coverage_info = driver.execute_script('return JSON.stringify(window.__coverage__);')
261261

262-
if not(coverage_info is None):
262+
# Skip empty payloads and always write into tests/testflows/coverage/raw
263+
if coverage_info not in (None, "null"):
263264
with By("saving coverage into the file"):
264-
timestamp = datetime.datetime.timestamp(datetime.datetime.now())
265-
file = open(f"coverage/raw/coverage{timestamp}.json", 'w')
266-
file.write(coverage_info)
267-
file.close()
265+
coverage_dir = os.path.join(current_dir(), "..", "coverage", "raw")
266+
os.makedirs(coverage_dir, exist_ok=True)
267+
timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S%f")
268+
file_path = os.path.join(coverage_dir, f"coverage{timestamp}.json")
269+
with open(file_path, "w", encoding="utf-8") as file:
270+
file.write(coverage_info)
268271

269272
@TestStep(When)
270273
def dismiss_alert_if_present(self):

0 commit comments

Comments
 (0)