Module: BasePage

Included in:
CreatePage, UpdatePage, ViewPage
Defined in:
lib/leap_salesforce_ui/base_page.rb

Instance Method Summary collapse

Instance Method Details

#browserWatir::Browser

Returns:

  • (Watir::Browser)


7
8
9
# File 'lib/leap_salesforce_ui/base_page.rb', line 7

def browser
  LeapSalesforce.browser
end

#soql_object(soql_object) ⇒ Object

Set entity this page object refers to

Parameters:

  • soql_object (Class)

    Backend name of SoqlObject this page object refers to



13
14
15
# File 'lib/leap_salesforce_ui/base_page.rb', line 13

def soql_object(soql_object)
  @soql_object = soql_object
end

#visit(use_record_type: true) ⇒ Object

Visit the current page, logging in if required

Parameters:

  • use_record_type (Boolean) (defaults to: true)

    Whether to specify record type



19
20
21
22
23
24
25
26
# File 'lib/leap_salesforce_ui/base_page.rb', line 19

def visit(use_record_type: true)
  LoginPage.
  page_url = "#{SoqlHandler.instance_url}/lightning/o/#{@soql_object.soql_object_name}/new"
  page_url += '?useRecordTypeCheck=1' if use_record_type
  LeapSalesforce.logger.info "Visiting #{self}"
  browser.goto page_url
  self
end