mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-23 18:50:12 +01:00
Added Rspec and Webrat plugins and started porting Selenium on Rails tests to Rspec Plain Text Stories driving Webrat driving Selenium.
This commit is contained in:
parent
0600756bbf
commit
0f7d6f7a1d
602 changed files with 47788 additions and 29 deletions
34
vendor/plugins/webrat/selenium_spike.rb
vendored
Normal file
34
vendor/plugins/webrat/selenium_spike.rb
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
require 'rubygems'
|
||||
require "lib/webrat"
|
||||
require "lib/webrat/selenium"
|
||||
require 'selenium'
|
||||
|
||||
include Webrat
|
||||
|
||||
# To try it out:
|
||||
#
|
||||
# Install the required gem
|
||||
# > sudo gem install Selenium
|
||||
#
|
||||
# Fire up the Selenium proxy server
|
||||
# > selenium
|
||||
#
|
||||
# Run this script
|
||||
# > ruby selenium_spike.rb
|
||||
|
||||
|
||||
@sel = Selenium::SeleniumDriver.new("localhost", 4444, "*chrome", "http://localhost", 15000)
|
||||
@sel.start
|
||||
|
||||
sess = SeleniumSession.new(@sel)
|
||||
sess.visits "http://www.google.com/"
|
||||
sess.fills_in "q", :with => "Webrat"
|
||||
sess.clicks_link 'Images'
|
||||
sess.clicks_button 'Search'
|
||||
sess.selects 'Small images', :from => 'imagesize'
|
||||
sess.clicks_link 'Preferences'
|
||||
sess.chooses 'Do not filter'
|
||||
sess.checks 'Open search results in a new browser window'
|
||||
sess.clicks_button
|
||||
sess.save_and_open_page
|
||||
@sel.stop
|
||||
Loading…
Add table
Add a link
Reference in a new issue