percy-appium-app 0.0.4 → 0.0.5.pre.beta.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7a335595865863cc2116b953c51d39b8665116c6f05589273f3211e4bf5fef8
4
- data.tar.gz: 468688dfe18390bb7068e8fa479e5e9a7ff7b739ef5759e2ddc1a5641c9a59c1
3
+ metadata.gz: 95d930f3f4b90c28a7e8af3101514fe4036a802444958fbb782681b2cae72a27
4
+ data.tar.gz: 24422fc182be9e140a616a5278d15eb0a72aef54afc70149539a8fcf1ea77710
5
5
  SHA512:
6
- metadata.gz: b9beee657ec15a65ee967f60295dac3d5caebc8f6355c5ee1f026dc2faba2056a7ccade079a88f0d81c51d3efeada4b178ac249415cb5fb7ee26f38c05dc2995
7
- data.tar.gz: 3ba4e693b137e7d84109408d22b7ff6372f888a6b30ef4295a9a61974d8f674d746e8989209c4c7eb887a524b866a0be0810fb10ebf120f430ac10ffecb256d3
6
+ metadata.gz: 95b945769e577c60b2aef7bb4fd41760d1a59190eeba35cefd3c26c1007e27a33023d0d46e5e4ff85380edc3da6dfb9eb002f037a292eb7bd44d9cd06bfce288
7
+ data.tar.gz: 6fd233b31b4d5947160a45bae6ad41224b93a94fb87896856e090530ebd95eaca9db8b0311ed0263d0749533258a1891abcb7154e6b81b4a0600ad47fc3825f3
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ Gemfile.lock
data/Gemfile CHANGED
@@ -3,7 +3,7 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gem 'appium_console'
6
- gem 'appium_lib'
6
+ gem 'appium_lib', '>= 11.2.0'
7
7
  gem 'dotenv'
8
8
  gem 'minitest'
9
9
  gem 'rubocop', require: false
data/percy/lib/cache.rb CHANGED
@@ -50,5 +50,10 @@ module Percy
50
50
 
51
51
  session_ids.each { |session_id| @@cache.delete(session_id) }
52
52
  end
53
+
54
+ # Added only for tests
55
+ def self.force_cleanup_cache
56
+ @@cache = {}
57
+ end
53
58
  end
54
59
  end
@@ -45,7 +45,7 @@ module Percy
45
45
  def get_window_size
46
46
  @_window_size = Percy::Cache.get_cache(session_id, Percy::Cache::WINDOW_SIZE)
47
47
  unless @_window_size
48
- @_window_size = driver.get_window_size
48
+ @_window_size = driver.window_size
49
49
  Percy::Cache.set_cache(session_id, Percy::Cache::WINDOW_SIZE, @_window_size)
50
50
  end
51
51
  @_window_size
data/percy/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Percy
4
- VERSION = '0.0.4'.freeze
4
+ VERSION = '0.0.5-beta.1'.freeze
5
5
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
26
26
  spec.require_paths = ['percy']
27
27
 
28
- spec.add_runtime_dependency 'appium_lib', '~> 12.0'
28
+ spec.add_runtime_dependency 'appium_lib', '>= 11.2.0'
29
29
  spec.add_runtime_dependency 'dotenv', '~> 2.8'
30
30
 
31
31
  spec.add_development_dependency 'bundler', '~> 2.4'
data/specs/cli_wrapper.rb CHANGED
@@ -104,14 +104,16 @@ class TestCLIWrapper < Minitest::Test
104
104
  tag = { 'name' => 'Tag' }
105
105
  name = 'some-name'
106
106
  debug_url = 'debug-url'
107
+ sync = false
107
108
  response = @cli_wrapper.request_body(name, tag, [tile], debug_url, @ignored_elements_data,
108
- @considered_elements_data)
109
+ @considered_elements_data, sync)
109
110
  assert_equal response['name'], name
110
111
  assert_equal response['external_debug_url'], debug_url
111
112
  assert_equal response['tag'], tag
112
113
  assert_equal response['tiles'], [tile.to_h]
113
114
  assert_equal response['ignored_elements_data'], @ignored_elements_data
114
115
  assert_equal response['considered_elements_data'], @considered_elements_data
116
+ assert_equal response['sync'], sync
115
117
  end
116
118
 
117
119
  def test_request_body_when_optional_values_are_null
@@ -121,13 +123,15 @@ class TestCLIWrapper < Minitest::Test
121
123
  debug_url = nil
122
124
  ignored_elements_data = nil
123
125
  considered_elements_data = nil
126
+ sync = nil
124
127
  response = @cli_wrapper.send(:request_body, name, tag, [tile], debug_url, ignored_elements_data,
125
- considered_elements_data)
128
+ considered_elements_data, sync)
126
129
  assert_equal response['name'], name
127
130
  assert_equal response['external_debug_url'], debug_url
128
131
  assert_equal response['tag'], tag
129
132
  assert_equal response['tiles'], [tile.to_h]
130
133
  assert_nil response['ignored_elements_data']
131
134
  assert_nil response['considered_elements_data']
135
+ assert_nil response['sync']
132
136
  end
133
137
  end
@@ -15,6 +15,7 @@ class TestGenericProvider < Minitest::Test
15
15
 
16
16
  def setup
17
17
  @existing_dir = 'existing-dir'
18
+ teardown
18
19
  Dir.mkdir(@existing_dir)
19
20
 
20
21
  @mock_webdriver = Minitest::Mock.new
@@ -33,7 +34,9 @@ class TestGenericProvider < Minitest::Test
33
34
  end
34
35
 
35
36
  def teardown
36
- FileUtils.remove_entry_secure(@existing_dir)
37
+ if Dir.exist?(@existing_dir)
38
+ FileUtils.remove_dir(@existing_dir, force: true)
39
+ end
37
40
  end
38
41
 
39
42
  def test_get_dir_without_env_variable
@@ -37,7 +37,7 @@ class TestIOSMetadata < Minitest::Test
37
37
  height = 100
38
38
  width = 100
39
39
  window_size = { 'height' => height, 'width' => width }
40
- @mock_webdriver.expect(:get_window_size, window_size)
40
+ @mock_webdriver.expect(:window_size, window_size)
41
41
  session_id = 'session_id_123'
42
42
  @mock_webdriver.expect(:session_id, session_id)
43
43
  @mock_webdriver.expect(:session_id, session_id)
@@ -48,12 +48,13 @@ class TestIOSMetadata < Minitest::Test
48
48
  end
49
49
 
50
50
  def test_device_screen_size
51
+ Percy::Cache.force_cleanup_cache
51
52
  session_id = 'session_id_123'
52
53
  5.times do
53
54
  @mock_webdriver.expect(:session_id, session_id)
54
55
  end
55
56
  @mock_webdriver.expect(:capabilities, { 'deviceName' => 'iPhone 6' })
56
- @mock_webdriver.expect(:get_window_size, { 'height' => 100, 'width' => 100 })
57
+ @mock_webdriver.expect(:window_size, { 'height' => 100, 'width' => 100 })
57
58
  device_screen_size = @ios_metadata.device_screen_size
58
59
  assert_equal({ 'height' => 200, 'width' => 200 }, device_screen_size)
59
60
  end
@@ -80,7 +81,7 @@ class TestIOSMetadata < Minitest::Test
80
81
  @mock_webdriver.expect(:session_id, session_id)
81
82
  end
82
83
  @mock_webdriver.expect(:capabilities, { 'deviceName' => 'iPhone 14' })
83
- @mock_webdriver.expect(:get_window_size, window_size)
84
+ @mock_webdriver.expect(:window_size, window_size)
84
85
  @mock_webdriver.expect(:execute_script, { 'height' => 100, 'width' => 200 }, ['mobile: viewportRect'])
85
86
 
86
87
  assert_equal(2, @ios_metadata.scale_factor)
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percy-appium-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5.pre.beta.1
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-13 00:00:00.000000000 Z
11
+ date: 2024-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appium_lib
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '12.0'
19
+ version: 11.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '12.0'
26
+ version: 11.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dotenv
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -137,6 +137,7 @@ files:
137
137
  - ".github/workflows/release.yml"
138
138
  - ".github/workflows/stale.yml"
139
139
  - ".github/workflows/test.yml"
140
+ - ".gitignore"
140
141
  - Gemfile
141
142
  - LICENSE
142
143
  - Makefile
@@ -197,9 +198,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
198
  version: 2.6.0
198
199
  required_rubygems_version: !ruby/object:Gem::Requirement
199
200
  requirements:
200
- - - ">="
201
+ - - ">"
201
202
  - !ruby/object:Gem::Version
202
- version: '0'
203
+ version: 1.3.1
203
204
  requirements: []
204
205
  rubygems_version: 3.1.6
205
206
  signing_key: