2013-11-25 49 views
1

我期待整合Behat和BrowserStack。我已經設置了基本功能,但我想啓用本地tunnling。我已經下載了所需的jar來做到這一點。問題出現在我想設置「browserstack_tunnel」參數的時候。Behat + BrowserStack

在MinkExtenstion/Services/Extention.php中,我將以下按鍵添加到seliuem2配置文件中。

booleanNode('browserstack-tunnel')->end()-> 
booleanNode('browserstack-debug')->end()-> 

這是我behat.yml:

default: 
filters: 
    tags: "[email protected]" 
formatter: 
    name: pretty 
parameters: 
    snippets: false 

extensions: 

SilverStripe\BehatExtension\MinkExtension: 
    # Adjust "base_url" to your own website URL. 
    # Can be set via environment variables or _ss_environment.php/$_FILE_TO_URL_MAPPING as well. 
    # 
    # base_url: http://localhost/ 

    # TODO Dynamically set through LocatorProcessor 
    files_path: %behat.paths.base%/framework/tests/behat/features/files/ 
    default_session: selenium2 
    javascript_session: selenium2 
    goutte: ~ 
    selenium2: 
browserstack: 
    extensions: 
    SilverStripe\BehatExtension\MinkExtension: 
     selenium2: 
     browser: firefox 
     # Add your own username and API token here 
     wd_host: http://<username>:<key>@hub.browserstack.com/wd/hub 
     browserstack-tunnel: true 

    SilverStripe\BehatExtension\Extension: ~ 

回答

2

要啓用的隧道,而在BrowserStack測試,你需要通過browserstack.tunnel能力作爲真正在你的能力清單。能否請您在behat.yml修改功能,如下所示:

default: 
     path: %paths.base%/features 
     context: Behat\MinkExtension\Context\MinkContext extensions: 
    Behat\MinkExtension\Extension: 
     selenium2: 
     wd_host: http://<USERNAME>:<KEY>@hub.browserstack.com/wd/hub 
     capabilities: 
      browser: chrome 
      browser_version: 29.0 
      os: Windows 
      os_version: 29.0 
      browserstack.tunnel: true 

另外,也有關於下列庫貝哈特與BrowserStack整合一些信息:https://github.com/browserstack/automate-php-samples