https://cypress.io logo
Never I am completely new.
# e2e-testing
a
Never I am completely new.
c
Okay, give me just a second to draft a message :)
Also, please open this thread and respond in here so we can keep the outer channel clean
a
Ok
c
So, are you familiar with the Cypress structure of tests? Example:
Copy code
describe('test', ()=>{
  it('tests something', ()=>{
    //test
  }
}
a
Yes
c
Well, besides
it()
statements, we can also have
before()
and
after()
hooks, which perform actions before or after all of the
it()
statements
There are also versions called
beforeEach()
and
afterEach()
that trigger before or after each individual
it()
statement instead of before or after all of them in a
describe()
statement
a
Yes I know that also but how can I make parallel
Few tests
c
You'd have to separate the tests into their own files so you can set up specific
before()
hooks unique to that test's required preconditions
a
If you want I can show you my problem live
c
Sorry, I won't have time for that as I'm working at the moment
a
Ok
Actually unable to understand how can I make previous test in before
c
No worries, that's an easy solve
Do you have the cypress steps that complete the form?
a
Yes
c
grab all of those
cy
commands and copy and paste them into the
before()
hook for the other tests
That will make it so the tests can run parallel, because the tests that complete the form are now separate from the tests that follow it, due to the form for the other tests being completed as part of the precondition
3 Views