lib/symbiont/evaluators.rb in symbiont-0.1.9 vs lib/symbiont/evaluators.rb in symbiont-0.2.0

- old
+ new

@@ -1,51 +1,80 @@ module Symbiont module Evaluators - + + ## Browser-Level Actions ## + def visit(url) platform.visit(url) end - - def text - platform.text - end - - def markup - platform.markup - end - - alias_method :html, :markup - - def title - platform.title - end - + + alias_method :navigate_to, :visit + def url platform.url end - + + alias_method :current_url, :url + # Save a snapshot of the current screen to a provided file location. # The file will be saved as a PNG file in the path specified or in the # location where the tests are being run from. def screenshot(file) platform.screenshot file - end - - def focus - platform.focus end - alias_method :what_has_focus?, :focus + alias_method :save_screenshot, :screenshot # Executes JavaScript against the browser instance. def run_script(script) platform.run_script(script) end - + alias_method :execute_script, :run_script def back platform.back + end + + def forward + platform.forward + end + + def refresh + platform.refresh + end + + def remove_cookies + platform.remove_cookies + end + + alias_method :clear_cookies, :remove_cookies + + ## Page-Level Actions ## + + def text + platform.text + end + + def markup + platform.markup + end + + alias_method :html, :markup + + def title + platform.title + end + + # Returns the element on a page that has the focus. + def focus + platform.focus + end + + alias_method :what_has_focus?, :focus + + def wait_for_app(value=1) + sleep value end # Provides an evaluator that attempts to wait for any pending AJAX # requests from the jQuery library. def wait_for_pending_requests(time_limit=30, message_if_timeout=nil)