Behat和Symfony的未定义场景和步骤

时间:2018-09-06 13:34:09

标签: symfony4 behat

第一次将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)

我在这里想念什么?

0 个答案:

没有答案