Sha256: 2feeae9dbef4b210e66b5fb9ff3ceb9c1cd58ab3e935b87077683c2e84feff8a
Contents?: true
Size: 768 Bytes
Versions: 35
Compression:
Stored size: 768 Bytes
Contents
require 'spec/expectations' require 'selenium' class GoogleSearch def initialize(browser) @browser = browser end def goto @browser.open 'http://www.google.com/' end def search(text) @browser.type('q',text) @browser.click 'btnG' @browser.wait_for_page_to_load end end Before do @browser = Selenium::SeleniumDriver.new("localhost", 4444, "*chrome", "http://localhost", 15000) @browser.start end After do @browser.stop end Given 'I am on the Google search page' do @page = GoogleSearch.new(@browser) @page.goto end When /I search for "(.*)"/ do |query| @page.search(query) end Then /I should see a link to (.*)/ do |expected_url| @browser.is_element_present("css=a[href='#{expected_url}']").should be_true end
Version data entries
35 entries across 35 versions & 3 rubygems