MOCHAWESOME HTML Report in CYPRESS (EASY INTEGRATION)

Sdílet
Vložit
  • čas přidán 22. 08. 2024

Komentáře • 35

  • @joanmedia
    @joanmedia  Před 3 lety

    🤖DISCORD: discord.gg/2F9E2fRGaU
    ⭐PREMIUM Cypress + Typescript course: shorturl.at/dcnPn
    📣FREE Cypress videos: shorturl.at/h6iEX

  • @AndrewMatasov
    @AndrewMatasov Před 2 lety +1

    Amazing! You won't believe it, but everything still works.

  • @Concerned_Indianz
    @Concerned_Indianz Před 2 lety +1

    One more Wonderful video,,Thanks a lot.

    • @joanmedia
      @joanmedia  Před 2 lety

      Thanks to you for the comment :)

  •  Před 3 lety +1

    Freaking legend, my cypress master. Ty! 1

    • @joanmedia
      @joanmedia  Před 3 lety

      Did You like it? Thanks for your comment OSIFOY 😎

  • @premsudheer2092
    @premsudheer2092 Před 2 lety +1

    Damn.. you covered a lot dude.. .thanks a lot man..

  • @ptvsportslive8188
    @ptvsportslive8188 Před 2 lety +1

    Legende

  • @christinakokh2988
    @christinakokh2988 Před 2 lety +1

    Great! Very useful content Thanks!

  • @umeshmodi7219
    @umeshmodi7219 Před 2 lety +1

    Thank you . I have successfully integrated mochaawsome report to test. I have a question how to get second last run html. It's overriding previous report

    • @joanmedia
      @joanmedia  Před 2 lety

      Hi! Umesh, I would recommend to run it in Jenkins saving the report in each job execution, and if you are using local executions, create a bash/bat script to save the report after each one.

  • @svetlanakudrua4555
    @svetlanakudrua4555 Před 3 lety +1

    Hi! You do great job! I like your tutorials very much!!! Could you please make a video about the integration of cypress +axe plugin to perform accessibility testing with using of some reporters (saving report to files not to console only)?

    • @joanmedia
      @joanmedia  Před 3 lety +1

      Hi Svetlana! It is added to my list. Will try to research about it

    • @svetakudrya3461
      @svetakudrya3461 Před 3 lety +1

      @@joanmedia Thank you! looking forward!

  • @lindajuliethmontoyasanchez9259

    Excellent videos, thank you very much for sharing the knowledge, Joan, please do you have a video in which I implement cypress-mochawesome-reporter in cypress 10, I am trying to configure it following the video but it does not load the index.html

    • @joanmedia
      @joanmedia  Před 2 lety

      Hello Linda. Yes, the index has changed, now it should be configured in another file.
      In the meantime, what you can do is create the plugins folder, and the index file and link it in the cypress.config.js(github.com/JoanEsquivel/cypress-demo-framework/blob/main/cypress.config.ts) line 26.
      I'll try to create an updated video soon.

    • @jorgelopez4619
      @jorgelopez4619 Před 2 lety

      @@joanmedia Hola Joan, tengo el mismo problema que Linda, tengo un proyecto que hice de Cypres 10 + Cucumber guiado con sus videos pero cuando intento implementar MOCHAWESOME me genera el json pero no el index.html con el cual ver el reporte, adjunto la configuración del archivo cypress.config.js
      const { defineConfig } = require("cypress");
      const createBundler =
      require("@bahmutov/cypress-esbuild-preprocessor");
      const addCucumberPreprocessorPlugin =
      require("@badeball/cypress-cucumber-preprocessor").addCucumberPreprocessorPlugin;
      const createEsbuildPlugin =
      require("@badeball/cypress-cucumber-preprocessor/esbuild").createEsbuildPlugin;
      module.exports = defineConfig({
      reporter: 'cypress-mochawesome-reporter',
      reporterOptions: {
      charts: true,
      reportPageTitle: 'Google Demo Reports',
      embeddedScreenshots: true,
      inlineAssets: true,
      saveAllAttempts: false,
      reportDir: 'cypress/reports',
      overwrite: true
      },
      e2e: {
      async setupNodeEvents(on, config) {
      require('./cypress/plugins/index.js')(on, config)
      const bundler = createBundler({
      plugins: [createEsbuildPlugin(config)]
      });
      on("file:preprocessor", bundler);
      await addCucumberPreprocessorPlugin(on, config);
      return config;
      },
      specPattern: "cypress/e2e/feature/*.feature",
      baseUrl: "www.google,
      defaultCommandTimeout: 10000,
      pageLoadTimeout: 10000,
      chromeWebSecurity: false
      },
      });
      dentro de cypress/plugins/index.js tengo la siguiente configuracion:
      module.exports = (on, config) => {
      // optional: register cypress-grep plugin code
      // github.com/bahmutov/cypress-grep
      require("cypress-mochawesome-reporter/plugin")(on);
      };

  • @user-cw9nw5zt5o
    @user-cw9nw5zt5o Před 2 lety +1

    hi! thanks for video. I have a question: why tests starts running in headless mode? how i can to change it?

    • @joanmedia
      @joanmedia  Před 2 lety

      Thanks for your comment. You need to use the --headed tag. For example: cypress run --headed

  • @danielkovacs3664
    @danielkovacs3664 Před 2 lety +2

    hi
    good video series
    I have a bit question, what i do wrong, on the folder I only see a json file
    "screenshotOnRunFailure": true,
    "video": false,
    "reporter": "cypress-mochawesome-reporter",
    "reporterOptions": {
    "reportDir": "cypress/report",
    "charts": true,
    "reportPageTitle": "mocha"
    }
    }

    • @joanmedia
      @joanmedia  Před 2 lety +1

      Hi, thank you very much!
      Check your JSON file with mine: github.com/JoanEsquivel/cypress-demo-framework/blob/main/cypress.json
      Maybe there is something missing?

    • @danielkovacs3664
      @danielkovacs3664 Před 2 lety

      @@joanmedia it is the same, but just json file are generated into the report folder
      "reporter": "cypress-mochawesome-reporter",
      "reporterOptions": {
      "reportDir": "cypress/reports/mocha",
      "charts": true,
      "reportPageTitle": "demo",
      "timeStamp": "mmddyyyy_HHMMss",
      "embeddedScreenshoots": true
      },

    • @lovely-do8ns
      @lovely-do8ns Před 2 lety

      @@danielkovacs3664 hi bro did you found the solution facing the same issue only json file showing

  • @rajasekharcmr
    @rajasekharcmr Před 2 lety +1

    I am not able to run scripts using npm run cypress:runChrome command. Is there any specific setup we have to run in this way? when i am running from command prompt, browser is not opening but scripts are running. I am using this command "npx cypress run --spec cypress\integration\bussr-operator-cases\* --browser chrome" any suggestions would be great helpful

    • @joanmedia
      @joanmedia  Před 2 lety

      Hi, what's the error message you are getting?

  • @mtanaro
    @mtanaro Před 2 lety +1

    Good morning Joan, I followed all the steps but the report was not created. Do you have a clue what could happened?

    • @joanmedia
      @joanmedia  Před 2 lety

      Hi Maria, good afternoon, sorry for the delay. It should work following the steps. I would suggest some debug" steps:
      1- www.npmjs.com/package/cypress-mochawesome-reporter Here are some steps depending on the versions, maybe there are some differences? so you can apply a change depending on your framework.
      2- You can access my repo, and take a look of what I did, and maybe a typo can be found: github.com/JoanEsquivel/cypress-demo-framework
      3- We can pray, maybe god can help us hahaha

  • @shadowkun-
    @shadowkun- Před rokem

    Can you make tutorial about this but make it that it emails the report everytime a test run is finished? is that possible?

  • @andyTarcz
    @andyTarcz Před 2 lety +1

    How can i share the report with someone? it is a local file so im wondering how i can do that

    • @joanmedia
      @joanmedia  Před 2 lety

      When you are working with a CI tool like Jenkins you can save it per job and share the link: czcams.com/video/Gf0gxV1bYbc/video.html and why not send that by email. There are more ways to do it, but I think that’s the most basic way to do it

  • @lovely-do8ns
    @lovely-do8ns Před 2 lety

    I can see only json file not the HtMl file what should I do ?