lib/symbiont/enclosers.rb in symbiont-0.1.0 vs lib/symbiont/enclosers.rb in symbiont-0.1.1

- old
+ new

@@ -20,7 +20,24 @@ encloser = [] if encloser.nil? encloser << locator block.call(encloser) end + # Provides a context for an action that must succeed within a given time period. + # The logic here is simply that the result of the action will be true (meaning + # the action was carried out) or false, which means the action did not succeed + # in the time allotted. + # + # @param [Integer] timeout the amount of time in seconds to wait + # @param [String] message the text to return if the action did not occur in time + # @param [Proc] block the code that calls the desired action + # + # @example + # @page.wait_for(5, 'page with expected title not found') do + # @page.title.should == "Test App" + # end + def wait_for(timeout=10, message=nil, &block) + @platform.wait_for(timeout, message, &block) + end + end # module: Enclosers end # module: Symbiont