-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Absolute path generated in cypress/snapshot directory #41
Comments
Is there a reason why your screenshots folder is identical to the snapshots folder? That seems like it would cause problems to me. Can you try the Cypress default of https://docs.cypress.io/guides/references/configuration#Screenshots |
I am also experiencing this issue with "default" cypress settings. Cypress version: 13.2.0 // cypress.config.js
const { defineConfig } = require("cypress");
const { addMatchImageSnapshotPlugin } = require('@simonsmith/cypress-image-snapshot/plugin');
module.exports = defineConfig({
//chromeWebSecurity: false,
e2e: {
setupNodeEvents(on, config) {
addMatchImageSnapshotPlugin(on)
},
},
}); // cypress/support/e2e.js
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
//require('@cypress/snapshot').register()
import { addMatchImageSnapshotCommand } from '@simonsmith/cypress-image-snapshot/command'
addMatchImageSnapshotCommand({
failureThreshold: 0.005,
failureThresholdType: 'percent',
})
// Alternatively you can use CommonJS syntax:
// require('./commands') |
Thanks for the report, I'll take a look this week @sbrow What platform are you on? The tests in this repository run on Linux/Mac and I see no such issue with default settings |
I am running on NixOS, this is my flake: {
description = "Website testing";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachSystem flake-utils.lib.allSystems
(system:
let pkgs = nixpkgs.legacyPackages.${system}; in
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell
{
buildInputs = with pkgs; [
cypress
nodejs
];
};
});
} To make it use the nix bundled version of NixOS, I have have an environment variable set export CYPRESS_RUN_BINARY=$(which Cypress) Let me know if you have any other questions. I can provide my |
Looking at #32, I think it's worth noting that the path of my project does include multiple e.g. |
New information! It works fine when I do |
Do you mean |
yes, my mistake. |
Could you please show me the difference in path between Also, note that you can tell Cypress to put open mode snapshots in a different directory if you're not using them (for example if you generate snapshots in const path = Cypress.config('isInteractive')
? `cypress/snapshots/${Cypress.browser.name}/open-mode`
: `cypress/snapshots/${Cypress.browser.name}`;
addMatchImageSnapshotCommand({
customSnapshotsDir: path,
}); |
Sure, here is the spec path: How the snapshot path looks in
How the snapshot path looks in
|
Hi there!
With the following configuration options for
addMatchImageSnapshotCommand()
in index.ts:... and this option passed in cypress.config.ts:
screenshotsFolder: "cypress/snapshots/",
... I didn't expect the final screenshot path to look like this:
Could you please help me determine why so? Thanks in advance!
The text was updated successfully, but these errors were encountered: