问题描述
我正在使用Geb测试我的应用程序,并且我希望在测试之间保持会话,这样我就可以避免在每次测试中登录(当在浏览器中观看测试时,这是令人讨厌的)。
有没有办法维持会话? 每次测试之后的cookies,这意味着你失去了你的网络会话。您可以使用GebConfig中的轻松更改该行为.groovy:
autoClearCookies = false
您可以阅读更多有关使用配置的信息。
所以是的,可以在测试之间保持会话。
I'm testing my application using Geb, and I want to mantain session between tests so I can avoid to log in in every tests (this is annoying when watching the tests in the browser).
Is there a way to mantain the session?
By default Geb test integrations clear all the cookies after every test which means that you loose your web sessions. You can easily change that behaviour by using the following configuration option in your GebConfig.groovy:
autoClearCookies = false
You can read more about using configuration here.
So yes, it is possible to maintain session between tests.
这篇关于使用Geb进行测试之间的Mantain会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!