Class: APIPage

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL, NavigationBar, UserMenu
Defined in:
pages/APIPage.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

#initializeAPIPage

Returns a new instance of APIPage.


6
7
# File 'pages/APIPage.rb', line 6

def initialize
end

Instance Method Details

#generate_new_api_key(original_key) ⇒ Object


18
19
20
21
22
23
24
25
# File 'pages/APIPage.rb', line 18

def generate_new_api_key(original_key)
  click_link("Generate new API key")
  key = find(:id, "account_api_key").value
  until key != original_key
    key = find(:id, "account_api_key").value
  end
  $log.debug("New Key: #{key}")
end

#get_api_keyObject


9
10
11
12
13
14
15
16
# File 'pages/APIPage.rb', line 9

def get_api_key
  key = find(:id, "account_api_key").value
  unless key.nil?
    key = find(:id, "account_api_key").value
  end
  $log.debug("Current API Key:  #{key}")
  return key
end

#save_api_changesObject


27
28
29
# File 'pages/APIPage.rb', line 27

def save_api_changes
  find(:css, ".btn.btn-primary").click
end