Pytorch-NLU
Pytorch-NLU copied to clipboard
Screenshot cache with previous test?
Hi there,
I am using the jest-puppeteer example shown in integration-examples/another-jest-and-puppeteer/example.test.js and I been noticing that the first screenshot of every tests are based on last screen of the previous tests that are being run.
Attached the code and the root cause run result.
Screenshots are taken before a step is run - so if your browser is in another page before you navigate - it will show "wherever the browser was before navigation started" basically :]
I think it would make sense to warn here though?
I think it would make sense to warn here though?
or is there a way to reset the page. my thinking is better to show a white screen then the previous test's last screen?
jest-puppeteer
has a resetPage method for such use cases
https://github.com/smooth-code/jest-puppeteer#globaljestpuppeteerresetpage
Also i think that showing the screenshot is actually good thing to do, It does exactly what it should do, showing the developer the state of the page, reminding him that he is not starting from a clean slate
It does exactly what it should do, showing the developer the state of the page, reminding him that he is not starting from a clean slate
Yeah, I agree it's correct but we can show a (helpful) warning so the developer knows how they got there
jest-puppeteer
has a resetPage method for such use cases https://github.com/smooth-code/jest-puppeteer#globaljestpuppeteerresetpage
Thanks for the suggestion, it works!