Skip to content

Instantly share code, notes, and snippets.

@pablofmorales
Created March 7, 2013 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pablofmorales/5111270 to your computer and use it in GitHub Desktop.
Save pablofmorales/5111270 to your computer and use it in GitHub Desktop.
Watir example
require 'rspec'
require 'watir-webdriver'
browser = Watir::Browser.new
RSpec.configure do |config|
config.before(:each) { @browser = browser }
config.after(:suite) { browser.close unless browser.nil? }
end
describe "siteadmin login functionality" do
it "In Brazil in listing's section I want to find just 1 featured ads" do
@browser.goto("http://saopaulo.olx.com.br/animais-cat-811")
@browser.wait
@browser.ul(:id => 'featuredBlock').as.length.should be > 1
end
it "We need to content the featured ads call" do
@browser.goto("http://www.olx.com.mx/")
@browser.ul(:class => 'list-featured').as.length.should eq 6
end
it "In listing I want to find featured ads. Almost 1" do
@browser.goto("http://www.olx.com.mx/compra-venta-cat-185")
@browser.wait
@browser.ul(:class => "featured").as.length.should be > 1
@browser.close
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment