我使用windows7的上貝哈特..它是今天的奮鬥我的第四天......我寫了一個功能貝哈特未定義的一步,雖然它應該被定義
#homepage.feature
Feature: To test the Home page loads successfully.
Scenario:
Given I am in a session
When I request the page "index.php"
Then I should get some content
和定義的步驟
/**
* @Given /^I am in a session$/
*/
public function iAmInASession() {
$driver = new \Behat\Mink\Driver\Selenium2Driver(
'firefox', 'base_url'
);
global $session;
$session = new \Behat\Mink\Session($driver);
// start session:
$session->start();
}
/**
* @When /^I request the page "([^"]*)"$/
*/
public function iRequestThePage($page)
{
global $session;
$session->visit($page);
}
/**
* @Then /^I should get some content$/
*/
public function iShouldGetSomeContent()
{
global $session;
if($session->getPage()->getContent())
echo $session->getPage()->getContent();
else
throw new Exception("The page couln't load successfully!");
}
它也向我展示了147個未定義的場景和878個未定義的步驟,而某些步驟在FeatureContext.php中定義了一些步驟
請幫忙!!!
你確定你執行正確的方案嗎? – DevZer0
謝謝,我已經解決了這個問題:) – Taz