mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-30 16:14:06 +00:00
Add file attribute to Junit testsuite report (#6425)
* feat: add file attribute to Junit testsuite report * test: update tests to include file attribute * fix: update playwright tests to support the new file attribute --------- Co-authored-by: Thomas Vackier <thomas.vackier@inthepocket.com> Co-authored-by: Bijin A B <bijin@usebruno.com>
This commit is contained in:
@@ -12,6 +12,8 @@ function normalizeJunitReport(xmlContent: string): string {
|
||||
// Replace execution times with fixed value
|
||||
.replace(/time="[^"]*"/g, 'time="0.100"')
|
||||
// Replace file paths with normalized path
|
||||
.replace(/file="[^"]*\/[^"]*"/g, 'file="/mock/path/to/file.bru"')
|
||||
// Replace test paths with normalized path
|
||||
.replace(/classname="[^"]*\/[^"]*"/g, 'classname="/test/path/collection"');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<testsuites>
|
||||
<testsuite name="Get User Info" errors="0" failures="0" skipped="0" tests="4" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
|
||||
<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">
|
||||
<testcase name="Status code is 200" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Response is an object" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Response has slideshow property" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Slideshow has title" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
</testsuite>
|
||||
<testsuite name="Get UUID" errors="0" failures="1" skipped="0" tests="5" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
|
||||
<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">
|
||||
<testcase name="This test will fail" status="fail" classname="/test/path/collection" time="0.100">
|
||||
<failure type="failure" message="expected 200 to equal 404"/>
|
||||
</testcase>
|
||||
@@ -15,12 +15,12 @@
|
||||
<testcase name="Response has uuid property" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="UUID is a string" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
</testsuite>
|
||||
<testsuite name="Login Request" errors="0" failures="0" skipped="0" tests="3" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
|
||||
<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">
|
||||
<testcase name="Status code is 200" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Response has json field" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Response json has username" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
</testsuite>
|
||||
<testsuite name="Logout Request" errors="0" failures="1" skipped="0" tests="2" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
|
||||
<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">
|
||||
<testcase name="This test will also fail" status="fail" classname="/test/path/collection" time="0.100">
|
||||
<failure type="failure" message="expected 200 to equal 500"/>
|
||||
</testcase>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<testsuites>
|
||||
<testsuite name="Get User Info" errors="0" failures="0" skipped="0" tests="4" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
|
||||
<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">
|
||||
<testcase name="Status code is 200" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Response is an object" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Response has slideshow property" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Slideshow has title" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
</testsuite>
|
||||
<testsuite name="Get UUID" errors="0" failures="1" skipped="0" tests="5" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
|
||||
<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">
|
||||
<testcase name="This test will fail" status="fail" classname="/test/path/collection" time="0.100">
|
||||
<failure type="failure" message="expected 200 to equal 404"/>
|
||||
</testcase>
|
||||
@@ -15,12 +15,12 @@
|
||||
<testcase name="Response has uuid property" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="UUID is a string" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
</testsuite>
|
||||
<testsuite name="Login Request" errors="0" failures="0" skipped="0" tests="3" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
|
||||
<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">
|
||||
<testcase name="Status code is 200" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Response has json field" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
<testcase name="Response json has username" status="pass" classname="/test/path/collection" time="0.100"/>
|
||||
</testsuite>
|
||||
<testsuite name="Logout Request" errors="0" failures="1" skipped="0" tests="2" timestamp="2024-01-01T00:00:00.000" hostname="test-host" time="0.100">
|
||||
<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">
|
||||
<testcase name="This test will also fail" status="fail" classname="/test/path/collection" time="0.100">
|
||||
<failure type="failure" message="expected 200 to equal 500"/>
|
||||
</testcase>
|
||||
|
||||
Reference in New Issue
Block a user