Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook to run before all the tests in Cypress #91

Closed
darasandeep91 opened this issue Aug 24, 2018 · 3 comments
Closed

Hook to run before all the tests in Cypress #91

darasandeep91 opened this issue Aug 24, 2018 · 3 comments

Comments

@darasandeep91
Copy link

I wrote a before hook and have places in support/Commands.js

But the hook is running before each test in cypress. But i wanted it to run only once irrespective of the tests in cypress

Is there a functionality to achieve this ?

NOTE: I am creating a subscriber that i can use for the test in before hook

@kayvanbree
Copy link
Contributor

Check out #25, there is no support for before and after hooks yet.

@alexttransisland
Copy link

@darasandeep91 can you share your gist with beforeEach hook? I can't find a native way to write it using commands with cucumber

@lgandecki
Copy link
Collaborator

lgandecki commented Dec 7, 2018

@darasandeep91
create a before.js file in the folder with step_definitions and put

before(() => {
  dbHelper.connect('...')
  dbHelper.seed('...')
})

there. Take a look here: #25 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants