Skip to content

Commit 1c7d8ec

Browse files
committed
chore: junit test result fix for win
1 parent 0cd385e commit 1c7d8ec

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

tests/runner/collection-run-report/collection-run-report.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ function normalizeJunitReport(xmlContent: string): string {
1212
// Replace execution times with fixed value
1313
.replace(/time="[^"]*"/g, 'time="0.100"')
1414
// Replace file paths with normalized path
15-
.replace(/file="[^"]*\/[^"]*"/g, 'file="/mock/path/to/file.bru"')
15+
.replace(/file="[^"]*[\\/][^"]*"/g, 'file="/mock/path/to/file.bru"')
1616
// Replace test paths with normalized path
17-
.replace(/classname="[^"]*\/[^"]*"/g, 'classname="/test/path/collection"');
17+
.replace(/classname="[^"]*[\\/][^"]*"/g, 'classname="/test/path/collection"');
1818
}
1919

2020
test.describe('Collection Run Report Tests', () => {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0"?>
2+
<testsuites>
3+
<testsuite name="Get User Info" file="/mock/path/to/file.bru" errors="0" failures="0" skipped="0" tests="4" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
4+
<testcase name="Status code is 200" status="pass" classname="/test/path/collection" time="0.100"/>
5+
<testcase name="Response is an object" status="pass" classname="/test/path/collection" time="0.100"/>
6+
<testcase name="Response has slideshow property" status="pass" classname="/test/path/collection" time="0.100"/>
7+
<testcase name="Slideshow has title" status="pass" classname="/test/path/collection" time="0.100"/>
8+
</testsuite>
9+
<testsuite name="Get UUID" file="/mock/path/to/file.bru" errors="0" failures="1" skipped="0" tests="5" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
10+
<testcase name="This test will fail" status="fail" classname="/test/path/collection" time="0.100">
11+
<failure type="failure" message="expected 200 to equal 404"/>
12+
</testcase>
13+
<testcase name="Status code is 200" status="pass" classname="/test/path/collection" time="0.100"/>
14+
<testcase name="Response is an object" status="pass" classname="/test/path/collection" time="0.100"/>
15+
<testcase name="Response has uuid property" status="pass" classname="/test/path/collection" time="0.100"/>
16+
<testcase name="UUID is a string" status="pass" classname="/test/path/collection" time="0.100"/>
17+
</testsuite>
18+
<testsuite name="Login Request" file="/mock/path/to/file.bru" errors="0" failures="0" skipped="0" tests="3" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
19+
<testcase name="Status code is 200" status="pass" classname="/test/path/collection" time="0.100"/>
20+
<testcase name="Response has json field" status="pass" classname="/test/path/collection" time="0.100"/>
21+
<testcase name="Response json has username" status="pass" classname="/test/path/collection" time="0.100"/>
22+
</testsuite>
23+
<testsuite name="Logout Request" file="/mock/path/to/file.bru" errors="0" failures="1" skipped="0" tests="2" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
24+
<testcase name="This test will also fail" status="fail" classname="/test/path/collection" time="0.100">
25+
<failure type="failure" message="expected 200 to equal 500"/>
26+
</testcase>
27+
<testcase name="Status code is 200" status="pass" classname="/test/path/collection" time="0.100"/>
28+
</testsuite>
29+
</testsuites>

0 commit comments

Comments
 (0)