unittests/wait_test.rb in commonwatir-1.7.0.rc1 vs unittests/wait_test.rb in commonwatir-1.7.0
- old
+ new
@@ -73,10 +73,17 @@
def test_when_present_exceptions
assert_raises(NoMethodError) {browser.div(:id => "div1").when_present(0.1).non_existing_method}
assert_raises(Watir::Wait::TimeoutError) {browser.div(:id => "non-existing").when_present(0.1).text}
end
+ def test_when_present_element_id
+ browser.link(:id => "link1").click
+ div = browser.div(:id => "div1")
+ assert_equal "div1", div.when_present(2).id
+ assert div.visible?
+ end
+
def test_wait_until_present
browser.link(:id => "link1").click
div = browser.div(:id => "div1")
browser.link(:id => "link1").click
@@ -114,6 +121,6 @@
browser.link(:id => "link1").click
Watir::Wait.while(2) {div.visible?}
assert !div.visible?
end
-end
\ No newline at end of file
+end