lib/symbiont/enclosers.rb in symbiont-0.1.6 vs lib/symbiont/enclosers.rb in symbiont-0.1.7
- old
+ new
@@ -1,8 +1,24 @@
module Symbiont
module Enclosers
-
+
+ # Used to identify a web object or action on a web object as existing
+ # within an enclosing window object. The window can be referenced using
+ # either the title attribute of the window or a direct URL. The URL does
+ # not have to be the entire URL; it can just be a page name.
+ #
+ # @param [Hash] locator the :title or :url of the window
+ # @param [Proc; optional] block any code that should be executed as an
+ # action on or within the window
+ #
+ # @example
+ # page.within_window(title: "Report Page")
+ # page.within_window(url: report.html)
+ def within_window(locator, &block)
+ @platform.within_window(locator, &block)
+ end
+
# Used to identify a web object as existing within an enclosing object
# like a frame or an iframe. It is possible to nest by passing in parent
# enclosers as the second parameter.
#
# @param [String] locator how an encloser will be referenced; the
@@ -33,11 +49,11 @@
#
# @example
# @page.wait_for(5, 'page with expected title not found') do
# @page.title.should == "Test App"
# end
- def wait_for(message=nil, timeout=10, &block)
- @platform.wait_for(message, timeout, &block)
+ def wait_for(timeout=Symbiont.page_level_wait, message=nil, &block)
+ @platform.wait_for(timeout, message, &block)
end
# Provides a context for an action that will generate a JavaScript alert
# message box. The alert invocation will be overridden by the platform.
#