TestCafe - 浏览器在测试之间总是从头开始.如何覆盖它以便浏览器记住缓存、用户设置和存储 [英] TestCafe - The browser always starts in clean slate between the tests. How to override this so that browser remembers cache, user settings and storage
问题描述
测试之间的浏览器始终以全新状态打开.登录在我的应用程序中被记住,因为身份验证仍然存在,但由于浏览器总是以干净的状态打开,我必须在所有夹具的钩子之前执行登录.有什么方法可以打开浏览器,以便记住用户设置、缓存、本地和会话存储?
The browser between the Tests is always open in a clean slate. The Login is remembered in my application as Authentication persists but as the browser is opened in clean slate always, I have to perform Login in Before hook of all Fixtures. Is there some way I can open browser so that user settings, cache, local and session storage are remembered?
推荐答案
TestCafe 不提供在测试之间存储页面状态的方法,并鼓励编写独立的测试.但是,Roles API 可能会满足您的一些需要(请参阅 this 评论了解更多详情).
TestCafe doesn't offer a way to store the page state between tests and encourages writing independent tests. However, Roles API may meet some of your needs (refer to this comment for more details).
这篇关于TestCafe - 浏览器在测试之间总是从头开始.如何覆盖它以便浏览器记住缓存、用户设置和存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!