我只想在固定装置级别运行“beforeEach”,而不是在该固定装置下的每个测试中运行
fixture `Fixture A for Use Case1`
.beforeEach(login)
test('A Test 1', async t => {
await t
---
});
test('A Test 2', async t => {
await t
---
});
fixture `Fixture B for Use Case2`
.beforeEach(login)
test('B Test 1', async t => {
await t
---
});
test('B Test 2', async t => {
await t
---
});
test('B Test 3', async t => {
await t
---
});
怎么了
在“Fixture A”和“Fixture B”下的每次测试之前都会运行登录功能
我需要的
我希望“登录”在每个“夹具”开始时运行一次,而不是在夹具下的每个测试中运行一次。
是否可以?我在文档中找不到方法。
这可以通过用户角色和“保留 url”选项来实现。 TestCafe 的文档在这里进行了解释:https://devexpress.github.io/testcafe/documentation/test-api/authentication/user-roles.html#optionspreserveurl https://devexpress.github.io/testcafe/documentation/test-api/authentication/user-roles.html#optionspreserveurl
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)