我们正在使用Behat和Mink。到目前为止,我们只是在代码中设置了DesiredCapabilities,但现在我们想要更改它以从behat.yml中获取它们并使用不同的配置文件,所以我们有一个用于firefox的配置文件,一个用于chrome ...等等。如何使用水貂在behat.yml中正确设置desiredCapabilities
现在,这是我目前behat.yml:
chrome:
extensions:
Behat\MinkExtension:
sessions:
default:
selenium2:
wd_host: "http://localhost:4444/wd/hub"
capabilities:{"browserName":"chrome","version":"51","platform":"ANY","browserVersion":"51","browser":"chrome","name":"Behat Test","deviceOrientation":"portrait","deviceType":"tablet", "selenium-version":"2.31.0"}
当我尝试启动轮廓镀铬测试我得到这个错误:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]Unrecognized option "selenium-version" under testwork.mink.sessions.default.selenium2.capabilities"
如果我删除了“硒它只是跳转到使用在Selenium2Driver.php中定义的默认功能
任何想法为什么发生这种情况?毕竟,Selenium2的默认功能也使用硒版本...
检查[这个博客](http://www.inanzzz.com/index.php/posts/behat),看看它是否有帮助。有许多behat.yml和实际测试示例。例如:http://www.inanzzz.com/index.php/post/6djs/running-behat2-tests-with-different-browsers – BentCoder