0
第一次尝试:--- 当我运行贝哈特与功能设置错误而在laravel运行贝哈特5
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 "[email protected]"
And I fill in "password" with "wrongpassword"
And I press "Login"
Then I should see "Login Failure"
第一种方案的工作,但第二个失败,响应: -
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)
第二次尝试:--- 我试着删除第一个场景来测试我的功能是否损坏,并成功运行。
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 "[email protected]" # 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)
我不知道为什么它在我实现2场景时失败。
第三尝试:---
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"
结果: -
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)
我laravel 5.1.23 而贝哈特所需的软件包 “贝哈特/小黄瓜”: “^ 4.3”, “贝哈特/貂皮selenium2驱动器”: “^ 1.2”, “贝哈特/貂皮browserkit-驱动程序“:”^ 1.2“, ”laracasts/integrated“:”^ 0.15.6“, ”behat/behat“:”^ 3.0“, ”behat/mink“:”^ 1.6“, ”behat /水貂扩展“:”^ 2.0“, ”laracasts/behat-laravel-extension“:”^ 1.0“, –
我正在学习使用laracast学习。您的第二个方案中的 –
是否有意去google.com? – Leo