Created
July 7, 2011 15:58
-
-
Save DimaSamodurov/1069837 to your computer and use it in GitHub Desktop.
Check if Capybara opens firefox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# Upgrading ruby or firefox selenium tests stopped working. | |
# Use selenium-webdriver >= 0.2.2 with ruby 1.9.2 and Firefox 5. | |
require "rubygems" | |
require "capybara/dsl" | |
class Test | |
include Capybara::DSL | |
Capybara.run_server = false | |
Capybara.register_driver :selenium_firefox do |app| | |
Capybara::Selenium::Driver.new(app, :browser => :firefox, :profile => ENV["firefox_profile"]) | |
end | |
Capybara.current_driver = :selenium_firefox | |
Capybara.app_host = "http://www.simpletest.org/" | |
def run | |
visit("/"); | |
puts page.has_content?("Familiar with unit testing") | |
click_on("JUnit") | |
puts page.has_content?("Welcome to JUnit.org!") | |
puts page.driver.browser.navigate.back | |
puts page.has_content?("Familiar with unit testing") | |
end | |
end | |
Test.new.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment