percy-appium-app 0.0.5.pre.beta.1 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/percy/providers/generic_provider.rb +5 -3
- data/percy/version.rb +1 -1
- data/specs/generic_providers.rb +21 -12
- data/specs/screenshot.rb +4 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b85f47e434a501c80e0bf46e7c32699099517b75a6db8c63ce3b50887a68cea5
|
4
|
+
data.tar.gz: 405d12bc2a4d8369821b2828ef408f6266fe4c644d5c111028cd18670facefc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 336482f05ae03ca94a8afd4d7f770f9df9c2279b70a84be32c4d1c7a201830cef8b8dbadf8c6a3ead2732838adc6bb8b34a49adc1de1b2635bc93325f9b1cb90
|
7
|
+
data.tar.gz: 2fd10faace0a45f16470860f8945d39ab8c1a789453779cc8f8bede44492567c1665f726d06aad856984cc10875c370f6146e2d53a7097e5f80343a7d3db6ee9
|
data/.github/workflows/test.yml
CHANGED
@@ -37,4 +37,4 @@ jobs:
|
|
37
37
|
key: v1/${{ runner.os }}/ruby-${{ matrix.ruby }}/${{ hashFiles('**/Gemfile.lock') }}
|
38
38
|
restore-keys: v1/${{ runner.os }}/ruby-${{ matrix.ruby }}/
|
39
39
|
- run: bundle install
|
40
|
-
- run: for file in specs/*.rb; do ruby $file; done
|
40
|
+
- run: for file in specs/*.rb; do echo $file; bundle exec ruby $file; done
|
@@ -106,8 +106,8 @@ module Percy
|
|
106
106
|
|
107
107
|
def get_region_object(selector, element)
|
108
108
|
scale_factor = metadata.scale_factor
|
109
|
-
location =
|
110
|
-
size =
|
109
|
+
location = { 'x' => element.location.x, 'y' => element.location.y }
|
110
|
+
size = { 'height' => element.size.height, 'width' => element.size.width }
|
111
111
|
coordinates = {
|
112
112
|
'top' => location['y'] * scale_factor,
|
113
113
|
'bottom' => (location['y'] + size['height']) * scale_factor,
|
@@ -133,7 +133,9 @@ module Percy
|
|
133
133
|
|
134
134
|
def get_regions_by_ids(elements_array, ids)
|
135
135
|
ids.each do |id|
|
136
|
-
|
136
|
+
# Appium::Core::Base::SearchContext::FINDERS[:xpath] returns `accessibility id`
|
137
|
+
# instead of `:accessibility_id`, causes error
|
138
|
+
element = driver.find_element(:accessibility_id, id)
|
137
139
|
selector = "id: #{id}"
|
138
140
|
region = get_region_object(selector, element)
|
139
141
|
elements_array << region
|
data/percy/version.rb
CHANGED
data/specs/generic_providers.rb
CHANGED
@@ -233,8 +233,10 @@ class TestGenericProvider < Minitest::Test
|
|
233
233
|
|
234
234
|
def test_get_region_object
|
235
235
|
mock_element = Minitest::Mock.new
|
236
|
-
|
237
|
-
|
236
|
+
2.times do
|
237
|
+
mock_element.expect(:location, Selenium::WebDriver::Point.new(10, 20))
|
238
|
+
mock_element.expect(:size, Selenium::WebDriver::Dimension.new(100, 200))
|
239
|
+
end
|
238
240
|
|
239
241
|
result = @generic_provider.get_region_object('my-selector', mock_element)
|
240
242
|
expected_result = {
|
@@ -248,8 +250,10 @@ class TestGenericProvider < Minitest::Test
|
|
248
250
|
|
249
251
|
def test_get_regions_by_xpath
|
250
252
|
mock_element = Minitest::Mock.new
|
251
|
-
|
252
|
-
|
253
|
+
2.times do
|
254
|
+
mock_element.expect(:location, Selenium::WebDriver::Point.new(10, 20))
|
255
|
+
mock_element.expect(:size, Selenium::WebDriver::Dimension.new(100, 200))
|
256
|
+
end
|
253
257
|
|
254
258
|
@mock_webdriver.expect(:find_element, mock_element,
|
255
259
|
[Appium::Core::Base::SearchContext::FINDERS[:xpath], '//path/to/element'])
|
@@ -279,11 +283,12 @@ class TestGenericProvider < Minitest::Test
|
|
279
283
|
|
280
284
|
def test_get_regions_by_ids
|
281
285
|
mock_element = Minitest::Mock.new
|
282
|
-
|
283
|
-
|
286
|
+
2.times do
|
287
|
+
mock_element.expect(:location, Selenium::WebDriver::Point.new(10, 20))
|
288
|
+
mock_element.expect(:size, Selenium::WebDriver::Dimension.new(100, 200))
|
289
|
+
end
|
284
290
|
|
285
|
-
@mock_webdriver.expect(:find_element, mock_element,
|
286
|
-
[Appium::Core::Base::SearchContext::FINDERS[:accessibility_id], 'some_id'])
|
291
|
+
@mock_webdriver.expect(:find_element, mock_element, [:accessibility_id, 'some_id'])
|
287
292
|
|
288
293
|
elements_array = []
|
289
294
|
ids = ['some_id']
|
@@ -299,8 +304,10 @@ class TestGenericProvider < Minitest::Test
|
|
299
304
|
|
300
305
|
def test_get_regions_by_ids_with_non_existing_element
|
301
306
|
mock_element = Minitest::Mock.new
|
302
|
-
|
303
|
-
|
307
|
+
2.times do
|
308
|
+
mock_element.expect(:location, Selenium::WebDriver::Point.new(10, 20))
|
309
|
+
mock_element.expect(:size, Selenium::WebDriver::Dimension.new(100, 200))
|
310
|
+
end
|
304
311
|
|
305
312
|
@mock_webdriver.expect(:find_element, [Appium::Core::Base::SearchContext::FINDERS[:accessibility_id], 'id1']) do
|
306
313
|
raise Appium::Core::Error::NoSuchElementError, 'Test error'
|
@@ -315,8 +322,10 @@ class TestGenericProvider < Minitest::Test
|
|
315
322
|
|
316
323
|
def test_get_regions_by_elements
|
317
324
|
mock_element = Minitest::Mock.new
|
318
|
-
|
319
|
-
|
325
|
+
2.times do
|
326
|
+
mock_element.expect(:location, Selenium::WebDriver::Point.new(10, 20))
|
327
|
+
mock_element.expect(:size, Selenium::WebDriver::Dimension.new(100, 200))
|
328
|
+
end
|
320
329
|
mock_element.expect(:attribute, 'textView', ['class'])
|
321
330
|
|
322
331
|
elements_array = []
|
data/specs/screenshot.rb
CHANGED
@@ -339,8 +339,10 @@ class TestPercyScreenshot < Minitest::Test
|
|
339
339
|
mock_screenshot
|
340
340
|
|
341
341
|
mock_element = Minitest::Mock.new
|
342
|
-
|
343
|
-
|
342
|
+
2.times do
|
343
|
+
mock_element.expect(:location, Selenium::WebDriver::Point.new(10, 20))
|
344
|
+
mock_element.expect(:size, Selenium::WebDriver::Dimension.new(200, 400))
|
345
|
+
end
|
344
346
|
|
345
347
|
xpaths = ['//path/to/element']
|
346
348
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BroswerStack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appium_lib
|
@@ -198,9 +198,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
198
198
|
version: 2.6.0
|
199
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
200
|
requirements:
|
201
|
-
- - "
|
201
|
+
- - ">="
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
version:
|
203
|
+
version: '0'
|
204
204
|
requirements: []
|
205
205
|
rubygems_version: 3.1.6
|
206
206
|
signing_key:
|