赛普拉斯:我想一次登录一次即可在100个规格文件中运行测试,并持续为每个文件登录.是否有可能? [英] Cypress: I want run tests in 100 spec files by login one time and persist login for every file. Is it possible?
本文介绍了赛普拉斯:我想一次登录一次即可在100个规格文件中运行测试,并持续为每个文件登录.是否有可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有将近100个规格文件,包括多个测试.我想一次登录即可运行所有这些规格文件. 我不希望我的赛普拉斯每次都登录每个规格文件的过程 可以为所有规格文件保留一次登录
I have almost 100 specs files including multiple tests. I want run all these specs files by login one time. I dont want my cypress should login process every time on every spec file It it possible to persist single login for all spec files
推荐答案
Take a look at our "Logging in" recipes https://github.com/cypress-io/cypress-example-recipes#logging-in-recipes - most of them log in once using before
hook, and then save the cookie / token in a local variable and set it again and again in beforeEach
hook
这篇关于赛普拉斯:我想一次登录一次即可在100个规格文件中运行测试,并持续为每个文件登录.是否有可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文