第一次将Behat 3.4.3与Symfony 4结合使用,无法弄清楚为什么Behat一直说我的场景和步骤未定义。
这是.feature
//features/dash_contents.feature
@dashboard_context
Feature: Dashboard access
As a user
I should be able to view stats
Scenario: Observing the dashboard
When viewing the dashboard page
Then I should see elements
这是课程
//Behat/DashboardContents.php
<?php
namespace App\Tests\Behat;
use Behat\Mink\Element\NodeElement;
use Behat\Mink\Exception\ElementNotFoundException;
use Behat\Mink\Exception\PendingException;
/**
*/
class DashboardContents
{
/**
* @Observing the dashboard
*/
public function observingTheDashboard()
{
throw new PendingException();
}
/**
* @When viewing the dashboard page
*/
public function viewingTheDashboardPage()
{
throw new PendingException();
}
/**
* @Then I should see elements
*/
public function iShouldSeeElements()
{
throw new PendingException();
}
}
运行bin/behat
会给出以下警告:
1 scenario (1 undefined)
2 steps (2 undefined)
我在这里想念什么?