Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

devjvao
Copy link
Contributor

@devjvao devjvao commented Dec 1, 2022

This adds compatibility with Cypress v10 and v11.

When Cypress v10 came out, the paths of generated files were changed and with that update, this lib stopped working.

An open issue (#131) reports the mismatch between paths, and based on @mighdoll fork and @csnate suggestions I am opening this PR.

The solution involves using the Cypress.spec.relative variable to compute the snapshot directory and adding a new environment variable named INTEGRATION_FOLDER to remove it from the relative spec path obtaining only the desired subpath.

Example:

INTEGRATION_FOLDER: cypress/integration

Cypress.spec.relative: cypress/integration/path/to/spec/one.cy.js

Desired subpath: path/to/spec/one.cy.js

mighdoll and others added 7 commits June 19, 2022 00:28
* rely on cypress reported snapshot location (fix for cypress 10 changes)
* move .png images rather than copying, to reduce extra files
* simplify initialization with fewer global variables
* capture snapshot location for cypress 10 compatibility
* revise updated version of plugins
* cosmetic refactoring
@devjvao devjvao changed the title Use the relative spec path to compute the snapshot directory Use relative spec path to compute the snapshot directory Dec 1, 2022
@devjvao devjvao mentioned this pull request Dec 1, 2022
@mjhea0
Copy link
Collaborator

mjhea0 commented Dec 2, 2022

Looks good to me. @Zaista, any thoughts?

@georgekaran
Copy link

Any update on this PR? We're currently locked in the Cypress 9.

@Zaista
Copy link
Collaborator

Zaista commented Dec 9, 2022

Ok, tests don't work for node <14.0 as Optional chaining (?.) is not supported below. So we should reconsider the CI tests. But not to block the PR any further I'll merge it

@Zaista Zaista merged commit e83aa78 into cypress-visual-regression:master Dec 9, 2022
@dargmuesli
Copy link
Contributor

@Zaista I've created PR #145 to further help with optional chaining issues.

@raimund-schluessler
Copy link
Contributor

It would be great if the environment variable INTEGRATION_FOLDER would be documented somewhere. It took me a while of reading the source code to figure out why the directories looked weird and the base images were not found anymore πŸ™ˆ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants