eyes_selenium 4.6.3 → 6.0.4

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.
@@ -1,54 +1,6 @@
1
+ require_relative 'ios_device_name_generated'
2
+
1
3
  module IosDeviceName
4
+ include IosDeviceNameGenerated
2
5
  extend self
3
- IPhone_14 = 'iPhone 14'
4
- IPhone_14_Pro_Max = 'iPhone 14 Pro Max'
5
- IPhone_13_Pro_Max = 'iPhone 13 Pro Max'
6
- IPhone_13_Pro = 'iPhone 13 Pro'
7
- IPhone_13 = 'iPhone 13'
8
- IPhone_12_Pro_Max = 'iPhone 12 Pro Max'
9
- IPhone_12_Pro = 'iPhone 12 Pro'
10
- IPhone_12 = 'iPhone 12'
11
- IPhone_12_mini = 'iPhone 12 mini'
12
- IPhone_11_Pro = 'iPhone 11 Pro'
13
- IPhone_11_Pro_Max = 'iPhone 11 Pro Max'
14
- IPhone_11 = 'iPhone 11'
15
- IPhone_XR = 'iPhone XR'
16
- IPhone_XS = 'iPhone Xs'
17
- IPhone_X = 'iPhone X'
18
- IPhone_8 = 'iPhone 8'
19
- IPhone_7 = 'iPhone 7'
20
- IPad_Pro_3 = 'iPad Pro (12.9-inch) (3rd generation)'
21
- IPad_7 = 'iPad (7th generation)'
22
- IPad_9 = 'iPad (9th generation)'
23
- IPad_Air_2 = 'iPad Air (2nd generation)'
24
- IPhone_8_Plus = 'iPhone 8 Plus'
25
- IPhone_SE = 'iPhone SE (1st generation)'
26
-
27
- def enum_values
28
- [
29
- IPhone_14,
30
- IPhone_14_Pro_Max,
31
- IPhone_13_Pro_Max,
32
- IPhone_13_Pro,
33
- IPhone_13,
34
- IPhone_12_Pro_Max,
35
- IPhone_12_Pro,
36
- IPhone_12,
37
- IPhone_12_mini,
38
- IPhone_11_Pro,
39
- IPhone_11_Pro_Max,
40
- IPhone_11,
41
- IPhone_XR,
42
- IPhone_XS,
43
- IPhone_X,
44
- IPhone_8,
45
- IPhone_7,
46
- IPad_Pro_3,
47
- IPad_7,
48
- IPad_9,
49
- IPad_Air_2,
50
- IPhone_8_Plus,
51
- IPhone_SE
52
- ]
53
- end
54
6
  end
@@ -0,0 +1,146 @@
1
+ # GENERATED FILE #
2
+
3
+ module IosDeviceNameGenerated
4
+ extend self
5
+ IPad_5 = 'iPad (5th generation)'.freeze
6
+ IPad_6 = 'iPad (6th generation)'.freeze
7
+ IPad_7 = 'iPad (7th generation)'.freeze
8
+ IPad_8 = 'iPad (8th generation)'.freeze
9
+ IPad_9 = 'iPad (9th generation)'.freeze
10
+ IPad_10 = 'iPad (10th generation)'.freeze
11
+ IPad_Air_2 = 'iPad Air 2'.freeze
12
+ IPad_Air_3 = 'iPad Air (3rd generation)'.freeze
13
+ IPad_Air_4 = 'iPad Air (4th generation)'.freeze
14
+ IPad_Air_5 = 'iPad Air (5th generation)'.freeze
15
+ IPad_mini_4 = 'iPad mini 4'.freeze
16
+ IPad_mini_5 = 'iPad mini (5th generation)'.freeze
17
+ IPad_mini_6 = 'iPad mini (6th generation)'.freeze
18
+ IPad_Pro_9_7_inch_1 = 'iPad Pro (9.7-inch)'.freeze
19
+ IPad_Pro_10_5_inch_1 = 'iPad Pro (10.5-inch)'.freeze
20
+ IPad_Pro_11_inch_1 = 'iPad Pro (11-inch) (1st generation)'.freeze
21
+ IPad_Pro_12_9_inch_1 = 'iPad Pro (12.9-inch) (1st generation)'.freeze
22
+ IPad_Pro_11_inch_2 = 'iPad Pro (11-inch) (2nd generation)'.freeze
23
+ IPad_Pro_12_9_inch_2 = 'iPad Pro (12.9-inch) (2nd generation)'.freeze
24
+ IPad_Pro_11_inch_3 = 'iPad Pro (11-inch) (3rd generation)'.freeze
25
+
26
+ # Deprecated: Use IosDeviceName::IPad_Pro_12_9_inch_3 instead.
27
+ # deprecate_constant :IPad_Pro_3 not allow to point to new version (
28
+ IPad_Pro_3 = 'iPad Pro (12.9-inch) (3rd generation)'.freeze
29
+ IPad_Pro_12_9_inch_3 = 'iPad Pro (12.9-inch) (3rd generation)'.freeze
30
+
31
+ # Deprecated: Use IosDeviceName::IPad_Pro_11_inch_4 instead.
32
+ # deprecate_constant :IPad_Pro_4 not allow to point to new version (
33
+ IPad_Pro_4 = 'iPad Pro (11-inch) (4th generation)'.freeze
34
+ IPad_Pro_11_inch_4 = 'iPad Pro (11-inch) (4th generation)'.freeze
35
+ IPad_Pro_12_9_inch_4 = 'iPad Pro (12.9-inch) (4th generation)'.freeze
36
+ IPad_Pro_12_9_inch_5 = 'iPad Pro (12.9-inch) (5th generation)'.freeze
37
+ IPad_Pro_12_9_inch_6 = 'iPad Pro (12.9-inch) (6th generation)'.freeze
38
+ IPhone_6s = 'iPhone 6s'.freeze
39
+ IPhone_6s_Plus = 'iPhone 6s Plus'.freeze
40
+ IPhone_7 = 'iPhone 7'.freeze
41
+ IPhone_7_Plus = 'iPhone 7 Plus'.freeze
42
+ IPhone_8 = 'iPhone 8'.freeze
43
+ IPhone_8_Plus = 'iPhone 8 Plus'.freeze
44
+ IPhone_X = 'iPhone X'.freeze
45
+ IPhone_XR = 'iPhone XR'.freeze
46
+
47
+ # Deprecated: Use IosDeviceName::IPhone_Xs instead.
48
+ # deprecate_constant :IPhone_XS not allow to point to new version (
49
+ IPhone_XS = 'iPhone Xs'.freeze
50
+ IPhone_Xs = 'iPhone Xs'.freeze
51
+ IPhone_Xs_Max = 'iPhone Xs Max'.freeze
52
+ IPhone_11 = 'iPhone 11'.freeze
53
+ IPhone_11_Pro_Max = 'iPhone 11 Pro Max'.freeze
54
+ IPhone_11_Pro = 'iPhone 11 Pro'.freeze
55
+ IPhone_12 = 'iPhone 12'.freeze
56
+ IPhone_12_mini = 'iPhone 12 mini'.freeze
57
+ IPhone_12_Pro_Max = 'iPhone 12 Pro Max'.freeze
58
+ IPhone_12_Pro = 'iPhone 12 Pro'.freeze
59
+ IPhone_13 = 'iPhone 13'.freeze
60
+ IPhone_13_mini = 'iPhone 13 mini'.freeze
61
+ IPhone_13_Pro_Max = 'iPhone 13 Pro Max'.freeze
62
+ IPhone_13_Pro = 'iPhone 13 Pro'.freeze
63
+ IPhone_14 = 'iPhone 14'.freeze
64
+ IPhone_14_Plus = 'iPhone 14 Plus'.freeze
65
+ IPhone_14_Pro = 'iPhone 14 Pro'.freeze
66
+ IPhone_14_Pro_Max = 'iPhone 14 Pro Max'.freeze
67
+ IPhone_15 = 'iPhone 15'.freeze
68
+ IPhone_15_Plus = 'iPhone 15 Plus'.freeze
69
+ IPhone_15_Pro = 'iPhone 15 Pro'.freeze
70
+ IPhone_15_Pro_Max = 'iPhone 15 Pro Max'.freeze
71
+
72
+ # Deprecated: Use IosDeviceName::IPhone_SE_1 instead.
73
+ # deprecate_constant :IPhone_SE not allow to point to new version (
74
+ IPhone_SE = 'iPhone SE (1st generation)'.freeze
75
+ IPhone_SE_1 = 'iPhone SE (1st generation)'.freeze
76
+ IPhone_SE_2 = 'iPhone SE (2nd generation)'.freeze
77
+ IPhone_SE_3 = 'iPhone SE (3rd generation)'.freeze
78
+ IPod_touch_7 = 'iPod touch (7th generation)'.freeze
79
+
80
+ def enum_values
81
+ [
82
+ IPad_5,
83
+ IPad_6,
84
+ IPad_7,
85
+ IPad_8,
86
+ IPad_9,
87
+ IPad_10,
88
+ IPad_Air_2,
89
+ IPad_Air_3,
90
+ IPad_Air_4,
91
+ IPad_Air_5,
92
+ IPad_mini_4,
93
+ IPad_mini_5,
94
+ IPad_mini_6,
95
+ IPad_Pro_9_7_inch_1,
96
+ IPad_Pro_10_5_inch_1,
97
+ IPad_Pro_11_inch_1,
98
+ IPad_Pro_12_9_inch_1,
99
+ IPad_Pro_11_inch_2,
100
+ IPad_Pro_12_9_inch_2,
101
+ IPad_Pro_11_inch_3,
102
+ IPad_Pro_3, # Deprecated: Use IosDeviceName::IPad_Pro_12_9_inch_3 instead.
103
+ IPad_Pro_12_9_inch_3,
104
+ IPad_Pro_4, # Deprecated: Use IosDeviceName::IPad_Pro_11_inch_4 instead.
105
+ IPad_Pro_11_inch_4,
106
+ IPad_Pro_12_9_inch_4,
107
+ IPad_Pro_12_9_inch_5,
108
+ IPad_Pro_12_9_inch_6,
109
+ IPhone_6s,
110
+ IPhone_6s_Plus,
111
+ IPhone_7,
112
+ IPhone_7_Plus,
113
+ IPhone_8,
114
+ IPhone_8_Plus,
115
+ IPhone_X,
116
+ IPhone_XR,
117
+ IPhone_XS, # Deprecated: Use IosDeviceName::IPhone_Xs instead.
118
+ IPhone_Xs,
119
+ IPhone_Xs_Max,
120
+ IPhone_11,
121
+ IPhone_11_Pro_Max,
122
+ IPhone_11_Pro,
123
+ IPhone_12,
124
+ IPhone_12_mini,
125
+ IPhone_12_Pro_Max,
126
+ IPhone_12_Pro,
127
+ IPhone_13,
128
+ IPhone_13_mini,
129
+ IPhone_13_Pro_Max,
130
+ IPhone_13_Pro,
131
+ IPhone_14,
132
+ IPhone_14_Plus,
133
+ IPhone_14_Pro,
134
+ IPhone_14_Pro_Max,
135
+ IPhone_15,
136
+ IPhone_15_Plus,
137
+ IPhone_15_Pro,
138
+ IPhone_15_Pro_Max,
139
+ IPhone_SE, # Deprecated: Use IosDeviceName::IPhone_SE_1 instead.
140
+ IPhone_SE_1,
141
+ IPhone_SE_2,
142
+ IPhone_SE_3,
143
+ IPod_touch_7,
144
+ ]
145
+ end
146
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'state_machine'
2
+ require 'state_machines'
3
3
  require 'digest'
4
4
  require 'applitools/selenium/visual_grid/render_task'
5
5
 
@@ -53,6 +53,13 @@ module Applitools
53
53
  self.utils = Applitools::Utils::EyesSeleniumUtils
54
54
  end
55
55
 
56
+ def self.environment_sdk
57
+ {
58
+ name: :eyes_selenium,
59
+ currentVersion: Applitools::EyesSelenium::VERSION
60
+ }
61
+ end
62
+
56
63
  def ensure_config
57
64
  self.config = Applitools::Selenium::Configuration.new
58
65
  self.send_dom = true
@@ -317,23 +324,26 @@ module Applitools
317
324
  end
318
325
 
319
326
  def close_async
320
- test_list.each(&:close)
327
+ # test_list.each(&:close)
328
+ close(false)
321
329
  end
322
330
 
323
331
  def close(throw_exception = true)
324
332
  logger.info "close(#{throw_exception})"
325
333
  logger.info 'Ending server session...'
326
334
 
335
+ raise Applitools::EyesNotOpenException.new 'Eyes not open' unless open?
327
336
  universal_results = universal_eyes.close # Array even for one test
328
- universal_results = universal_eyes.eyes_get_results # Array even for one test
329
- # require 'pry'
330
- # binding.pry
331
- raise Applitools::EyesError.new("Request failed: #{universal_results[:message]}") if server_error?(universal_results)
332
- key_transformed_results = Applitools::Utils.deep_stringify_keys(universal_results)
333
- results = key_transformed_results.map {|result| Applitools::TestResults.new(result) }
334
- # results = results.first if results.size == 1
335
- # session_results_url = results.url
336
- all_results = results.compact
337
+ self.opened = false
338
+ all_results = get_results(throw_exception)
339
+ # universal_results = universal_eyes.eyes_get_results # Array even for one test
340
+ # # require 'pry'
341
+ # # binding.pry
342
+ # raise Applitools::EyesError.new("Request failed: #{universal_results[:message]}") if server_error?(universal_results)
343
+ # results = universal_results.map {|result| Applitools::TestResults.new(result) }
344
+ # # results = results.first if results.size == 1
345
+ # # session_results_url = results.url
346
+ # all_results = results.compact
337
347
 
338
348
 
339
349
  # return false if test_list.empty?
@@ -351,7 +361,30 @@ module Applitools
351
361
  # end
352
362
  #
353
363
  # all_results = test_list.map(&:test_result).compact
354
- failed_results = all_results.select { |r| !r.as_expected? }
364
+ # failed_results = all_results.select { |r| !r.as_expected? }
365
+ #
366
+ # if throw_exception
367
+ # all_results.each do |r|
368
+ # raise Applitools::NewTestError.new new_test_error_message(r), r if r.new?
369
+ # raise Applitools::DiffsFoundError.new diffs_found_error_message(r), r if r.unresolved? && !r.new?
370
+ # raise Applitools::TestFailedError.new test_failed_error_message(r), r if r.failed?
371
+ # end
372
+ # end
373
+
374
+ # failed_results.empty? ? all_results.first : failed_results.first
375
+ all_results.first
376
+ end
377
+
378
+ def get_results(throw_exception = true)
379
+ logger.info "get_results(#{throw_exception})"
380
+ logger.info 'Getting results...'
381
+
382
+ universal_results = universal_eyes.eyes_get_results # Array even for one test
383
+ # require 'pry'
384
+ # binding.pry
385
+ raise Applitools::EyesError.new("Request failed: #{universal_results[:message]}") if server_error?(universal_results)
386
+ results = universal_results.map {|result| Applitools::TestResults.new(result) }
387
+ all_results = results.compact
355
388
 
356
389
  if throw_exception
357
390
  all_results.each do |r|
@@ -360,8 +393,7 @@ module Applitools
360
393
  raise Applitools::TestFailedError.new test_failed_error_message(r), r if r.failed?
361
394
  end
362
395
  end
363
-
364
- failed_results.empty? ? all_results.first : failed_results.first
396
+ all_results
365
397
  end
366
398
 
367
399
  def abort_async
data/lib/eyes_selenium.rb CHANGED
@@ -12,8 +12,11 @@ module Applitools
12
12
  module Selenium
13
13
  extend Applitools::RequireUtils
14
14
  class UnsupportedCoordinateType < EyesError; end
15
- def self.load_dir
16
- File.dirname(File.expand_path(__FILE__))
15
+ def self.require_dir(dir)
16
+ load_dir = File.dirname(File.expand_path(__FILE__))
17
+ Dir[File.join(load_dir, 'applitools', dir, '*.rb')].sort.each do |f|
18
+ require f
19
+ end
17
20
  end
18
21
  end
19
22
  end
@@ -21,6 +24,7 @@ end
21
24
  Applitools::Selenium.require_dir 'selenium/concerns'
22
25
  Applitools::Selenium.require_dir 'selenium/scripts'
23
26
  Applitools::Selenium.require_dir 'selenium'
27
+ Applitools::Selenium.require_dir 'eyes_selenium'
24
28
  Applitools::Selenium.require_dir 'selenium/visual_grid'
25
29
  Applitools::Selenium.require_dir 'selenium/dom_capture'
26
30
  Applitools::Selenium.require_dir 'selenium/css_parser'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyes_selenium
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.3
4
+ version: 6.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-05 00:00:00.000000000 Z
11
+ date: 2024-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eyes_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.6.3
19
+ version: 6.0.4
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: 4.6.3
26
+ version: 6.0.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: state_machine
70
+ name: state_machines
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -87,6 +87,10 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - CHANGELOG.md
91
+ - Rakefile
92
+ - eyes_selenium.gemspec
93
+ - lib/applitools/eyes_selenium/version.rb
90
94
  - lib/applitools/selenium/border_aware_element_content_location_provider.rb
91
95
  - lib/applitools/selenium/browser.rb
92
96
  - lib/applitools/selenium/browser_types.rb
@@ -98,6 +102,7 @@ files:
98
102
  - lib/applitools/selenium/css_transform/css_transform.rb
99
103
  - lib/applitools/selenium/css_translate_element_position_provider.rb
100
104
  - lib/applitools/selenium/css_translate_position_provider.rb
105
+ - lib/applitools/selenium/device_name_generated.rb
101
106
  - lib/applitools/selenium/devices.rb
102
107
  - lib/applitools/selenium/dom_capture/dom_capture.rb
103
108
  - lib/applitools/selenium/dom_capture/dom_capture_script.rb
@@ -127,7 +132,6 @@ files:
127
132
  - lib/applitools/selenium/scripts/.gitignore
128
133
  - lib/applitools/selenium/scripts/get_element_xpath.rb
129
134
  - lib/applitools/selenium/scripts/package.json
130
- - lib/applitools/selenium/scripts/templates.rb
131
135
  - lib/applitools/selenium/scroll_position_provider.rb
132
136
  - lib/applitools/selenium/selenium_eyes.rb
133
137
  - lib/applitools/selenium/stitch_modes.rb
@@ -138,6 +142,7 @@ files:
138
142
  - lib/applitools/selenium/viewport_size.rb
139
143
  - lib/applitools/selenium/visual_grid/android_device_info.rb
140
144
  - lib/applitools/selenium/visual_grid/android_device_name.rb
145
+ - lib/applitools/selenium/visual_grid/android_device_name_generated.rb
141
146
  - lib/applitools/selenium/visual_grid/chrome_emulation_info.rb
142
147
  - lib/applitools/selenium/visual_grid/desktop_browser_info.rb
143
148
  - lib/applitools/selenium/visual_grid/dom_snapshot_script.rb
@@ -146,6 +151,7 @@ files:
146
151
  - lib/applitools/selenium/visual_grid/i_render_browser_info.rb
147
152
  - lib/applitools/selenium/visual_grid/ios_device_info.rb
148
153
  - lib/applitools/selenium/visual_grid/ios_device_name.rb
154
+ - lib/applitools/selenium/visual_grid/ios_device_name_generated.rb
149
155
  - lib/applitools/selenium/visual_grid/render_browser_info.rb
150
156
  - lib/applitools/selenium/visual_grid/render_info.rb
151
157
  - lib/applitools/selenium/visual_grid/render_request.rb
@@ -161,7 +167,6 @@ files:
161
167
  - lib/applitools/selenium/visual_grid/visual_grid_eyes.rb
162
168
  - lib/applitools/selenium/visual_grid/visual_grid_runner.rb
163
169
  - lib/applitools/selenium/visual_grid/web_element_region.rb
164
- - lib/applitools/version.rb
165
170
  - lib/eyes_selenium.rb
166
171
  homepage: https://www.applitools.com
167
172
  licenses:
@@ -182,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
187
  - !ruby/object:Gem::Version
183
188
  version: '0'
184
189
  requirements: []
185
- rubygems_version: 3.3.14
190
+ rubygems_version: 3.0.3.1
186
191
  signing_key:
187
192
  specification_version: 4
188
193
  summary: Applitools Ruby Selenium SDK
@@ -1,34 +0,0 @@
1
- module Applitools
2
- module Selenium
3
- module ScriptTemplates
4
- extend self
5
- def get_script_by_file_name(fname)
6
- script = nil
7
- return script unless Dir.exist?(Applitools::JS_PATH)
8
- begin
9
- Dir.chdir(Applitools::JS_PATH) do
10
- script = File.open(File.join('@applitools', 'dom-snapshot', 'dist', "#{fname}.js"), 'r').read
11
- end
12
- rescue StandardError => e
13
- puts e.class
14
- puts e.message
15
- script = ''
16
- end
17
- script
18
- end
19
-
20
- # JS_FILES_PATH = File.join(Applitools::JS_PATH, '@applitools', 'dom-snapshot', 'dist')
21
- # PROCESS_PAGE_AND_POLL_RB = <<"SCRIPT"
22
- # module Applitools
23
- # module Selenium
24
- # module Scripts
25
- # PROCESS_PAGE_AND_POLL = <<'END'
26
- # #{get_script_by_file_name('processPageAndSerializePoll')}
27
- # END
28
- # end
29
- # end
30
- # end
31
- # SCRIPT
32
- end
33
- end
34
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: false
2
-
3
- module Applitools
4
- VERSION = '4.6.3'.freeze
5
- IMAGES_VERSION = '4.2.3'.freeze
6
- UNIVERSAL_VERSION = '3.3.3'.freeze
7
- UNIVERSAL_CORE_VERSION = '3.4.0'.freeze
8
- end