我在 windows7 上使用 behat ..这是我今天挣扎的第四天...我写了一个功能
#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 中定义
请帮忙!!!