Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
No se pueden combinar los informes mochaweasome

Tengo la siguiente configuración en mi corredor de prueba y trato de fusionar todo el archivo mochaweasome.html como un solo archivo mocha.

Corredor.js

 async function testRunner(fixture) { return cypress.run({ config: { "reporter": "mochawesome", "reporterOptions": { "reportFilename": "sample" + `${fixture}`, "reportDir":"./cypress/reports/", "charts": true, "overwrite": false, "html": true, "json": true } }, env: { testcaseID: `${fixture}`, }, spec: './cypress/integration/' + `${param.getSpec()}` + ".spec.js", }); }

TestRunner.js:

 const testRunner = require("./Runner.js"); const options = { files: [ './cypress/reports/*.html', ], } async function generateReport(options) { return merge(options).then(report => marge.create(report, options)) } async function runner(dataSet) { for (let i = 0; i < dataSet.length; i += 1) { await setTimeout[Object.getOwnPropertySymbols(setTimeout)[0]](10000); try { await testRunner(dataSet[i]).then((result) => { console.log(JSON.stringify(result, null, " ")); generateReport(options); if (result.runs[0].stats.failures === 1) { retry.push(result.config.env.testcaseID); } }, error => { generateReport(options); console.error(error); process.exit(1); }); } catch (err) { process.exit(1); } } }

El informe de prueba se crea como se muestra a continuación:

ingrese la descripción de la imagen aquí

Pero no se fusiona como un solo informe según el código.

¿Puede alguien ayudarme a arreglar esto? Solo quiero un solo informe mochaweasome_final que contenga todos los resultados en un solo archivo .html.

Actualizado:

Usé cypress-mochawesome-reporter y seguí todos los pasos. Pero aún así el informe no se fusiona. ¿Cómo puedo fusionar todos los 5 archivos html en uno solo?

Producción:

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Primero, debe instalar mocha reporter usando npm i cypress-mochawesome-reporter .

y luego tienes que poner esta importación en support/index.js

 import 'cypress-mochawesome-reporter/register';

E importe esta línea en plugin/index.js

 module.exports = (on, config) => { require('cypress-mochawesome-reporter/plugin')(on); };

Y luego en su archivo cypress.json

 "reporter": "cypress-mochawesome-reporter", "reporterOptions": { "reportDir": "cypress/reports", "charts": true, "overwrite": false, "html": false, "json": true, "reportPageTitle": "My Test Suite", "embeddedScreenshots": true, "inlineAssets": true

Referencia: https://www.npmjs.com/package/cypress-mochawesome-reporter

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!