When uses cy.screenshot doesn't attach in mochawesome report #29825
Labels
pkg/reporter
This is due to an issue in the packages/reporter directory
type: enhancement
Requested enhancement of existing feature
Current behavior
Hello,
we are using mochaawesome report.
In reality, we use the multireporter to generate JSON and XML files, which in turn perform the task of reporting XML results to AIO Test management in Jira and we merge the JSON format so that an HTML is generated, since it is not possible to generate an HTML with all the tests, since the tests are overwritten, so if we used HTML for the report directly, only one test would be shown. So we generate a JSON report for each test and then merge it into HTML. In this HTML, we always show screenshots of the testing process. I found a way to attach the tests if the test fails and works correctly, however, I have not found a way to override cy.screenshot to indicate the path to context (mochaawesome) and have it attached correctly in the HTML report.
2.I have noticed that if we use ":" (colon) in the test it and the test fails, the screenshot is not attached correctly.
We provide a test project so that it can be check and tested.
Thank you in advance.
Best regards.
Desired behavior
Cypress should attach correctly the screenshot in the report.
Test code to reproduce
framework-with-bug-screenshots.zip
Attach a framework with the problem.
Cypress Version
13.12.0
Node version
20.14.0
Operating System
windows 10
Debug Logs
No have logs because doesn't return any error.
Other
If you check the screenshot route (example):
http://127.0.0.1:5501/1_busqueda_guia_medica.cy.js/0_login.png,/1_busqueda_guia_medica.cy.js/screenshots.png,/1_busqueda_guia_medica.cy.js/1_acceso_guia_medica.png,/1_busqueda_guia_medica.cy.js/cypress/resultados/screenshots.png,/1_busqueda_guia_medica.cy.js/2_busqueda_producto.png,/1_busqueda_guia_medica.cy.js/3_medicos_y_centros.png,/1_busqueda_guia_medica.cy.js/4_1_busqueda_medico_o_centro.png,/1_busqueda_guia_medica.cy.js/4_2_busqueda_correcta.png
But the screenshot is located in: C:\Users\lhidalgom\Documents\workspace\infra\mediadores-multireporter\cypress\resultados\screenshots\1_busqueda_guia_medica.cy.js\4_2_busqueda_correcta.png
The text was updated successfully, but these errors were encountered: