Extra images for tests #300
Unanswered
gigaSproule
asked this question in
Q&A
Replies: 1 comment
-
Hey! It might be that there is a bug in this feature or that some changes in Cypress had broken it (it has happened in the past). Can you please report a bug with all of the needed info? (package version, OS, node version, cypress version). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think I maybe doing something wrong, or just simply misunderstanding what is happening, but from my understanding, the
#index
in the file name is to separate the different screenshots taken within a test (i.e. if there are 2 different snapshots to be taken, there will be a#0
and a#1
image). I'm also aware that it can be used for retries as well.However, in tests where there are only 1 snapshot taken and retries are not set (default to
0
) or explicitly set to0
, I'm still seeing other images (i.e.#1
,#2
, etc.).Can someone please explain what scenario I'm unaware of or where my understanding is wrong?
Edit: I could be wrong in my understanding of what is happening, but isn't the logic in
generateScreenshotPath
inscreenshotPath.utils.ts
problematic? From what I can tell,nameCacheCounter[screenshotPath]
will beundefined
for the first run, but have a value of0
for the next run, incrementing for each run. I can see thelastRetryNameCacheCounter
is used when a retry is triggered, but not when a new run is triggered. I'm not sure if this is a completely wrong reading of this, but considering that I am seeing that sometimes, there are test failures and the tests are automatically being re-triggered no matter what options I set, this is exacerbating the problem (or rather, not helping to deal with it). I'm not aware of how Cypress plugins work, so maybe this isn't doable, but I'd expect that on a new test run, thenameCacheCounter
to be reset.It's worth noting that this is never an issue when running
cypress run
, only withcypress open
.Beta Was this translation helpful? Give feedback.
All reactions