Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xray-report.xml file not being created #15

Open
monathakur opened this issue Nov 25, 2024 · 7 comments
Open

xray-report.xml file not being created #15

monathakur opened this issue Nov 25, 2024 · 7 comments

Comments

@monathakur
Copy link

Hi,
I am facing this intermittent issue where the xray-report.xml doesn't get generated at all. I am attaching a sample snippet of Jenkins logs below along with project settings that I have:

const xrayOptions = {
// Whether to add with all annotations; default is false
embedAnnotationsAsProperties: true,
// By default, annotation is reported as .
// These annotations are reported as value.
textContentAnnotations: ['test_description'],
// This will create a "testrun_evidence" property that contains all attachments. Each attachment is added as an inner element.
// Disables [[ATTACHMENT|path]] in the .
embedAttachmentsAsProperty:'testrun_evidence',
// Where to put the report.
outputFile: './xray-report.xml'
};

in defaultConfig of playwright:
reporter: [['@xray-app/playwright-junit-reporter', xrayOptions]],

Also, evidence of @xray-app/playwright-junit-reporter crashing.
11:31:27 Error in reporter RangeError: Invalid string length
11:31:27 at Array.join ()
11:31:27 at XrayJUnitReporter.onEnd (/home/jenkins/agent/workspace/test/playwright_test/playwright/dashboard/node_modules/@xray-app/playwright-junit-reporter/dist/index.js:83:37)
11:31:27 at ReporterV2Wrapper.onEnd (/home/jenkins/agent/workspace/test/playwright_test/playwright/dashboard/node_modules/@playwright/test/lib/reporters/reporterV2.js:91:158)
11:31:27 at /home/jenkins/agent/workspace/test/playwright_test/playwright/dashboard/node_modules/@playwright/test/lib/reporters/multiplexer.js:50:76
11:31:27 at wrapAsync (/home/jenkins/agent/workspace/test/playwright_test/playwright/dashboard/node_modules/@playwright/test/lib/reporters/multiplexer.js:75:11)
11:31:27 at Multiplexer.onEnd

@Iv3x
Copy link
Contributor

Iv3x commented Nov 25, 2024

Hi,

i actually checked our project configuration and the only thing we have not enabled is: embedAttachmentsAsProperty:'testrun_evidence',

Could you provide some more information about the playwright version and reporter version you actually use ?

@monathakur
Copy link
Author

Playwright version : Version 1.49.0
"@xray-app/playwright-junit-reporter": "^0.1.2"

@bitcoder
Copy link
Contributor

bitcoder commented Dec 5, 2024

Can you please upgrade to latest version and see if the problem persists @monathakur ?

@monathakur
Copy link
Author

Updated junit-reporter version to latest, still facing this issue intermittently

@bitcoder
Copy link
Contributor

Which nodejs version are you using @monathakur ? this seems (perhaps) to be a issue related with dealing with large strings

@bitcoder
Copy link
Contributor

can you also try commenting the embedAttachmentsAsProperty setting, so attachments are not added into the junit report? Perhaps you have many/big attachments that are leading to this behaviour

@monathakur
Copy link
Author

Hi,
The node version is v18.16.1 and the attachment property is:
const xrayOptions = {
// Whether to add with all annotations; default is false
embedAnnotationsAsProperties: true,
// By default, annotation is reported as .
// These annotations are reported as value.
textContentAnnotations: ['test_description'],
// This will create a "testrun_evidence" property that contains all attachments. Each attachment is added as an inner element.
// Disables [[ATTACHMENT|path]] in the .
embedAttachmentsAsProperty:'testrun_evidence',
// Where to put the report.
outputFile: './xray-report.xml'
};

After the xray-report.xml file is generated by playwright, I am creating another file with the same name and replace it so that the updated xray-report.xml doesn't have videos as evidence, only screenshots.

And yes, I am getting this error when I get large number of errors in my test run meaning that this error is happening somewhere during creation of original xray-report.xml file itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants