Skip to content

Instantly share code, notes, and snippets.

@andreastt
Created May 9, 2011 13:39
Show Gist options
  • Save andreastt/962531 to your computer and use it in GitHub Desktop.
Save andreastt/962531 to your computer and use it in GitHub Desktop.
require 'operawatir/helper'
describe 'OperaWatir' do
describe 'Browser' do
describe '#select_list' do
before :each do
browser.goto 'http://t/core/standards/wf1/interactive/button-type-reset-012.html'
@select_list = browser.select_list(:name, 'test')
@reset = browser.button(:name, 'reset')
end
it 'selects an option' do
@select_list.select 'bird'
@select_list.selected?('bird').should be_true
end
it 'selects multiple options' do
@select_list.select 'bird'
@select_list.select 'dog'
@select_list.selected?('bird').should be_true
@select_list.selected?('dog').should be_true
end
it 'selects options and resets form' do
@select_list.select 'bird'
@select_list.select 'dog'
@select_list.select 'fish'
@reset.click_no_wait
@select_list.selected?('cat').should be_true
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment