Skip to content

Login in BeforeAll? #565

Answered by Tallyb
SpiderRam asked this question in Q&A
Dec 21, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

The biggest limitation I found with cucumber is the lack of beforeFeature. BeforeAll runs only once for all tests and before runs before each scenario. So if you are looking for something at the feature level it does not exist.

  1. The playwright config is not used in cucumbers, exactly for the reason you mentioned. The cucumber.js file is used for all configuration needs.
  2. You can implement the same with cucumber. The before hook can take a tag and run only for those specific tags. You could also set the "logged in user" on world, and then have a default "before" (no tag) that will login with a default user, if the current user is not set.
  3. If you need to set something in the beforeAll that w…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@SpiderRam
Comment options

@madrane9
Comment options

Answer selected by SpiderRam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants