Module: Calabash::Cucumber::Location

Includes:
Core
Included in:
Operations
Defined in:
lib/calabash-cucumber/location.rb

Constant Summary

Constants included from Core

Core::CAL_HTTP_RETRY_COUNT, Core::DATA_PATH, Core::RETRYABLE_ERRORS

Instance Method Summary collapse

Methods included from Core

#backdoor, #background, #calabash_exit, #cell_swipe, #client_version, #current_rotation, #default_device, #flash, #http, #init_request, #interpolate, #load_playback_data, #load_recording, #macro, #make_http_request, #map, #move_wheel, #perform, #picker, #pinch, #playback, #prepare_dialog_action, #query, #query_all, #record_begin, #record_end, #recording_name_for, #rotate, #scroll, #scroll_to_cell, #scroll_to_row, #scroll_to_row_with_mark, #send_uia_command, #server_version, #start_test_server_in_background, #stop_test_server, #swipe, #touch, #url_for

Instance Method Details

#location_for_place(place) ⇒ Object


20
21
22
# File 'lib/calabash-cucumber/location.rb', line 20

def location_for_place(place)
   LocationOne::Client.location_by_place place
end

#set_location(options) ⇒ Object


9
10
11
12
13
14
15
16
17
18
# File 'lib/calabash-cucumber/location.rb', line 9

def set_location(options)
  uri = url_for('uia')
  client = LocationOne::Client.new({:host => uri.host, :port => uri.port, :path => '/uia'}, @http)
  res = client.change_location(options)
  res = JSON.parse(res)
  if res['outcome'] != 'SUCCESS'
    screenshot_and_raise "set_location #{options}, failed because: #{res['reason']}\n#{res['details']}"
  end
  res['results']
end