1st Try:--- 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 "/admin/login" # FeatureContext::visit()
Target [Illuminate\Contracts\Http\Kernel] is not instantiable. (Illuminate\Contracts\Container\BindingResolutionException)
2nd Try:--- I tried removing 1st scenario 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 scenario.
3rd Try:---
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 Redirect Page
Given I am on "/admin/dashboard"
Then I should be on "/admin/login"
Scenario: Admin Redirect Page
Given I am on "/admin/dashboard"
Then I should be on "/admin/login"
result:-
Feature: Authentication
Checking Application Authentication Functionality.
@javascript
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 Redirect Page # app/tests/behat/features/auth.feature:9
Given I am on "/admin/dashboard" # FeatureContext::visit()
Target [Illuminate\Contracts\Http\Kernel] is not instantiable. (Illuminate\Contracts\Container\BindingResolutionException)
Then I should be on "/admin/login" # FeatureContext::assertPageAddress()
Scenario: Admin Redirect Page # app/tests/behat/features/auth.feature:13
Given I am on "/admin/dashboard" # FeatureContext::visit()
Target [Illuminate\Contracts\Http\Kernel] is not instantiable. (Illuminate\Contracts\Container\BindingResolutionException)
Then I should be on "/admin/login" # FeatureContext::assertPageAddress()
--- Failed scenarios:
app/tests/behat/features/auth.feature:9
app/tests/behat/features/auth.feature:13
3 scenarios (1 passed, 2 failed)
6 steps (2 passed, 2 failed, 2 skipped)
0m2.87s (24.19Mb)