Sha256: 809ca24115726782f4b989c6dba59a4b6cb3bf5cc8cc8a877042881ecc191192

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

<%- if automation == 'sparkling_ios' -%>
require 'sparkling_watir/element'

class Page

  attr_reader :app

  def initialize(app)
    @app = app
  end

  def to_s
    self.class.to_s.sub('Page', ' Page')
  end
end
<%- else -%>
<%- if web? -%>
require_relative '../components/header'
<%- end -%>

class Page
<%- if automation == 'cross_platform' -%>
  include AppiumHelper
<%- 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) -%>

  def to_s
    self.class.to_s.sub('Page', ' Page')
  end

  <%- if automation == 'selenium'  -%>
  # Components

  def header
    Header.new(driver.find_element(id: 'customer_menu_top'))
  end
  <%- elsif automation == 'watir'  -%>
  # Components

  def header
    Header.new(browser.element(id: 'customer_menu_top'))
  end
  <%- end -%>
end
<%- end -%>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_raider-0.9.2 lib/generators/automation/templates/page.tt