lib/generators/automation/templates/abstract_page.tt in ruby_raider-0.7.9 vs lib/generators/automation/templates/abstract_page.tt in ruby_raider-0.8.0
- old
+ new
@@ -12,17 +12,35 @@
def to_s
self.class.to_s.sub('Page', ' Page')
end
end
<%- else -%>
+<% if web? -%>
+require_relative '../components/header'
+<% end -%>
+
class AbstractPage
-<% if automation == 'cross_platform' -%>
+
+<%- if automation == 'cross_platform' -%>
include AppiumHelper
-<% end -%>
+<%- end -%>
<%= ERB.new(File.read(File.expand_path('./partials/initialize_selector.tt', __dir__))).result(binding) -%>
<%= ERB.new(File.read(File.expand_path('./partials/visit_method.tt', __dir__))).result(binding) -%>
<%= ERB.new(File.read(File.expand_path('./partials/url_methods.tt', __dir__))).result(binding) -%>
+<%- if automation == 'selenium' -%>
+ # Components
+
+ def header
+ Header.new(driver.find_element(id: 'customernav'))
+ end
+<%- elsif automation == 'watir' -%>
+ # Components
+
+ def header
+ Header.new(browser.element(id: 'customernav'))
+ end
+<%- end -%>
def to_s
self.class.to_s.sub('Page', ' Page')
end
end
<%- end -%>
\ No newline at end of file