2017-03-27 46 views
0

的getStatus響應我在貝哈特測試得到一個狀態響應,但我有此錯誤:與貝哈特和selenium2

enter image description here

這是我的情景:

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().')'); 
    } 

} 

如何解決此錯誤?

回答

0

請避免重新定義現有步驟。
您已在MinkContext中執行此步驟。

您應該使用一個IDE編輯器,它在像phpstorm這樣的功能文件中具有自動完成功能。

Ambiguous match錯誤是因爲具有相同片段的方法已經定義。
您無法使用相同片段定義步驟。