Class: PoliciesPage

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL, NavigationBar, UserMenu
Defined in:
pages/PoliciesPage.rb

Instance Method Summary collapse

Methods included from NavigationBar

#go_to_home, select_from_menuName_menu, select_menu

Methods included from UserMenu

#log_out, #select_revert_to_admin

Constructor Details

#initializePoliciesPage

Returns a new instance of PoliciesPage.


6
7
8
9
# File 'pages/PoliciesPage.rb', line 6

def initialize
  @policy_table = {"selector" => :xpath, "value" => ".//*[@class='table table-hover with-border-top']/tbody"}
  super
end

Instance Method Details

#click_policy_by_name(name) ⇒ Object


11
12
13
14
15
16
# File 'pages/PoliciesPage.rb', line 11

def click_policy_by_name (name)
  within(@policy_table['selector'], @policy_table['value']) do
    policy_name = "//div[@id='main-content']//td[normalize-space(.)='#{name}']"
    find(:xpath, policy_name).click
  end
end