unittests/frame_test.rb in watir-3.0.0.rc2 vs unittests/frame_test.rb in watir-3.0.0.rc3
- old
+ new
@@ -9,30 +9,30 @@
def setup
goto_page "frame_buttons.html"
end
def test_frame_no_what
- assert_raises(UnknownObjectException) { browser.frame(:name => "missingFrame").button(:id, "b2").enabled? }
+ assert_raises(UnknownFrameException) { browser.frame(:name => "missingFrame").html }
assert_raises(UnknownObjectException) { browser.frame(:name => "buttonFrame2").button(:id, "b2").enabled? }
assert(browser.frame(:name => "buttonFrame").button(:id, "b2").enabled?)
assert_false(browser.frame(:name => "buttonFrame").button(:caption, "Disabled Button").enabled?)
end
def test_frame_using_name
- assert_raises(UnknownObjectException) { browser.frame(:name, "missingFrame").button(:id, "b2").enabled? }
+ assert_raises(UnknownFrameException) { browser.frame(:name, "missingFrame").html }
assert_raises(UnknownObjectException) { browser.frame(:name, "buttonFrame2").button(:id, "b2").enabled? }
assert(browser.frame(:name, "buttonFrame").button(:id, "b2").enabled?)
assert_false(browser.frame(:name, "buttonFrame").button(:caption, "Disabled Button").enabled?)
end
def test_frame_using_name_and_regexp
- assert_raises(UnknownObjectException) { browser.frame(:name, /missingFrame/).button(:id, "b2").enabled? }
+ assert_raises(UnknownFrameException) { browser.frame(:name, /missingFrame/).button(:id, "b2").enabled? }
assert(browser.frame(:name, /button/).button(:id, "b2").enabled?)
end
def test_frame_using_index
- assert_raises(UnknownObjectException) { browser.frame(:index, 7).button(:id, "b2").enabled? }
+ assert_raises(UnknownFrameException) { browser.frame(:index, 7).button(:id, "b2").enabled? }
assert_raises(UnknownObjectException) { browser.frame(:index, 1).button(:id, "b2").enabled? }
assert(browser.frame(:index, 0 ).button(:id, "b2").enabled?)
assert_false(browser.frame(:index, 0).button(:caption, "Disabled Button").enabled?)
assert_equal('blankpage.html', browser.frame(:index, 1).src)
end
@@ -56,15 +56,15 @@
def setup
goto_page "frame_multi.html"
end
def test_frame_with_no_name
- assert_raises(UnknownObjectException) { browser.frame(:name, "missingFrame").button(:id, "b2").enabled? }
+ assert_raises(UnknownFrameException) { browser.frame(:name, "missingFrame").button(:id, "b2").enabled? }
end
def test_frame_by_id
- assert_raises(UnknownObjectException) { browser.frame(:id, "missingFrame").button(:id, "b2").enabled? }
+ assert_raises(UnknownFrameException) { browser.frame(:id, "missingFrame").button(:id, "b2").enabled? }
assert(browser.frame(:id, 'first_frame').button(:id, "b2").enabled?)
end
def test_frame_by_src
assert(browser.frame(:src, /pass/).button(:value, 'Close Window').exists?)
@@ -78,12 +78,12 @@
def setup
goto_page "nestedFrames.html"
end
def test_frame
- assert_raises(UnknownObjectException) { browser.frame(:name => "missingFrame").button(:id, "b2").enabled? }
- assert_raises(UnknownObjectException) { browser.frame(:name => "nestedFrame").frame(:name => "subFrame").button(:id, "b2").enabled? }
+ assert_raises(UnknownFrameException) { browser.frame(:name => "missingFrame").button(:id, "b2").enabled? }
+ assert_raises(UnknownFrameException) { browser.frame(:name => "nestedFrame").frame(:name => "subFrame").button(:id, "b2").enabled? }
assert(browser.frame(:name => "nestedFrame").frame(:name => "senderFrame").button(:name, "sendIt").enabled?)
browser.frame(:name => "nestedFrame").frame(:name => "senderFrame").text_field(:index, "0").set("Hello")
browser.frame(:name => "nestedFrame").frame(:name => "senderFrame").button(:name, "sendIt").click
assert(browser.frame(:name => "nestedFrame").frame(:name => "receiverFrame").text_field(:name, "receiverText").verify_contains("Hello"))
end
@@ -106,50 +106,9 @@
def test_iframes_id
browser.frame(:id, "sf").text_field(:name, "textToSend").set( "Hello World")
browser.frame(:id, "sf").button(:name, 'sendIt').click
assert( browser.frame(:name => "receiverFrame").text_field(:name, "receiverText").verify_contains("Hello World") )
- end
-
-end
-
-class TC_show_frames < Test::Unit::TestCase
- include CaptureIOHelper
-
- def capture_and_compare(page, expected)
- goto_page page
- actual = capture_stdout { browser.showFrames }
- assert_equal(expected, actual)
- end
-
- tag_method :test_show_nested_frames, :fails_on_firefox
-
- def test_show_nested_frames
- capture_and_compare("nestedFrames.html", <<END_OF_MESSAGE)
-there are 2 frames
-frame index: 1 name: nestedFrame
-frame index: 2 name: nestedFrame2
-END_OF_MESSAGE
- end
-
- tag_method :test_button_frames, :fails_on_firefox
-
- def test_button_frames
- capture_and_compare("frame_buttons.html", <<END_OF_MESSAGE)
-there are 2 frames
-frame index: 1 name: buttonFrame
-frame index: 2 name: buttonFrame2
-END_OF_MESSAGE
- end
-
- tag_method :test_iframes, :fails_on_firefox
-
- def test_iframes
- capture_and_compare("iframeTest.html", <<END_OF_MESSAGE)
-there are 2 frames
-frame index: 1 name: senderFrame
-frame index: 2 name: receiverFrame
-END_OF_MESSAGE
end
end
class TC_Frames_click_no_wait < Test::Unit::TestCase