I want to run 'beforeEach' only at the fixture level and not for each test under that fixture
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
---
});
The login function is being run before every test under 'Fixture A' and 'Fixture B'
I want 'login' to run once at the start of every 'Fixture' and not for every test under the fixtures.
Is it possible? I couldn't find a way on documentation.
This is achievable via User Roles and the 'preserve url' option. TestCafe's documentation explains it here: https://devexpress.github.io/testcafe/documentation/test-api/authentication/user-roles.html#optionspreserveurl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With