2014-09-11 2 views
0

나는 프로 블룸을 가지고 있으며 어디에서 왔는지 정말로 알지 못합니다. 내가 behat, 셀레늄과 goutte 테스트를 할 사용하고 있습니다."연결을 열 수 없습니다"behat and selenium

내 behat.yml :

default: 
    paths: 
    features: features 
    bootstrap: %behat.paths.features%/bootstrap 
    extensions: 
    Behat\MinkExtension\Extension: 
     goutte: ~ 
     selenium2: ~ 

나는 간단한 시나리오가 있습니다

@javascript 
    Scenario: Searching for "test" 
    Given I go to "https://www.google.fr" 
    When I fill in "q" with "test" 
    And I press "btnG" 
    Then I should see "speedtest" 

나는 그것을 실행

, 내 파이어 폭스 브라우저가 개방되어 있지만, 아무것도 일어나지 않습니다. 결과는 다음과 같습니다.

@javascript 
    Scenario: Searching for "test"   # features/test.feature:7 
    Given I go to "https://www.google.fr" # FeatureContext::visit() 
     Could not open connection 
    When I fill in "q" with "test"  # FeatureContext::fillField() 
    And I press "btnG"     # FeatureContext::pressButton() 
    Then I should see "speedtest" 

"javascript"를 제거하면 모든 것이 정상적으로 실행되므로 이상합니다. 그래서 내 문제는 파이어 폭스에서 온 것 같아. 또한 열리는 Firefox 브라우저는 "일반"브라우저가 아닙니다 (문자는 작음).

은 당신이 나를 도와 주실 수 있습니까? :)

+2

을 firefox 32 + selenium 2.38은 함께 플레이하지 않지만 셀렌 2.43으로 업데이트하면 모두 잘됩니다. – rivimey

+0

그게 효과가 있어요. 고마워요 !! – JulienBlc

답변

1

Firefox에 이상한 문제가있어서 Chrome으로 전환하여 내 문제를 해결했습니다. Chrome driver을 다운로드해야합니다.

behat.yml 나는이 패키지 usign있어

default: 
    context: 
     class: 'FeatureContext' 
    extensions: 
     Behat\Symfony2Extension\Extension: 
      mink_driver: true 
      kernel: 
       env: test 
       debug: true 
     Behat\MinkExtension\Extension: 
      base_url: 'http://localhost/local/sport/web/app_test.php/' 
      browser_name: 'chrome' 
      goutte: ~ 
      selenium2: ~ 
    paths: 
     features: 'src/Football/TeamBundle/Features' 
     bootstrap: %behat.paths.features%/Context 

:

"require-dev": { 
    "behat/behat": "2.5.*@stable", 
    "behat/behat-bundle": "1.0.0", 
    "behat/symfony2-extension": "1.1.2", 
    "behat/mink": "1.5.0", 
    "behat/mink-extension": "~1.3", 
    "behat/mink-selenium2-driver": "1.1.1", 
    "behat/mink-goutte-driver": "1.0.9", 
    "phing/phing": "2.8.2" 
}, 

근무 특징 : 난 그냥 것으로 나타났습니다

Feature: I say hello 

@javascript 
Scenario: I say hello here 
When I go to '/' 
Then I fill in "text_hello" with "Hello"