问题描述
Cypress 清除所有cookie 和本地存储.还会清除浏览器的文件缓存吗?
Cypress clears all cookies and local storage before each test. Does it also clear the browser's file cache?
推荐答案
编辑:在浏览器在版本0.20.0 .因此,将在每个spec文件运行之间清除缓存.
Cypress automatically clears browser cache before the browser launches in Version 0.20.0. So, the cache will be cleared between each spec file is run.
否,赛普拉斯不会在每次测试之前清除浏览器缓存.赛普拉斯会尊重您服务器的缓存头.因此,如果设置了它们,浏览器将缓存这些文件.确实没有任何地方对此进行真正的记录,但是我是赛普拉斯的一名开发人员,所以知道这是如何工作的.
No, Cypress does not clear browser cache before each test. Cypress respects the cache headers of your server. So if they are set, the browser will cache those files. This isn't really documented anywhere exactly, but I'm a developer at Cypress so know this is how it works.
如果您希望看到一些不同的行为,我建议打开问题在OS Cypress项目上.
If you want to see some different behavior, I suggest opening an issue on the OS Cypress project.
这篇关于赛普拉斯是否在每次测试之前清除浏览器缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!