Accessing all loaded scenarios to optimize shared setup #1208
Unanswered
TomasMadeja
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm working on tests for an app with a lot of moving parts. Currently, I do my setup in the
Given
step, where the tests specify which parts of the app should be set up. The setup takes some time and is parallelized (as it's just the setup of different services, DB, etc.). Multiple setups can not be run in parallel, as there are some dependencies and race conditions to deal with.As is right now, this is quite inefficient, as extra time is spent waiting for features that are not yet set up, while they could all be running at once.
I thought of the following solution so far:
before_all
, check all scenariosGiven
steps that match the setupbefore_all
My question: Is there a supported way of achieving this?
I found that the Context holds a (private) reference to the Runner class, which should be able to access all the Scenarios. I though of the following solution so far:
before_all
, obtain scenarios from the RunnerGiven
steps that match the setupbefore_all
But this entire solution feels more like a workaround.
An example of the kind of scenarios I am using:
Beta Was this translation helpful? Give feedback.
All reactions