Add Cypress option to clear browser cache before each test
acamposruiz opened this issue · 10 comments
Is this a Feature or Bug?
This is a Feature
Current behavior:
I can't manage to force Cypress clear browser cache before each run
Desired behavior:
I would like some option like:
./node_modules/.bin/cypress run --cache clean
so force browser to clean cache from previous run
Relevant stack overflow question: https://stackoverflow.com/questions/46950668/does-cypress-clear-the-browser-cache-before-each-test
+1
+1
I can work around this but when I use .only to pick and choose a context(for example) I run into trouble because I refresh the database but I cant refresh the cache.
For everyone commenting on this - by cache
what exactly are we describing? The ENTIRE browser profile including everything or something more specific like the offline file cache?
It would be helpful to have specifics including the use case for why this is necessary.
This is going in soon - we discovered this as the root cause of another issue. At first we will hard code Cypress to clear the cache once before each time the browser is launched, but later we'll add a new cy.clearCache
command and provide you the ability to fine tune this with the upcoming Lifecycle Events API. #686
Released in 2.0.0
.
Hey @brian-mann ,any recent development on manual clearCache
command?
Weird that his has been closed however it is not yet added as a feature...?
Cypress clears the cache once before each time the browser is launched which is what was delivered in this feature. Cypress respects the cache headers of your server. So if they are set, the browser will cache those files.
Refer to #686 for the larger clearCache
feature.