我使用JavaScript驗證表單,我想測試驗證消息,因爲消息是少數語言的。然而,貝哈特拋出一個異常Behat測試驗證消息
無法打開連接:捲曲拋出錯誤HTTP POST到
http://localhost:4444/wd/hub/session使用參數: { 「desiredCapabilities」:{ 「標籤」:「流浪的Ubuntu的,值得信賴-32「,」PHP 7.0.1-2 + deb.sury.org〜trusty + 1「],」browser「:」firefox「,」ignoreZoomSetting「:false,」name「:」Behat feature suite「, 「browserName」:「firefox」}}
無法連接到本地主機端口4444:連接被拒絕(Behat \ Mink \ Exception \ DriverException)
特點:驗證形式接觸 在接觸形式看到驗證信息
@javascript
Scenario: Message validation in english lang
Given I am on "/"
When I fill in "name" with "behat"
And I fill in "email" with "[email protected]"
And I fill in "phone" with "111222333"
And I fill in "message" with "That test message, send via Behat."
When I press "Send Message"
Then I wait for the suggestion box to appear
Then I should see "Your message has been sent."
類FeatureContext擴展MinkContext {
public function __construct()
{
}
/**
* @Then /^I wait for the suggestion box to appear$/
*/
public function iWaitForTheSuggestionBoxToAppear()
{
$this->getSession->wait(5000, false);
}
default:
extensions:
Behat\MinkExtension:
goutte: ~
base_url: 'http://localhost.dev/'
javascript_session: selenium2
browser_name: firefox
selenium2: ~
我應該如何測試這種情況下?