percy-appium-app 0.0.8 → 0.0.9.beta0
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 +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +2 -2
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +1 -1
- data/README.md +1 -1
- data/percy/lib/app_percy.rb +6 -0
- data/percy/lib/cli_wrapper.rb +4 -3
- data/percy/metadata/android_metadata.rb +7 -2
- data/percy/providers/generic_provider.rb +4 -2
- data/percy/version.rb +1 -1
- data/specs/android_metadata.rb +20 -0
- data/specs/cli_wrapper.rb +5 -2
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc4c4c4f66c3a7ecfe019e07eef6a8dfdffd17d57935c12780b441388703a5af
|
4
|
+
data.tar.gz: 7ee0cd5c07b82d25a5718894fee9891bc612c02ed665cb34cf7f1e46d1fa95d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6e82f7ada4e367c5e74f24a8e9652619b581c3ec00076212ffbeced9e3f203928ad77cf067d0be3270fee228c734963bfbbf8ac5a3c0e6e9d7ad3fe6041aeed
|
7
|
+
data.tar.gz: f991caac478c3035ae723faf96fb0cc0010631de9832eb5976e6beb325861c52aaf5caa6db658e9d716fcfea2fd9199203fd15c894028e7526b79b8bfd107c11
|
@@ -11,7 +11,7 @@ assignees: ''
|
|
11
11
|
|
12
12
|
There are common setup gotchas that happen with Percy's SDKs, it would be worth reading
|
13
13
|
the debugging document, which might already answer your question:
|
14
|
-
https://
|
14
|
+
https://www.browserstack.com/docs/percy/integrate/percy-sdk-workflow#debugging-sdks
|
15
15
|
|
16
16
|
## Reach out to Percy support instead?
|
17
17
|
|
@@ -43,7 +43,7 @@ If necessary, describe the problem you have been experiencing in more detail.
|
|
43
43
|
## Debug logs
|
44
44
|
|
45
45
|
If you are reporting a bug, _always_ include logs! [Give the "Debugging SDKs"
|
46
|
-
document a quick read for how to gather logs](https://
|
46
|
+
document a quick read for how to gather logs](https://www.browserstack.com/docs/percy/integrate/percy-sdk-workflow#debugging-sdks)
|
47
47
|
|
48
48
|
Please do not trim or edit these logs, often times there are hints in the full
|
49
49
|
logs that help debug what is going on.
|
data/.github/workflows/test.yml
CHANGED
data/README.md
CHANGED
@@ -181,7 +181,7 @@ $ percy exec -- [ruby test command]
|
|
181
181
|
[percy] Done!
|
182
182
|
```
|
183
183
|
|
184
|
-
Refer to docs here: [Percy on Automate](https://
|
184
|
+
Refer to docs here: [Percy on Automate](https://www.browserstack.com/docs/percy/integrate/functional-and-visual)
|
185
185
|
|
186
186
|
### Migrating Config
|
187
187
|
|
data/percy/lib/app_percy.rb
CHANGED
@@ -54,6 +54,12 @@ module Percy
|
|
54
54
|
'Argument test_case should be a String'
|
55
55
|
end
|
56
56
|
|
57
|
+
labels = kwargs[:labels]
|
58
|
+
if labels && !labels.is_a?(String)
|
59
|
+
raise TypeError,
|
60
|
+
'Argument labels should be a String'
|
61
|
+
end
|
62
|
+
|
57
63
|
th_test_case_execution_id = kwargs[:th_test_case_execution_id]
|
58
64
|
if th_test_case_execution_id && !th_test_case_execution_id.is_a?(String)
|
59
65
|
raise TypeError,
|
data/percy/lib/cli_wrapper.rb
CHANGED
@@ -49,9 +49,9 @@ module Percy
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def post_screenshots(name, tag, tiles, external_debug_url = nil, ignored_elements_data = nil,
|
52
|
-
considered_elements_data = nil, sync = nil, test_case = nil, th_test_case_execution_id = nil)
|
52
|
+
considered_elements_data = nil, sync = nil, test_case = nil, labels = nil, th_test_case_execution_id = nil)
|
53
53
|
body = request_body(name, tag, tiles, external_debug_url, ignored_elements_data,
|
54
|
-
considered_elements_data, sync, test_case, th_test_case_execution_id)
|
54
|
+
considered_elements_data, sync, test_case, labels, th_test_case_execution_id)
|
55
55
|
body['client_info'] = Percy::Environment.get_client_info
|
56
56
|
body['environment_info'] = Percy::Environment.get_env_info
|
57
57
|
|
@@ -126,7 +126,7 @@ module Percy
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def request_body(name, tag, tiles, external_debug_url, ignored_elements_data, considered_elements_data, sync,
|
129
|
-
test_case, th_test_case_execution_id)
|
129
|
+
test_case, labels, th_test_case_execution_id)
|
130
130
|
tiles = tiles.map(&:to_h)
|
131
131
|
{
|
132
132
|
'name' => name,
|
@@ -137,6 +137,7 @@ module Percy
|
|
137
137
|
'considered_elements_data' => considered_elements_data,
|
138
138
|
'sync' => sync,
|
139
139
|
'test_case' => test_case,
|
140
|
+
'labels' => labels,
|
140
141
|
'th_test_case_execution_id' => th_test_case_execution_id
|
141
142
|
}
|
142
143
|
end
|
@@ -15,8 +15,13 @@ module Percy
|
|
15
15
|
def device_screen_size
|
16
16
|
caps = capabilities
|
17
17
|
caps = caps.as_json unless caps.is_a?(Hash)
|
18
|
-
|
19
|
-
|
18
|
+
if caps['deviceScreenSize'].nil?
|
19
|
+
size = driver.window_size
|
20
|
+
{ width: size.width.to_i, height: size.height.to_i }
|
21
|
+
else
|
22
|
+
width, height = caps['deviceScreenSize'].split('x')
|
23
|
+
{ width: width.to_i, height: height.to_i }
|
24
|
+
end
|
20
25
|
end
|
21
26
|
|
22
27
|
def get_system_bars
|
@@ -44,10 +44,11 @@ module Percy
|
|
44
44
|
}
|
45
45
|
sync = kwargs.fetch(:sync, nil)
|
46
46
|
test_case = kwargs.fetch(:test_case, nil)
|
47
|
+
labels = kwargs.fetch(:labels, nil)
|
47
48
|
th_test_case_execution_id = kwargs.fetch(:th_test_case_execution_id, nil)
|
48
49
|
|
49
50
|
_post_screenshots(name, tag, tiles, get_debug_url, ignore_regions, consider_regions,
|
50
|
-
sync, test_case, th_test_case_execution_id)
|
51
|
+
sync, test_case, labels, th_test_case_execution_id)
|
51
52
|
end
|
52
53
|
|
53
54
|
def _get_tag(**kwargs)
|
@@ -107,10 +108,11 @@ module Percy
|
|
107
108
|
considered_regions,
|
108
109
|
sync,
|
109
110
|
test_case,
|
111
|
+
labels,
|
110
112
|
th_test_case_execution_id
|
111
113
|
)
|
112
114
|
Percy::CLIWrapper.new.post_screenshots(
|
113
|
-
name, tag, tiles, debug_url, ignored_regions, considered_regions, sync, test_case, th_test_case_execution_id
|
115
|
+
name, tag, tiles, debug_url, ignored_regions, considered_regions, sync, test_case, labels, th_test_case_execution_id
|
114
116
|
)
|
115
117
|
end
|
116
118
|
|
data/percy/version.rb
CHANGED
data/specs/android_metadata.rb
CHANGED
@@ -29,7 +29,27 @@ class TestAndroidMetadata < Minitest::Test
|
|
29
29
|
@mock_webdriver.expect(:capabilities, android_capabilities.merge('viewportRect' => viewport))
|
30
30
|
|
31
31
|
assert(viewport, @android_metadata.viewport)
|
32
|
+
@mock_webdriver.verify
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_device_screen_size_when_device_screen_size_is_nil
|
36
|
+
# Mock capabilities to return a hash without 'deviceScreenSize'
|
37
|
+
android_capabilities = get_android_capabilities
|
38
|
+
android_capabilities.delete('deviceScreenSize')
|
39
|
+
@mock_webdriver.expect(:capabilities, android_capabilities)
|
40
|
+
|
41
|
+
# Mock driver.window_size to return a double with width and height
|
42
|
+
mock_window_size = Minitest::Mock.new
|
43
|
+
mock_window_size.expect(:width, 1080)
|
44
|
+
mock_window_size.expect(:height, 1920)
|
45
|
+
@mock_webdriver.expect(:window_size, mock_window_size)
|
46
|
+
|
47
|
+
# Call the method and assert the result
|
48
|
+
result = @android_metadata.device_screen_size
|
49
|
+
assert_equal({ width: 1080, height: 1920 }, result)
|
32
50
|
|
51
|
+
# Verify mocks
|
52
|
+
mock_window_size.verify
|
33
53
|
@mock_webdriver.verify
|
34
54
|
end
|
35
55
|
|
data/specs/cli_wrapper.rb
CHANGED
@@ -106,9 +106,10 @@ class TestCLIWrapper < Minitest::Test
|
|
106
106
|
debug_url = 'debug-url'
|
107
107
|
sync = false
|
108
108
|
test_case = 'test-case-1'
|
109
|
+
labels = 'app;testing'
|
109
110
|
th_test_case_execution_id = 'uuid-1231231'
|
110
111
|
response = @cli_wrapper.request_body(name, tag, [tile], debug_url, @ignored_elements_data,
|
111
|
-
@considered_elements_data, sync, test_case, th_test_case_execution_id)
|
112
|
+
@considered_elements_data, sync, test_case, labels, th_test_case_execution_id)
|
112
113
|
assert_equal response['name'], name
|
113
114
|
assert_equal response['external_debug_url'], debug_url
|
114
115
|
assert_equal response['tag'], tag
|
@@ -117,6 +118,7 @@ class TestCLIWrapper < Minitest::Test
|
|
117
118
|
assert_equal response['considered_elements_data'], @considered_elements_data
|
118
119
|
assert_equal response['sync'], sync
|
119
120
|
assert_equal response['test_case'], test_case
|
121
|
+
assert_equal response['labels'], labels
|
120
122
|
assert_equal response['th_test_case_execution_id'], th_test_case_execution_id
|
121
123
|
end
|
122
124
|
|
@@ -129,7 +131,7 @@ class TestCLIWrapper < Minitest::Test
|
|
129
131
|
considered_elements_data = nil
|
130
132
|
sync = nil
|
131
133
|
response = @cli_wrapper.send(:request_body, name, tag, [tile], debug_url, ignored_elements_data,
|
132
|
-
considered_elements_data, sync, nil, nil)
|
134
|
+
considered_elements_data, sync, nil, nil, nil)
|
133
135
|
assert_equal response['name'], name
|
134
136
|
assert_nil response['external_debug_url']
|
135
137
|
assert_equal response['tag'], tag
|
@@ -138,6 +140,7 @@ class TestCLIWrapper < Minitest::Test
|
|
138
140
|
assert_nil response['considered_elements_data']
|
139
141
|
assert_nil response['sync']
|
140
142
|
assert_nil response['test_case']
|
143
|
+
assert_nil response['labels']
|
141
144
|
assert_nil response['th_test_case_execution_id']
|
142
145
|
end
|
143
146
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: percy-appium-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9.beta0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BroswerStack
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: appium_lib
|
@@ -187,7 +186,6 @@ licenses:
|
|
187
186
|
metadata:
|
188
187
|
bug_tracker_uri: https://github.com/percy/percy-appium-ruby/issues
|
189
188
|
source_code_uri: https://github.com/percy/percy-appium-ruby
|
190
|
-
post_install_message:
|
191
189
|
rdoc_options: []
|
192
190
|
require_paths:
|
193
191
|
- percy
|
@@ -202,8 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
200
|
- !ruby/object:Gem::Version
|
203
201
|
version: '0'
|
204
202
|
requirements: []
|
205
|
-
rubygems_version: 3.
|
206
|
-
signing_key:
|
203
|
+
rubygems_version: 3.6.7
|
207
204
|
specification_version: 4
|
208
205
|
summary: Percy visual testing for Ruby Appium Mobile Apps
|
209
206
|
test_files: []
|