Skip to content

Screenshot duplicates on a every test run #38

@SchDen

Description

@SchDen

I create a simple test and run him several times

Test code

it('Load page corrctly', () => {
    cy.server();
    cy.route(/models\/\S+/).as('fetchMockData');

    cy.visit('/');
    cy.wait('@fetchMockData').its('status').should('eq', 200);

    cy.getByTestId('canvas').compareSnapshot('/compare/canvas');
});

All it's ok, but I saw in a project tree some screensots for this test
image

When I try to call cypress run I got this message

  (Screenshots)

  -  /tests/e2e/screenshots/open-page.spe      (689x688)
     c.js/compare/canvas-actual.png  

and all files expect canvas-actual.png was deleted.

Cypress uses canvas-actual.png but a last generated file is canvas-actual (2).png.

Could you please explain how it works?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions