test_object_test_result_watcher 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2079657ee2f3dbee40731e322860bbda4d4c710a
|
4
|
+
data.tar.gz: b43a21343390d0835f2f14329a1ec4db74aaffb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ca543f96dab0e2623b1750e36c3b05d524d558315e446c586d21854b70416c9691171f39e9ad5707b7da2a688d6336bd5b41fd563cb405b48d4674683acd697
|
7
|
+
data.tar.gz: 2f3f7f84c0afa2cd005f79f54382015eeb513255b1b42ac1f0769df4541820476ab6c0a0a9b11b5c29489bfb2d3c03037dc1fa636dc5795c9d0566d88d977c33
|
data/lib/appium_resource.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module AppiumResource
|
2
|
-
def
|
3
|
-
client.build_path(
|
2
|
+
def self.update_test_report_status(session_id, passed, client)
|
3
|
+
client.build_path(session_id)
|
4
4
|
client.put_test_outcome(passed)
|
5
5
|
end
|
6
|
-
end
|
6
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
require 'httparty'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
class
|
4
|
+
class TestObjectRestClient
|
5
|
+
|
5
6
|
def initialize(parameters)
|
6
7
|
@api_url = parameters[:api_url]
|
7
8
|
@api_key = parameters[:api_key]
|
@@ -16,10 +17,11 @@ class RestClient
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def basic_authorization
|
19
|
-
{username: @api_key, password:
|
20
|
+
{ username: @api_key, password: '' }
|
20
21
|
end
|
21
22
|
|
22
23
|
def headers
|
23
|
-
{
|
24
|
+
{ 'Content-Type' => 'application/json' }
|
24
25
|
end
|
25
|
-
|
26
|
+
|
27
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'json'
|
2
|
-
require_relative '
|
3
|
-
require_relative '
|
2
|
+
require_relative 'appium_resource.rb'
|
3
|
+
require_relative 'test_object_rest_client'
|
4
4
|
|
5
5
|
class TestObjectTestResultWatcher
|
6
6
|
|
@@ -8,31 +8,22 @@ class TestObjectTestResultWatcher
|
|
8
8
|
@desired_capabilities = desired_capabilities
|
9
9
|
@driver = driver
|
10
10
|
@report_results = @desired_capabilities[:caps][:testobject_report_results]
|
11
|
-
if @report_results
|
12
|
-
set_client
|
13
|
-
end
|
11
|
+
set_client if @report_results
|
14
12
|
end
|
15
13
|
|
16
14
|
def set_client
|
17
|
-
|
18
|
-
base_url = base_url(@desired_capabilities[:appium_lib][:server_url])
|
15
|
+
rest_api_url = 'https://app.testobject.com/api/rest/v2/appium/'
|
19
16
|
testobject_api_key = @desired_capabilities[:caps][:testobject_api_key]
|
20
|
-
|
21
|
-
@client = RestClient.new(api_url: api_url, api_key: testobject_api_key)
|
22
|
-
end
|
23
|
-
|
24
|
-
def base_url(server_url)
|
25
|
-
server_url.match(/^https?:\/\/(www.)?\S+.com(:\d+)?/)[0]
|
17
|
+
@client = TestObjectRestClient.new(api_url: rest_api_url, api_key: testobject_api_key)
|
26
18
|
end
|
27
19
|
|
28
20
|
def report_results_and_cleanup(passed)
|
29
|
-
if @report_results
|
30
|
-
report_results(passed)
|
31
|
-
end
|
21
|
+
report_results(passed) if @report_results
|
32
22
|
@driver.quit
|
33
23
|
end
|
34
24
|
|
35
25
|
def report_results(passed)
|
36
26
|
AppiumResource.update_test_report_status(@driver.session_id, passed, @client)
|
37
27
|
end
|
38
|
-
|
28
|
+
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_object_test_result_watcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TestObject
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -31,7 +31,7 @@ extensions: []
|
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
33
|
- lib/appium_resource.rb
|
34
|
-
- lib/
|
34
|
+
- lib/test_object_rest_client.rb
|
35
35
|
- lib/test_object_test_result_watcher.rb
|
36
36
|
homepage: http://www.testobject.com
|
37
37
|
licenses: []
|