使用behat和selenium2获取状态响应
我在behat中进行了获取状态响应的测试,但出现以下错误: 这是我的设想:使用behat和selenium2获取状态响应,selenium,behat,acceptance-testing,mink,Selenium,Behat,Acceptance Testing,Mink,我在behat中进行了获取状态响应的测试,但出现以下错误: 这是我的设想: Feature: Google @javascript Scenario: Search Given I am on the homepage When I go to "http://stackoverflow.com" Then I wait 3 seconds And the response status code sh
Feature: Google
@javascript
Scenario: Search
Given I am on the homepage
When I go to "http://stackoverflow.com"
Then I wait 3 seconds
And the response status code should be 200
代码ph:
/**
* @Then the response status code should be :arg1
*/
public function theResponseStatusCodeShouldBe($arg1)
{
if ((string)$this->_response->getStatusCode() !== $arg1) {
var_dump('HTTP code does not match '.$httpStatus.' (actual: '.$this->_response->getStatusCode().')');
}
}
如何解决此错误?请避免重新定义现有步骤。
您在MinkContext中已经有了此步骤 您应该使用在phpstorm等功能文件中具有自动完成功能的IDE编辑器
不明确匹配
错误是因为已经定义了具有相同代码段的方法。不能使用相同的代码段定义步骤