mercredi 4 novembre 2015

Error while running behat on laravel 5

When i run behat with feature set as

Feature: Authentication
Checking Application Authentication Functionality.

@javascript
Scenario: Admin Redirect Page
    Given I am on "/admin/dashboard"
    Then I should be on "/admin/login"

Scenario: Admin Login Failure
    When I go to "/admin/login"
    And I fill in "email" with "testaccount@gmail.com"
    And I fill in "password" with "wrongpassword"
    And I press "Login"
    Then I should see "Login Failure"

The first scenario works but the second one fails, response :-

Scenario: Admin Redirect Page        # app/tests/behat/features/auth.feature:5
    Given I am on "/admin/dashboard"   # FeatureContext::visit()
    Then I should be on "/admin/login" # FeatureContext::assertPageAddress()

  Scenario: Admin Login Failure                                 # app/tests/behat/features/auth.feature:9
    When I go to "www.google.com"                               # FeatureContext::visit()
      Target [Illuminate\Contracts\Http\Kernel] is not instantiable. (Illuminate\Contracts\Container\BindingResolutionException)

I tried removing 1st scenerio to test if my feature was broken and behat ran successfully.

Scenario: Admin Login Failure                                 # app/tests/behat/features/auth.feature:9
    When I go to "/admin/login"                                 # FeatureContext::visit()
    And I fill in "email" with "testaccount@gmail.com" # FeatureContext::fillField()
    And I fill in "password" with "wrongpassword"               # FeatureContext::fillField()
    And I press "Login"                                         # FeatureContext::pressButton()
    Then I should see "Login Failure"                           # FeatureContext::assertPageContainsText()

1 scenario (1 passed)
5 steps (5 passed)
0m3.70s (23.80Mb)

I am not sure why it is failing when i implement 2 scenerios.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire