Skip to content
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

Add Cypress option to clear browser cache before each test #1124

Closed
acamposruiz opened this issue Dec 23, 2017 · 10 comments
Closed

Add Cypress option to clear browser cache before each test #1124

acamposruiz opened this issue Dec 23, 2017 · 10 comments
Labels
type: feature New feature that does not currently exist
Milestone

Comments

@acamposruiz
Copy link

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

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane added the type: feature New feature that does not currently exist label Dec 26, 2017
@m-apsolon

This comment has been minimized.

1 similar comment
@irondan
Copy link

irondan commented Jan 18, 2018

+1

@jennifer-shehane jennifer-shehane added the stage: ready for work The issue is reproducible and in scope label Jan 18, 2018
@davidszepernick
Copy link

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.

@brian-mann
Copy link
Member

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.

@brian-mann brian-mann added stage: needs information Not enough info to reproduce the issue and removed stage: ready for work The issue is reproducible and in scope labels Feb 10, 2018
@brian-mann
Copy link
Member

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

@brian-mann
Copy link
Member

Released in 2.0.0.

@hjhimanshu01
Copy link

Hey @brian-mann ,any recent development on manual clearCache command?

@ghost
Copy link

ghost commented Jan 8, 2020

Weird that his has been closed however it is not yet added as a feature...?

@jennifer-shehane
Copy link
Member

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.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

7 participants