我使用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: ~
我应该如何测试这种情况下?