簡體   English   中英

Symfony / Behat不使用wd_driver

[英]Symfony/Behat doesn't use wd_driver

我想將Behat與Symfony2和Selenium(獨立服務器)一起使用。

我配置了我的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

我用命令開始behat

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

我有一條錯誤消息:

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

為什么behat在我的配置中不使用wd_host? 我錯過了什么?

因為您在線下重新聲明了它

javascript:
    selenium2: ~

要解決此問題,請在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