I am aware there is a beforeEach() function which I am currently using.
However, I would like to be able to run a before function for all my parent level 'describes' and not the 'it' functions within them.
For example my test looks like this (with an x in front of the functions beforeEach executes):
beforeEach: login/out stuffs
x describe: create first case
x it: make selections
x it: add details
x it: change confidentiality settings
x it: etc
x describe: create second case
x it: make selections
x it: add details
x it: change confidentiality settings
x it: etc
Now below is how I want my test to look (with an x in front of the functions I WANT beforeEach to execute):
beforeEach: login/out stuffs
x describe: create first case
it: make selections
it: add details
it: change confidentiality settings
it: etc
x describe: create second case
it: make selections
it: add details
it: change confidentiality settings
it: etc
Please suggest some solutions.
My solution to this problem was to split the two describe blocks in to 2 separate spec files. I figured this made more sense anyway, as each test had different conditions it needed to meet, and it isn't much hassle to have extra spec files.