famous-restaurant-30435
07/14/2022, 3:12 PMable-monkey-72947
07/14/2022, 3:14 PMdefineConfig
,
module.exports = defineConfig({
e2e: {...},
experimentalInteractiveRunEvents: true
}
famous-restaurant-30435
07/14/2022, 3:15 PMable-monkey-72947
07/14/2022, 3:24 PMon('before:spec', (spec) => {
console.log('!!!!! before:spec', spec)
})
When I start the test runner, not when I run the spec, I see this - !!!!! before:spec { name: '', absolute: '', relative: '', specType: 'integration' }
. And then when I run the spec I don't see anything output?able-monkey-72947
07/14/2022, 3:24 PMbeforeEach
at the top of every test), is setupNodeEvents
the correct place to be hooking into here?famous-restaurant-30435
07/14/2022, 3:29 PMfamous-restaurant-30435
07/14/2022, 3:29 PMable-monkey-72947
07/14/2022, 3:32 PMfamous-restaurant-30435
07/14/2022, 3:32 PMfamous-restaurant-30435
07/14/2022, 3:34 PMable-monkey-72947
07/14/2022, 3:34 PMgetStaticProps
as well.able-monkey-72947
07/14/2022, 3:35 PM10.3.0
is telling me test:before:run
isn't a valid event?famous-restaurant-30435
07/14/2022, 3:36 PMfresh-plastic-30342
07/14/2022, 5:21 PMfresh-plastic-30342
07/14/2022, 5:21 PMadorable-smartphone-87280
07/14/2022, 5:46 PMbrash-ghost-16880
07/14/2022, 7:35 PMbrash-ghost-16880
07/14/2022, 7:38 PMbrash-ghost-16880
07/14/2022, 7:39 PMadorable-smartphone-87280
07/14/2022, 7:39 PMadorable-smartphone-87280
07/14/2022, 7:40 PMbrash-ghost-16880
07/14/2022, 7:41 PMadorable-smartphone-87280
07/14/2022, 7:43 PMbrash-ghost-16880
07/14/2022, 7:45 PMbrash-ghost-16880
07/14/2022, 7:46 PMadorable-smartphone-87280
07/14/2022, 8:06 PMbrash-ghost-16880
07/14/2022, 9:04 PMcareful-computer-31749
07/14/2022, 11:50 PMadorable-smartphone-87280
07/15/2022, 1:16 AMsome-park-44701
07/15/2022, 6:07 AMTypeScript
it('tests some flow', () => {
cy.login('some_user_name');
cy.some_cool_custom_command();
})
Now, instead of testing it with just 'some_user_name', I have a list of perhaps 40 different roles that needs to use that custom command in the flow. For the sake the argument, whatever is done in beforeAll and afterAll must be run for each for the tests.
Is there a good way to reuse the test instead of having to write the same flow 40 times?