Class: WdaClient
- Inherits:
-
Object
- Object
- WdaClient
- Includes:
- Homescreen, Screenshot, Sessions, Source, Status
- Defined in:
- lib/wda_client.rb,
lib/wda_client/source.rb,
lib/wda_client/status.rb,
lib/wda_client/version.rb,
lib/wda_client/sessions.rb,
lib/wda_client/homescreen.rb,
lib/wda_client/screenshot.rb
Defined Under Namespace
Modules: Homescreen, Screenshot, Sessions, Source, Status
Constant Summary collapse
- BASE_URL =
'http://localhost:8100'- VERSION =
'0.2.0'
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#capabilities ⇒ Object
Returns the value of attribute capabilities.
-
#desired_capabilities ⇒ Object
Returns the value of attribute desired_capabilities.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #generate_base_req(method:, url_path:) ⇒ Object
-
#initialize(desired_capabilities:, base_url: BASE_URL) ⇒ WdaClient
constructor
A new instance of WdaClient.
Methods included from Homescreen
Methods included from Source
Methods included from Screenshot
Methods included from Sessions
#close, #get_current_session, #install
Methods included from Status
Constructor Details
#initialize(desired_capabilities:, base_url: BASE_URL) ⇒ WdaClient
Returns a new instance of WdaClient.
23 24 25 26 27 28 29 |
# File 'lib/wda_client.rb', line 23 def initialize(desired_capabilities:, base_url: BASE_URL) @desired_capabilities = parse(desired_capabilities) @base_url = URI.parse(base_url) @capabilities = nil @session_id = nil @status = 0 end |
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
19 20 21 |
# File 'lib/wda_client.rb', line 19 def base_url @base_url end |
#capabilities ⇒ Object
Returns the value of attribute capabilities.
18 19 20 |
# File 'lib/wda_client.rb', line 18 def capabilities @capabilities end |
#desired_capabilities ⇒ Object
Returns the value of attribute desired_capabilities.
18 19 20 |
# File 'lib/wda_client.rb', line 18 def desired_capabilities @desired_capabilities end |
#session_id ⇒ Object
Returns the value of attribute session_id.
18 19 20 |
# File 'lib/wda_client.rb', line 18 def session_id @session_id end |
#status ⇒ Object
Returns the value of attribute status.
18 19 20 |
# File 'lib/wda_client.rb', line 18 def status @status end |
Instance Method Details
#generate_base_req(method:, url_path:) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/wda_client.rb', line 31 def generate_base_req(method:, url_path:) req = case method when :get Net::HTTP::Get.new(url_path) when :post Net::HTTP::Post.new(url_path) when :delete Net::HTTP::Delete.new(url_path) else # no method end req['Content-Type'] = 'application/json' req end |