Created
March 24, 2011 11:10
-
-
Save andreastt/884900 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'operawatir/helper' | |
describe 'Frames in Watir 3' do | |
it 'as a block' do | |
window.frame(:id => 'foo') do |frame| | |
frame.p(:id => 'bar').should include 'bar' | |
end | |
end | |
it 'as an object' do | |
frame = window.frame(:id => 'foo') | |
frame.p(:id => 'bar').should include 'bar' | |
end | |
it 'programmatically' do | |
window.frame(:id => 'foo').p(:id => 'bar').should include 'bar' | |
end | |
it 'listing frames' do | |
puts window.frame.to_s | |
end | |
it 'iterating over frames' do | |
window.frame.each_with_index do |name, index| | |
puts "frame index: #{i}, frame name: #{name}" | |
end | |
end | |
end | |
describe 'Frame in Watir 2' do | |
it 'switching focus' do | |
browser.frame(:id, 'foo') | |
browser.p(:id, 'bar').should include 'bar' | |
browser.switch_to_default | |
end | |
it 'listing frames' do | |
browser.show_frames | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment