xray-app / playwright-junit-reporter Goto Github PK
View Code? Open in Web Editor NEWPlaywright JUnit Enhanced XML reporter
License: Apache License 2.0
Playwright JUnit Enhanced XML reporter
License: Apache License 2.0
Hello! In advance, thanks for opening this project!
I followed the instructions, passed the options in my config file, but when executing the tests, it runs immediately into:
Require stack:
- C:\playwright\node_modules\@xray-app\playwright-junit-reporter\dist\base.js
- C:\playwright\node_modules\@xray-app\playwright-junit-reporter\dist\index.js
- C:\playwright\node_modules\@playwright\test\lib\common\transform.js
- C:\playwright\node_modules\@playwright\test\lib\common\testType.js
- C:\playwright\node_modules\@playwright\test\lib\common\test.js
- C:\playwright\node_modules\@playwright\test\lib\reporters\multiplexer.js
- C:\playwright\node_modules\@playwright\test\lib\runner\reporters.js
- C:\playwright\node_modules\@playwright\test\lib\runner\runner.js
- C:\playwright\node_modules\@playwright\test\lib\cli.js
- C:\playwright\node_modules\playwright-core\lib\cli\cli.js
- C:\playwright\node_modules\playwright-core\cli.js
- C:\playwright\node_modules\@playwright\test\cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1021:15)
at Function.resolveFilename (C:\playwright\node_modules\@playwright\test\lib\common\transform.js:173:36)
at Function.Module._load (node:internal/modules/cjs/loader:866:27)
at Module.require (node:internal/modules/cjs/loader:1093:19)
at require (node:internal/modules/cjs/helpers:108:18)
at Object.<anonymous> (C:\playwright\node_modules\@xray-app\playwright-junit-reporter\dist\base.js:26:22)
at Module._compile (node:internal/modules/cjs/loader:1191:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
at Object.i.<computed>.ot._extensions.<computed> (C:\playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:1010)
at Module.load (node:internal/modules/cjs/loader:1069:32)
at Function.Module._load (node:internal/modules/cjs/loader:904:12)
at Module.require (node:internal/modules/cjs/loader:1093:19)
at require (node:internal/modules/cjs/helpers:108:18)
at Object.<anonymous> (C:\playwright\node_modules\@xray-app\playwright-junit-reporter\dist\index.js:24:16)
at Module._compile (node:internal/modules/cjs/loader:1191:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
at Object.i.<computed>.ot._extensions.<computed> (C:\playwright\node_modules\@playwright\test\lib\utilsBundleImpl.js:16:1010)
at Module.load (node:internal/modules/cjs/loader:1069:32)
at Function.Module._load (node:internal/modules/cjs/loader:904:12)
at Module.require (node:internal/modules/cjs/loader:1093:19)
at require (node:internal/modules/cjs/helpers:108:18)
at requireOrImport (C:\playwright\node_modules\@playwright\test\lib\common\transform.js:154:20)
at requireOrImportDefaultFunction (C:\playwright\node_modules\@playwright\test\lib\runner\loadUtils.js:243:51)
at loadReporter (C:\playwright\node_modules\@playwright\test\lib\runner\loadUtils.js:252:10)
at createReporter (C:\playwright\node_modules\@playwright\test\lib\runner\reporters.js:63:71)
at Runner.runAllTests (C:\playwright\node_modules\@playwright\test\lib\runner\runner.js:64:58)
at runTests (C:\playwright\node_modules\@playwright\test\lib\cli.js:135:151)
at ji.<anonymous> (C:\playwright\node_modules\@playwright\test\lib\cli.js:48:7) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\playwright\\node_modules\\@xray-app\\playwright-junit-reporter\\dist\\base.js',
'C:\\playwright\\node_modules\\@xray-app\\playwright-junit-reporter\\dist\\index.js',
'C:\\playwright\\node_modules\\@playwright\\test\\lib\\common\\transform.js',
'C:\\playwright\\node_modules\\@playwright\\test\\lib\\common\\testType.js',
'C:\\playwright\\node_modules\\@playwright\\test\\lib\\common\\test.js',
'C:\\playwright\\node_modules\\@playwright\\test\\lib\\reporters\\multiplexer.js',
'C:\\playwright\\node_modules\\@playwright\\test\\lib\\runner\\reporters.js',
'C:\\playwright\\node_modules\\@playwright\\test\\lib\\runner\\runner.js',
'C:\\playwright\\node_modules\\@playwright\\test\\lib\\cli.js',
'C:\\playwright\\node_modules\\playwright-core\\lib\\cli\\cli.js',
'C:\\playwright\\node_modules\\playwright-core\\cli.js',
'C:\\playwright\\node_modules\\@playwright\\test\\cli.js'
]
}```
Hello!
I know, this proejct is in its early phase, but it would be nice if you will have a look on the following issue:
When using a beforeEach like this:
test.describe("foo", () => {
test.beforeEach(async ({ page }) => {
await test.step("Do this first", async () => {
//I let test already fail here...
});
});
test("And then do this", async ({
page,
}, testInfo) => {
testInfo.annotations.push({ type: "test_key", description: "Ticket-xxx" });
// ... so that this part will not be executed.
});
Then no test_key property will be provided in the report.
My current workaround is as follows:
test.describe("foo", () => {
test.beforeEach(async ({ page }, testInfo) => {
testInfo.annotations.push({
type: "test_key",
description: "TICKET-PLACEHOLDER",
});
await test.step("Do this first", async () => {
//I let test already fail here...
});
});
and then use a script to edit the report retroactively, so:
...
<properties>
<property name="test_key" value="Ticket-xxx">
</property>
<property name="test_key" value="Ticket-xxx">
</property>
<property name="testrun_evidence">
</property>
</properties>
...
Not nice, but sufficient.
Maybe there is a programmatic solution that could be provided by you?
When using beforeAll like this with more than one worker:
test.beforeAll(async ({ page }, testInfo) => {
testInfo.annotations.push({ type: "test_key", description: "Ticket-foo" });
...
});
test("An amazing test", async ({
page,
}, testInfo) => {
testInfo.annotations.push({ type: "test_key", description: "Ticket-bar" });
...
});
the report will look like this:
...
<properties>
<property name="test_key" value="Ticket-foo">
</property>
<property name="test_key" value="Ticket-bar">
</properties>
...
what will lead to inconsistencies in xray when importing the results. My only solution is: Just use 1 worker :-D
Is there a programmatic solution provided by you possible?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.