Bird
0
0

You want to generate a single combined HTML report after running multiple Cypress test runs with mochawesome. Which approach is correct?

hard📝 framework Q15 of 15
Cypress - CI/CD and Reporting
You want to generate a single combined HTML report after running multiple Cypress test runs with mochawesome. Which approach is correct?
AUse mochawesome-merge to combine JSON reports, then generate HTML from merged JSON
BRun tests with overwrite: true and html: true to auto-merge reports
CSet reporter to 'mochawesome-merge' in cypress.config.js to merge reports automatically
DRun tests multiple times with html: false and manually copy JSON files into one
Step-by-Step Solution
Solution:
  1. Step 1: Understand mochawesome report generation

    Mochawesome generates separate JSON reports per test run; it does not merge automatically.
  2. Step 2: Use mochawesome-merge tool

    mochawesome-merge combines multiple JSON reports into one, which can then be converted to a single HTML report.
  3. Step 3: Confirm other options are incorrect

    overwrite: true overwrites reports, no auto-merge; 'mochawesome-merge' is not a reporter; manual copying is error-prone.
  4. Final Answer:

    Use mochawesome-merge to combine JSON reports, then generate HTML from merged JSON -> Option A
  5. Quick Check:

    Merge JSON then generate HTML = combined report [OK]
Quick Trick: Merge JSON reports first, then create one HTML report [OK]
Common Mistakes:
  • Expecting mochawesome to auto-merge reports
  • Setting reporter to 'mochawesome-merge' which is not valid
  • Manually copying JSON files without merging

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes