J'essaie d'exécuter des tests d'acceptation pour le code javascript. Cependant, quand j'ai essayé d'utiliser Capybara avec Sélénium, je continué à obtenir les éléments suivants:Selenium :: WebDriver :: Error :: WebDriverError:
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:1234, CTRL+C to stop
FF>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:1234, CTRL+C to stop
F
Failures:
1) end to end acceptance test shows that x wins when it does
Failure/Error: @application.start
Selenium::WebDriver::Error::WebDriverError:
Unable to find the chromedriver executable. Please download the server from http://code.google.com/p/chromedriver/downloads/list and place it somewhere on your PATH. More info at http://code.google.com/p/selenium/wiki/ChromeDriver.>> Thin web server (v1.3.1 codename Triple Espresso)
# ./spec/acceptance/application_driver.rb:24:in `start'
# ./spec/acceptance/end_to_end.rb:6:in `block (2 levels) in <top (required)>'
Le code ci-dessous est ce qui est censé démarrer le pilote. J'ai téléchargé le fichier approprié à partir de http://code.google.com/p/chromedriver/downloads/list et je l'ai placé dans mon chemin en exécutant PATH = $ PATH:/répertoire/où/chromedriver/existe et exporter PATH, et l'a rendu exécutable, mais toujours eu l'erreur. Y a-t-il quelque chose qui me manque?
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
Capybara.default_driver = :chrome
class TicTacToeApplicationDriver
include Capybara::DSL
include Capybara::RSpecMatchers
APPLICATION_PORT = 1234
def initialize
@application_server = ApplicationServer.new
end
def start
@application_server.start
visit "http://localhost:#{APPLICATION_PORT}/index.html"
end
Merci, votre réponse m'a aidé à me diriger dans la bonne direction. Cela a résolu le problème: http://stackoverflow.com/a/10010381/1089462 – Ectac