module <%= name.split('_').map(&:capitalize).join %> class <%= klass.gsub('::', '') %> < Page::Base <% if url.empty? -%> # Define url represented by page object if appropriate # page_url { } <% else -%> <% if url =~ %r{^(about|data|https?):}i -%> page_url { "<%= url %>" } <% else -%> page_url { "#{Site.base_url}<%= url %>" } <% end -%> <% end -%> <% if elements.empty? -%> # Define elements representing contents of page <% end -%> # Specify full Watir locator inside block # element(:foo) { browser.div(id: 'foo') } <% elements.each do |element| -%> element(:<%= element %>) { } <% end -%> <% unless form.empty? -%> element(:submit) { browser.button(visible: true) } def submit_form(<%= form.downcase %> = nil) <%= form.downcase %> ||= Data::<%= form %>.new fill_form(<%= form.downcase %>) submit.click <%= form.downcase %> end <% end %> end end