lib/page-object/platforms/watir/page_object.rb in page-object-0.2.4 vs lib/page-object/platforms/watir/page_object.rb in page-object-0.2.5
- old
+ new
@@ -81,12 +81,12 @@
#
# platform method to handle attaching to a running window
# See PageObject#attach_to_window
#
- def attach_to_window(identifier)
+ def attach_to_window(identifier, &block)
win_id = {identifier.keys.first => /#{Regexp.escape(identifier.values.first)}/}
- @browser.window(win_id).use
+ @browser.window(win_id).use &block
end
#
# platform method to refresh the page
# See PageObject#refresh