cypress-image-snapshot icon indicating copy to clipboard operation
cypress-image-snapshot copied to clipboard

e2eSpecDir but for component testing

Open mlnarik opened this issue 2 years ago • 4 comments

Hello, there should be also option to set folder for component testing for that we get the same issue that is creates long nested folders. Could you please add the option for component testing? Cheers

mlnarik avatar Sep 29 '23 12:09 mlnarik

Hey,

I did discuss that here - https://github.com/simonsmith/cypress-image-snapshot/pull/8#issuecomment-1645391607

What issue are you seeing? In my tests I did not see any folder repeating (like cypress/e2e/ twice) when doing component tests

simonsmith avatar Sep 29 '23 13:09 simonsmith

I would want to have less nested folders, generated full path gets quite long, it would generate ...\cypress\snapshots\cypress\components\DateFilter.cy.tsx\DateFilter\ -- allows to select custom range.png\ -- allows to select custom range.snap.png

while I could easily imagine it shorter without "cypress\components" part also it part "-- allows to select custom range.snap.png" gets repeated

Might not be related but I also get "EISDIR: illegal operation on a directory, read" when I reran test through cypress open even though cypress run works fine. I assumed it is because of the long paths but might be something else.

EISDIR: illegal operation on a directory, read at Object.readSync (node:fs:738:3) at Object. at Object.readSync at tryReadSync (node:fs:438:20) at Object.readFileSync (node:fs:484:19) at diffImageToSnapshot (\node_modules@simonsmith\cypress-image-snapshot\node_modules\jest-image-snapshot\src\diff-snapshot.js:243:47](http://localhost:4000//#)) at Object.runImageDiffAfterScreenshot [as handler] (\node_modules@simonsmith\cypress-image-snapshot\plugin.js:95:62](http://localhost:4000//#))

mlnarik avatar Oct 02 '23 10:10 mlnarik

alternatively I get sometimes different error EPERM: operation not permitted, copyfile 'C:\Dev\project\cypress\snapshots\cypress\components\Buttons.cy.tsx\ButtonGroup\ -- shows correctly.snap.png' -> 'C:\Dev\project\cypress\snapshots\cypress\components\Buttons.cy.tsx\ButtonGroup\ -- shows correctly.png'

at Promise.longStackTracesCaptureStackTrace [as _captureStackTrace] (http://localhost:4000/__cypress/runner/cypress_runner.js:3486:19) at Promise._then (http://localhost:4000/__cypress/runner/cypress_runner.js:1239:17) at Promise._passThrough (http://localhost:4000/__cypress/runner/cypress_runner.js:4110:17)

These errors appear after I do cypress run for all spec files and then run a single spec file after with cypress open, this makes the package unusable.

mlnarik avatar Oct 02 '23 10:10 mlnarik

Might be ideal if you can create a separate issue with steps/example repo I can use to recreate that issue as I've not seen it. I also don't use windows so could be platform specific

simonsmith avatar Oct 02 '23 14:10 simonsmith

No activity

simonsmith avatar Jun 06 '24 12:06 simonsmith