Skip to content

Instantly share code, notes, and snippets.

View alisterscott's full-sized avatar

Alister Scott alisterscott

View GitHub Profile
@alisterscott
alisterscott / block_suggestion.rb
Created May 31, 2012 23:41 — forked from natritmeyer/block_suggestion.rb
Page Object Management blog post material
visit LoginPage do |page|
page.login_with('foo', 'badpass')
page.text.should include "Login error"
page.text.should include "Secure your account"
end
@alisterscott
alisterscott / bench.rb
Created September 15, 2011 20:00 — forked from jarib/bench.rb
require 'selenium-webdriver'
require "benchmark"
profile = Selenium::WebDriver::Firefox::Profile.new
profile.native_events = false
d = Selenium::WebDriver.for :firefox, :profile => profile
d.navigate.to "file:///#{Dir.pwd}/test.html"
e = d.find_element(:id => "q")
@alisterscott
alisterscott / bench.rb
Created September 15, 2011 10:08 — forked from jarib/bench.rb
require 'selenium-webdriver'
require "benchmark"
d = Selenium::WebDriver.for :firefox
d.navigate.to "file:///#{Dir.pwd}/test.html"
e = d.find_element(:id => "q")
TESTS = 30
Benchmark.bmbm do |results|
results.report("clear + send_keys:") { TESTS.times {
require 'rubygems'
require 'watir-webdriver' # gem install watir-webdriver
require 'rspec' # gem install rspec
class BrowserContainer
attr_reader :browser
def initialize(browser)
@browser = browser
end