Module: Initialize

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#browserObject (readonly)

Returns the value of attribute browser.



4
5
6
# File 'lib/page_objects/modules/initialize.rb', line 4

def browser
  @browser
end

Instance Method Details

#clear_search_paramsObject



6
7
8
# File 'lib/page_objects/modules/initialize.rb', line 6

def clear_search_params
  DestinationServicesGUI::CONFIG[:search_params] = {}
end

#search_paramsObject



10
11
12
# File 'lib/page_objects/modules/initialize.rb', line 10

def search_params
  DestinationServicesGUI::CONFIG[:search_params]
end

#set_browser(browser) ⇒ Object



14
15
16
# File 'lib/page_objects/modules/initialize.rb', line 14

def set_browser(browser)
  DestinationServicesGUI::CONFIG[:browser] = browser
end


22
23
24
25
26
27
28
29
30
# File 'lib/page_objects/modules/initialize.rb', line 22

def set_cookie(data = {})
  if data.nil? || data.empty?
    raise('Cookies should have a name and value')
  end

  data.each do | key, value |
    browser.cookies.add(key.to_s, value.to_s, :path => '/')
  end
end