<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ganesh</title>
    <description>The latest articles on DEV Community by Ganesh (@ganeshsirsi).</description>
    <link>https://dev.to/ganeshsirsi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F651135%2F3cc7b5c8-0fee-4d71-b14d-2caa23d35c07.jpg</url>
      <title>DEV Community: Ganesh</title>
      <link>https://dev.to/ganeshsirsi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ganeshsirsi"/>
    <language>en</language>
    <item>
      <title>Cypress How to Configure HTML Reports with Screenshot Step by Step</title>
      <dc:creator>Ganesh</dc:creator>
      <pubDate>Fri, 18 Jun 2021 04:50:33 +0000</pubDate>
      <link>https://dev.to/ganeshsirsi/cypress-how-to-configure-html-reports-with-screenshot-step-by-step-4ao8</link>
      <guid>https://dev.to/ganeshsirsi/cypress-how-to-configure-html-reports-with-screenshot-step-by-step-4ao8</guid>
      <description>&lt;p&gt;You might have written thousands of test cases but what makes you proud of it is, when you visualize the test results to stakeholders in an understandable way. There is a lot of articles over the internet to Integrate HTML reports into Cypress but when it comes to screenshot integration it's very difficult and time-consuming. The complexity is more.&lt;br&gt;
In this article, I am presenting you Step by Step guide to integrate HTML results into your Cypress Automation Framework with Screenshots in an easy way.&lt;br&gt;
This article explains Integrating HTML Results or reports with embedded Screenshot using cypress mochawesome reporter&lt;/p&gt;

&lt;p&gt;This plugin is built on top of the mocha awesome report just to make life easy, so some of the options available in the mocha awesome reports are available here too.&lt;/p&gt;

&lt;p&gt;Let's start&lt;br&gt;
&lt;strong&gt;Assumptions&lt;/strong&gt;:&lt;br&gt;
You already have set up a cypress framework with a few test cases running.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step by Step Guide to Integrate HTML Results with Screenshot into your Cypress Automation Framework using cypress mochawesome reporter
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Step 1: Install cypress-mochawesome-reporter
&lt;/h4&gt;

&lt;p&gt;In &lt;em&gt;Visual Studio Code&lt;/em&gt;, Navigate to &lt;em&gt;Terminal&lt;/em&gt; (Ensure present working directory is your Project root level directory) type below command.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

npm i --save-dev cypress-mochawesome-reporter


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  Step 2: Add an entry to your cypress.json file.
&lt;/h4&gt;

&lt;p&gt;Open, &lt;code&gt;cypress.json&lt;/code&gt; file which is located in your project root directory, add the below entries.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

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


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sample Image of Report configuration in &lt;code&gt;cypress.json&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonwyisaznejvx4ynhktd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonwyisaznejvx4ynhktd.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 3: Add an entry in plugin/index.js
&lt;/h4&gt;

&lt;p&gt;From your &lt;em&gt;Project Root Folder&lt;/em&gt;, Navigate to &lt;code&gt;cypress&lt;/code&gt; folder &amp;gt; &lt;code&gt;plugin&lt;/code&gt; folder&amp;gt; &lt;code&gt;index.js&lt;/code&gt; file&lt;br&gt;
or &lt;br&gt;
Simply, Open the&lt;code&gt;index.js&lt;/code&gt; file located inside the &lt;code&gt;plugin&lt;/code&gt; folder. add the below code.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

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


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example Screenshot&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte3pltgm7iyh7kp6rycr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte3pltgm7iyh7kp6rycr.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 4: Add an entry in the support/index.js
&lt;/h4&gt;

&lt;p&gt;From the &lt;em&gt;Project root folder&lt;/em&gt; &amp;gt; Navigate to &lt;code&gt;cypress&lt;/code&gt; folder &amp;gt; &lt;code&gt;support&lt;/code&gt; folder&amp;gt; &lt;code&gt;index.js&lt;/code&gt; file&lt;br&gt;
Add below entry&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import 'cypress-mochawesome-reporter/register';


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example Screenshot&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrcg4b33p79lt6bbkbbd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrcg4b33p79lt6bbkbbd.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That's all you are done with Set up!!!&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 5: Execute your test in the command line
&lt;/h4&gt;

&lt;p&gt;You can use below command to execute your tests in command line&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

npx cypress run


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Alternatively, you can also run using your package.json config, if you have configured it already.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 6: View the result file
&lt;/h4&gt;

&lt;p&gt;The result file is located in the &lt;code&gt;reportDir&lt;/code&gt; option value which we mentioned in &lt;strong&gt;Step 2&lt;/strong&gt;. In our example, we have mentioned &lt;code&gt;cypress/reports&lt;/code&gt;. &lt;br&gt;
So, From your &lt;em&gt;Project Root Directory&lt;/em&gt; &amp;gt; Navigate to &lt;code&gt;cypress&lt;/code&gt; folder &amp;gt; &lt;code&gt;reports&lt;/code&gt; folder &amp;gt; &lt;code&gt;index.html&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;index.html&lt;/code&gt; is your &lt;strong&gt;result&lt;/strong&gt; file, just open in chrome or any browser&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Index.html file looks like below.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8uzhafpz73ttshp5ey6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8uzhafpz73ttshp5ey6.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7: Look for the attached embedded screenshot
&lt;/h3&gt;

&lt;p&gt;The screenshot will be captured for all failed tests, so in order to view the screenshot Just &lt;strong&gt;click on Failed Test&lt;/strong&gt;. The screenshot will appear.&lt;br&gt;
Example Screenshot of Failed Test and embedded screenshot&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss2zi4hizz1znvws6kja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss2zi4hizz1znvws6kja.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Frequently Asked Questions:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. Can I disable the Screenshot?&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Yes, You can disable screenshots, In the cypress.json file change the below code.&lt;/em&gt;&lt;br&gt;
&lt;code&gt;"embeddedScreenshots": false,&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;2. How can change the default screenshot folder?&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;You can change the default screenshot folder using the below command&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"screenshotsFolder": "images"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, &lt;code&gt;images&lt;/code&gt; is the folder name you can change it to any valid path like &lt;code&gt;cypress/images&lt;/code&gt;, etc.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi3r6d9jmwy28pms056j1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi3r6d9jmwy28pms056j1.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Can I use this plugin with cypress-multi-reporters to configure both Junit and HTML results?&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Yes, you can use this plugin to configure multiple reporters.&lt;/em&gt;&lt;br&gt;
If you want to configure multiple reports you should use the below code in cypress.json the folder&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

"reporter": "cypress-multi-reporters",
  "reporterOptions": {
    "reporterEnabled": "cypress-mochawesome-reporter, mocha-junit-reporter",
    "mochaJunitReporterReporterOptions": {
      "mochaFile": "cypress/reports/junit/results-[hash].xml"
    },
    "cypressMochawesomeReporterReporterOptions": {
      "charts": true,
      "reportPageTitle": "custom-title"
    }
  },
  "video": false


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;4. How to enable inline CSS and styles in mocha awesome HTML reports?&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;To enable inline styles and a single HTML file (without any assets files) you need to turn on the option&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`"inlineAssets": true`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Hope you enjoyed this…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt;&lt;br&gt;
 npm: &lt;a href="https://www.npmjs.com/package/cypress-mochawesome-reporter" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/cypress-mochawesome-reporter&lt;/a&gt;&lt;br&gt;
 git: &lt;a href="https://github.com/LironEr/cypress-mochawesome-reporter#readme" rel="noopener noreferrer"&gt;https://github.com/LironEr/cypress-mochawesome-reporter#readme&lt;/a&gt;&lt;br&gt;
 &lt;em&gt;This article is written with the intention of helping the community&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://buymeacoffee.com/ganeshhegde" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futos422baf6mo835oms4.png" alt="https://buymeacoffee.com/ganeshhegde"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you need any help, support or guidance feel free to reach me on LinkedIn&lt;/em&gt;&lt;br&gt;
LinkedIn|&lt;a href="https://www.linkedin.com/in/ganeshsirsi/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/ganeshsirsi/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mocha</category>
      <category>cypress</category>
      <category>testing</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Cypress How to Configure HTML Reports with Screenshot Step by Step Guide</title>
      <dc:creator>Ganesh</dc:creator>
      <pubDate>Thu, 17 Jun 2021 13:09:05 +0000</pubDate>
      <link>https://dev.to/ganeshsirsi/cypress-how-to-configure-html-results-with-screenshot-step-by-step-guide-55n7</link>
      <guid>https://dev.to/ganeshsirsi/cypress-how-to-configure-html-results-with-screenshot-step-by-step-guide-55n7</guid>
      <description>&lt;p&gt;You might have written thousands of test cases but what makes you proud of it is, when you visualize the test results to stakeholders in an understandable way. There is a lot of articles over the internet to Integrate HTML reports into Cypress but when it comes to screenshot integration it's very difficult and time-consuming. The complexity is more.&lt;br&gt;
In this article, I am presenting you Step by Step guide to integrate HTML results into your Cypress Automation Framework with Screenshots in an easy way.&lt;br&gt;
This article explains Integrating HTML Results or reports with embedded Screenshot using cypress mochawesome reporter&lt;/p&gt;

&lt;p&gt;This plugin is built on top of the mocha awesome report just to make life easy, so some of the options available in the mocha awesome reports are available here too.&lt;/p&gt;

&lt;p&gt;Let's start&lt;br&gt;
&lt;strong&gt;Assumptions&lt;/strong&gt;:&lt;br&gt;
You already have set up a cypress framework with a few test cases running.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step by Step Guide to Integrate HTML Results with Screenshot into your Cypress Automation Framework using cypress mochawesome reporter
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Step 1: Install cypress-mochawesome-reporter
&lt;/h4&gt;

&lt;p&gt;In &lt;em&gt;Visual Studio Code&lt;/em&gt;, Navigate to &lt;em&gt;Terminal&lt;/em&gt; (Ensure present working directory is your Project root level directory) type below command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i --save-dev cypress-mochawesome-reporter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 2: Add an entry to your cypress.json file.
&lt;/h4&gt;

&lt;p&gt;Open, &lt;code&gt;cypress.json&lt;/code&gt; file which is located in your project root directory, add the below entries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"reporter": "cypress-mochawesome-reporter",
  "reporterOptions": {
    "reportDir": "cypress/reports",
    "charts": true,
    "reportPageTitle": "My Test Suite",
    "embeddedScreenshots": true,
    "inlineAssets": true
  },
  "video": false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sample Image of Report configuration in &lt;code&gt;cypress.json&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonwyisaznejvx4ynhktd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fonwyisaznejvx4ynhktd.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Step 3: Add an entry in plugin/index.js
&lt;/h4&gt;

&lt;p&gt;From your &lt;em&gt;Project Root Folder&lt;/em&gt;, Navigate to &lt;code&gt;cypress&lt;/code&gt; folder &amp;gt; &lt;code&gt;plugin&lt;/code&gt; folder&amp;gt; &lt;code&gt;index.js&lt;/code&gt; file&lt;br&gt;
or &lt;br&gt;
Simply, Open the&lt;code&gt;index.js&lt;/code&gt; file located inside the &lt;code&gt;plugin&lt;/code&gt; folder. add the below code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = (on, config) =&amp;gt; {
  require('cypress-mochawesome-reporter/plugin')(on);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example Screenshot&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte3pltgm7iyh7kp6rycr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte3pltgm7iyh7kp6rycr.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Step 4: Add an entry in the support/index.js
&lt;/h4&gt;

&lt;p&gt;From the &lt;em&gt;Project root folder&lt;/em&gt; &amp;gt; Navigate to &lt;code&gt;cypress&lt;/code&gt; folder &amp;gt; &lt;code&gt;support&lt;/code&gt; folder&amp;gt; &lt;code&gt;index.js&lt;/code&gt; file&lt;br&gt;
Add below entry&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'cypress-mochawesome-reporter/register';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example Screenshot&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrcg4b33p79lt6bbkbbd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrcg4b33p79lt6bbkbbd.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That's all you are done with Set up!!!&lt;/strong&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Step 5: Execute your test in the command line
&lt;/h4&gt;

&lt;p&gt;You can use below command to execute your tests in command line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx cypress run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Alternatively, you can also run using your package.json config, if you have configured it already.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 6: View the result file
&lt;/h4&gt;

&lt;p&gt;The result file is located in the &lt;code&gt;reportDir&lt;/code&gt; option value which we mentioned in &lt;strong&gt;Step 2&lt;/strong&gt;. In our example, we have mentioned &lt;code&gt;cypress/reports&lt;/code&gt;. &lt;br&gt;
So, From your &lt;em&gt;Project Root Directory&lt;/em&gt; &amp;gt; Navigate to &lt;code&gt;cypress&lt;/code&gt; folder &amp;gt; &lt;code&gt;reports&lt;/code&gt; folder &amp;gt; &lt;code&gt;index.html&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;index.html&lt;/code&gt; is your &lt;strong&gt;result&lt;/strong&gt; file, just open in chrome or any browser&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Index.html file looks like below.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8uzhafpz73ttshp5ey6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8uzhafpz73ttshp5ey6.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 7: Look for the attached embedded screenshot
&lt;/h3&gt;

&lt;p&gt;The screenshot will be captured for all failed tests, so in order to view the screenshot Just &lt;strong&gt;click on Failed Test&lt;/strong&gt;. The screenshot will appear.&lt;br&gt;
Example Screenshot of Failed Test and embedded screenshot&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss2zi4hizz1znvws6kja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fss2zi4hizz1znvws6kja.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Frequently Asked Questions:
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. Can I disable the Screenshot?&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Yes, You can disable screenshots, In the cypress.json file change the below code.&lt;/em&gt;&lt;br&gt;
&lt;code&gt;"embeddedScreenshots": false,&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;2. How can change the default screenshot folder?&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;You can change the default screenshot folder using the below command&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"screenshotsFolder": "images"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, &lt;code&gt;images&lt;/code&gt; is the folder name you can change it to any valid path like &lt;code&gt;cypress/images&lt;/code&gt;, etc.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi3r6d9jmwy28pms056j1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi3r6d9jmwy28pms056j1.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Can I use this plugin with cypress-multi-reporters to configure both Junit and HTML results?&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Yes, you can use this plugin to configure multiple reporters.&lt;/em&gt;&lt;br&gt;
If you want to configure multiple reports you should use the below code in cypress.json the folder&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"reporter": "cypress-multi-reporters",
  "reporterOptions": {
    "reporterEnabled": "cypress-mochawesome-reporter, mocha-junit-reporter",
    "mochaJunitReporterReporterOptions": {
      "mochaFile": "cypress/reports/junit/results-[hash].xml"
    },
    "cypressMochawesomeReporterReporterOptions": {
      "charts": true,
      "reportPageTitle": "custom-title"
    }
  },
  "video": false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. How to enable inline CSS and styles in mocha awesome HTML reports?&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;To enable inline styles and a single HTML file (without any assets files) you need to turn on the option&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`"inlineAssets": true`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Hope you enjoyed this…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt;&lt;br&gt;
 npm: &lt;a href="https://www.npmjs.com/package/cypress-mochawesome-reporter" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/cypress-mochawesome-reporter&lt;/a&gt;&lt;br&gt;
 git: &lt;a href="https://github.com/LironEr/cypress-mochawesome-reporter#readme" rel="noopener noreferrer"&gt;https://github.com/LironEr/cypress-mochawesome-reporter#readme&lt;/a&gt;&lt;br&gt;
 &lt;em&gt;This article is written with the intention of helping the community&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://buymeacoffee.com/ganeshhegde" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futos422baf6mo835oms4.png" alt="https://buymeacoffee.com/ganeshhegde"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you need any help, support or guidance feel free to reach me on LinkedIn&lt;/em&gt;&lt;br&gt;
LinkedIn|&lt;a href="https://www.linkedin.com/in/ganeshsirsi/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/ganeshsirsi/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cypress</category>
      <category>mocha</category>
      <category>beginners</category>
      <category>angular</category>
    </item>
  </channel>
</rss>
