Skip to content

Instantly share code, notes, and snippets.

@andreastt
Created May 11, 2011 15:48
Show Gist options
  • Save andreastt/966721 to your computer and use it in GitHub Desktop.
Save andreastt/966721 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'operawatir'
describe OperaWatir do
before(:all) do
OperaWatir.api = 3
@browser = OperaWatir::Browser.new
@browser.url = 'http://people.opera.com/weic/temp/wml.wml'
@window = @browser.active_window
end
shared_examples_for 'a title' do
it { should_not be_empty }
it { should_not be_kind_of(NilClass) }
it { should be_kind_of(String) }
it { should include 'Test' }
end
describe 'Collection' do
describe '#attr' do
subject { @window.card.attr(:title) }
it_behaves_like 'a title'
end
describe '#title' do
subject { @window.card.title }
it_behaves_like 'a title'
end
end
describe 'Window' do
describe '#title' do
subject { @window.title }
it_behaves_like 'a title'
end
end
describe 'Browser' do
describe '#driver' do
describe '#findElementsByTagName' do
describe '#getAttribute' do
subject { @browser.driver.findElementsByTagName('card').first.getAttribute('title') }
it_behaves_like 'a title'
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment