lib/pagetience/platforms/page-object-gem.rb in pagetience-0.2.0 vs lib/pagetience/platforms/page-object-gem.rb in pagetience-0.2.1

- old
+ new

@@ -14,12 +14,15 @@ @page_object_instance = klazz @browser = @page_object_instance.browser end - def platform_initialize + def platform_initialize(args=[]) + @page_object_instance.class.send(:define_method, :visit) do + args[0] || false + end @page_object_instance.instance_eval do - PageObject.instance_method(:initialize).bind(self).call(@browser) + PageObject.instance_method(:initialize).bind(self).call(@browser, visit) end end def underlying_element_for(sym) @page_object_instance.send("#{sym}_element").element \ No newline at end of file