Cypress visual testing with free plugin | Compare snapshot with Cypress

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025
  • Github repo: github.com/ukt...
    Please follow the installation process as per the documentation.
    💙 𝗦𝘁𝗮𝘆 𝗖𝗼𝗻𝗻𝗲𝗰𝘁𝗲𝗱!
    Github: github.com/moi...
    Linkedin: www.linkedin.c...
    #cypress #visualtesting #automation

Комментарии • 5

  • @rchovatiya88
    @rchovatiya88 7 дней назад +1

    Bro how do u add base image so we can compare against it like comparesnapshot(/path/to/original)- as we want to make sure it matches production UI then match against test env ? Thanks btw really good video 👏

    • @moinshawon
      @moinshawon  6 дней назад

      Welcome!
      No, I didn't manually add the base image to the baseline folder. It will be automatically added there when you run the test case for the first time. Keep in mind that there won't be any comparison during your initial execution. You need to run it again for the comparison.

  • @drghungroo7956
    @drghungroo7956 Год назад +2

    Can you put a video on how to do the same in cypress 10+, where we don't have plugin folder

    • @moinshawon
      @moinshawon  Год назад +1

      Apology for the late reply.
      For cypress version above 10, please navigate to the "cypress.config.js" file and paste the below code:
      const getCompareSnapshotsPlugin = require('cypress-image-diff-js/dist/plugin');
      export default defineConfig({
      e2e: {
      setupNodeEvents(on, config) {
      getCompareSnapshotsPlugin(on, config);
      },
      },
      });
      reference: github.com/uktrade/cypress-image-diff/blob/main/docs/Cypress%20integration.md

    • @ricardorien
      @ricardorien 9 месяцев назад

      @@moinshawon Maybe you can need to put require("./node_modules/cypress-image-diff-js/dist/plugin") node_modules before!