Skip to content

[BUG] Incorrect serialization failure message in Junit reporterΒ #12944

@Gornostalev

Description

@Gornostalev

Context:

  • Playwright Version: [1.20.0]
  • Operating System: [Windows 10]
  • Node.js version: [v14.17.5]
  • Browser: [All]

Code Snippet

Hello everyone πŸŽ­βœ‹πŸ»! I found incorrect junit reporter serialization work;
when the test fails I expect the "failure message" field in the xml file to contain the error text, but it contains the test header:

<failure message="example.spec.ts:5:3 Check equal" type="FAILURE">

test code:

test.describe('Example', () => {

  test('Check equal', async () => {
    throw new Error('Error message');
  });
});

how it looks in json reporter:

"error": {
  "message": "Error message",
  "stack": "Error: Error message\n    at C:\\Users\\username\\Desktop\\issue\\new-project\\tests\\example.spec.ts:6:11"
},

I prepared a repository with npm scripts:

npm run testJson - for run with json reporter
npm run testJunit - for run with junit reporter

I hope this makes your job easier, thanks for Playwright!❀

Metadata

Metadata

Assignees

Labels

feature-test-runnerPlaywright test specific issuesopen-to-a-pull-requestThe feature request looks good, we are open to reviewing a PR

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions