Open jessehouwing opened 6 years ago
any updates on this?
Please add support for this if it's not already there...This would be very useful.
Some related work here: https://github.com/cypress-io/cypress/issues/2433
Any updates here? As far as I know cypres uses the Mocha-Junit-Reporter, which should support attachment files already. Anybody got that working with cypress and CI/CD?
I came across this error today, on a totally unrelated issue, see my CI build here
$(npm bin)/cypress run --spec cypress/integration/sample1.spec.js --reporter-options "reportFilename=test1"
For whatever reason, it was trying to use the xunit reporter, despite the fact that my reporterOptions are set to use cypress-multi-reporters, mochawesome and mocha-junit-reporters.
If i comment out the following function at node_modules/mocha/lib/reporters/xunit.js
I get a xunit xml file at the root of my project called xunit.xml
<testsuite name="Mocha Tests" tests="1" failures="0" errors="0" skipped="0" timestamp="Tue, 04 Jun 2019 23:30:02 GMT" time="2.259">
<testcase classname="Cypress parallel run example - 1" name="should display the title" time="0.645"/>
</testsuite>
This is the equivalent junit report
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Mocha Tests" time="0.527" tests="1" failures="0">
<testsuite name="Root Suite" timestamp="2019-06-04T23:39:48" tests="0" failures="0" time="0">
</testsuite>
<testsuite name="Cypress parallel run example - 1" timestamp="2019-06-04T23:39:48" tests="1" failures="0" time="0.527">
<testcase name="Cypress parallel run example - 1 should display the title" time="0.527" classname="should display the title">
</testcase>
</testsuite>
</testsuites>
I'm not entirely sure why an xunit file is being emitted! as it isn't specified in any of my setup!
Here is my cypress.json
{
"reporter": "cypress-multi-reporters",
"reporterOptions": {
"configFile": "reporterOpts.json"
}
}
and reporterOpts.json
{
"reporterEnabled": "mocha-junit-reporters, mochawesome",
"mochaJunitReportersReporterOptions": {
"mochaFile": "cypress/reports/junit/test_results[hash].xml",
"toConsole": false
},
"mochawesomeReporterOptions": {
"reportDir": "cypress/reports/mocha",
"quiet": true,
"overwrite": false,
"html": false,
"json": true
}
}
It may or may not be relevant to this issue, just thought I would help add some additional info!
Still nothing @SebastianSchoeberl
I saw that they support Selenium, publishing images and test results, but for now I'm only testing e2e and failing the build if they don't pass, not recording anything in portal.
Thanks for your update @marceloavf , well I suppose we have to hold on a little more. But would be great if they made it possible!
Hi ,
Do we have any other option available in cypress to attach screenshots and videos to azure test results other than directly using DevOps API?
Any update on this one?
You surely have given up on this one
I was really hoping this was going to be fixed in the latest 4.2 upgrade
Current behavior:
I've installed Cypress into a project built on VSTS. To get cypress to run on the Linux Hosted agents I had to perform the following additional steps:
To get reporting to work (to get status information in the VSTS release dashboard) I configured the
junit
reporter:This works up to a certain point. Cypress runs, a junit report is generated, but all of the recorded videos are ignored after the run is completed.
VSTS supports uploading test attachments when they are referenced in the test report. I tried configuring the
xunit-file
reporter, but no attachment is added. I tried configuring themocha-trx-reporter
(native visual studio format), but it crashes when running with cypress.Desired behavior:
Cypress logs the recorded video as test attachment in the generated test results so that Visual Studio Team Services can associate them to the test results and show them in the portal.
Steps to reproduce:
Versions