简体   繁体   English

Symfony / Behat不使用wd_driver

[英]Symfony/Behat doesn't use wd_driver

I want to use Behat with Symfony2 and Selenium (standalone server). 我想将Behat与Symfony2和Selenium(独立服务器)一起使用。

I configure my behat.yml 我配置了我的behat.yml

behat.yml behat.yml

default:
    formatters:
        pretty:
            verbose:  true
    extensions:
        Behat\Symfony2Extension:
            #screenshot_directory: /tmp/screenshot

        Behat\MinkExtension:
            base_url: 'http://localhost/app_test.php'
            selenium2:
                 wd_host: "http://192.168.33.1:6666/wd/hub"
            browser_name: googlechrome
            show_auto:    false
            sessions:
                default:
                    symfony2: ~
                javascript:
                    selenium2: ~
    suites:
        default:
            paths:
                - '%paths.base%/tests/behat/features'
            contexts:
                - FeatureContext

I start behat with the command 我用命令开始behat

bin/behat --no-interaction --config /var/www/myproject/behat.yml /var/www/myproject/tests/behat/features/scenario/demo.feature

I have an error message: 我有一条错误消息:

Could not open connection: Curl error thrown for http POST to http://localhost:4444/wd/hub/session

Why behat doesn't use the wd_host in my configuration ? 为什么behat在我的配置中不使用wd_host? What i missed ? 我错过了什么?

Because you redeclare it bellow on line 因为您在线下重新声明了它

javascript:
    selenium2: ~

To fix that - move your url under javascript section 要解决此问题,请在javascript部分下移动您的网址

default:
    formatters:
        pretty:
            verbose:  true
    extensions:
        Behat\Symfony2Extension:
            #screenshot_directory: /tmp/screenshot

        Behat\MinkExtension:
            base_url: 'http://localhost/app_test.php'
            browser_name: googlechrome
            show_auto:    false
            sessions:
                default:
                    symfony2: ~
                javascript:
                    selenium2: 
                        wd_host: "http://192.168.33.1:6666/wd/hub"
    suites:
        default:
            paths:
                - '%paths.base%/tests/behat/features'
            contexts:
                - FeatureContext

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM