microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
65.68k stars 3.58k forks source link

[Feature] - Include project name with the testcase title in Junit XML report #23432

Open bhavarthkandoria opened 1 year ago

bhavarthkandoria commented 1 year ago

Currently, Junit XML report includes value of project name as hostname property in testsuite tag. But I need a feature where project name can be included in the name property of a testcase tag like below

<testcase name="Verify login > Mobile Android" classname="tests\login.spec.ts" time="9.013">

Here, consider Verify login is a test title and Mobile Android is a project name.

Want to achieve the above thing just because wanted to create unique testcase in zephyr for each project name from the generated Junit XML report. There is one 'name' property which is used to create the testcase in zephyr.

So I want to add the project name in existing testcase title.

I am not able to update the testcase name dynamically with the project name, otherwise I would have done that.

dst87 commented 11 months ago

I wanted to ++ this request. We're uploading JUnit results to DataDog and at the moment tests on multiple browsers (setup using projects - chromium, firefox, webkit etc.) cannot be disambiguated in DataDog.

The result is that the DataDog report for the file has the wrong number of tests in the summary. Though individual tests are listed multiple times, the summary seems to be combining tests with the same name.

EvgenyWas commented 11 months ago

This is also relevant for me in GitLab CI. I described my problem and a temporary solution here #27665.