I have an user (administrator) already existed in database. I run the cucumber test and create another user. I expected the 2 users after executing a scenario, but got 1. Where is my mistake? May be cucumber does not count an existing entities in db if they are not created via cucumber…
I have an user (administrator) already existed in database. I run the cucumber test
Share
Your test database is cleared before every test. You have to create the Admin as part of your Cucumber steps, probably with a “Background:” is the best way.
edit To log in as an admin, do something like this:
Hopefully you’re able to write those step definitions yourself. “Given I am an admin” will just create an admin user, and “I have logged in” will go through the Login page, logging in as the admin.