meinaart / cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io
MIT License
489 stars 116 forks source link

(bug) plugin does not work with Firefox #170

Open vegerot opened 3 years ago

vegerot commented 3 years ago

Describe the bug When running a test like

  it.only('looks right', () => {
    cy.url().should(($url) => {
      expect(new URL($url).toString()).to.equal(new URL(config.dashboardUrl).toString());
    });
    cy.document().toMatchImageSnapshot();
  });

it works fine in Chrome, but when running it in Firefox I get

image

To Reproduce Steps to reproduce the behavior:

  1. Write a simple screenshot test
  2. Confirm it works fine in Chrome
  3. See error in Firefox

Expected behavior The behavior should be the same in Firefox and Chrome Screenshots

image

Desktop (please complete the following information):

Additional context

The error message says:

cypress-plugin-snapshots does not work when running all tests

My question is: How do I not run all the tests?. If I use it.only, the error still happens. I do not see any way in the Cypress GUI to only run a specific test.

I realize the bug actually comes from an upstream issue, and I'm okay with that. But what I'm wondering is two things:

  1. Why is this only in Firefox?
  2. The error message says I can work around this issue by only running one test: how do I do that?