jeudi 4 mai 2017

Laravel Behat DB connection

I've been having issues with behat and laravel working together. I configured Behat with Laravel. I have this simple scenario:

Scenario: Login as an admin Given I add an admin to the db When I login as an admin Then I should be in the welcome page

In the FeatureContext Class I insert the admin user to the db using factories.

Everything works fine if I don't use the browser. But, when I start the selenium server and I add the @javascript tag to the Scenario, the test run fine, the browser start fine, but the login process fails because there is no users in the db. Yes the same user with the same credentials that I just added in the first step. Also I checked for the user by querying the db before executing the login, and the user is there.

BTW, I only have one connection, I triple-checked that.

So, what is happening here? Any Ideas?

Thanks.

Aucun commentaire:

Enregistrer un commentaire