These are chat archives for Behat/Behat

4th
May 2017
SamyOteroGlez
@SamyOteroGlez
May 04 2017 16:59

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 add 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. But if I check by querying the db before executing the login the user is there.

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

So, what is happening here?

Thanks.