eyes_selenium 3.18.4 → 4.0.0

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
  SHA1:
3
- metadata.gz: add9ab19983a8d0449be20f28a07b8a22b8b106a
4
- data.tar.gz: 1a1c144870e1f7c9c73c63364cf302edbd9d1dcc
3
+ metadata.gz: 6113bd2ae73e1528d34e7baa3b214229c4b8a769
4
+ data.tar.gz: 6125a07ef83c8ab83fa807ca8c9d23b60df8ee34
5
5
  SHA512:
6
- metadata.gz: 446c252c892baf365cc228ae32261ebd67d6c0ca1af31e7c7d61a784c7f736d92b6cb268ae9f9802af0989f7f1c03aa644f00f9f5d17a839f5a151cd75c64f09
7
- data.tar.gz: a952962907a6045f27e39e09821800f8c88b3973481ef7e71ffb20fdc8f8495d9857a00e7c188693d79f0f3d0645cb07996f44920af12102242751e6dce086a7
6
+ metadata.gz: 1f0dae57a3d2970bd92d04bfc8f07937ce53dbe76797da7e27481a9cfaa5597957d7722eea7a1ecaf860dbf0e9f70d17db5a67cac108a253d8b27c1a9c04c3fa
7
+ data.tar.gz: 4aa3ec4b57e6b645ecfcffcb45d24dc083d7b8c6b3c2dd498d1970a85eef33624b903ad4194b8773b984ad217ddf7108a91f8b02b4c493e6f36dfb47b511dbc8
@@ -12,21 +12,21 @@ module BrowserTypes
12
12
  end
13
13
  module BrowserType
14
14
  extend self
15
- CHROME = :'chrome-0'
16
- CHROME_ONE_VERSION_BACK = :'chrome-1'
17
- CHROME_TWO_VERSIONS_BACK = :'chrome-2'
15
+ CHROME = :'chrome'
16
+ CHROME_ONE_VERSION_BACK = :'chrome-one-version-back'
17
+ CHROME_TWO_VERSIONS_BACK = :'chrome-two-versions-back'
18
18
 
19
- FIREFOX = :'firefox-0'
20
- FIREFOX_ONE_VERSION_BACK = :'firefox-1'
21
- FIREFOX_TWO_VERSIONS_BACK = :'firefox-2'
19
+ FIREFOX = :'firefox'
20
+ FIREFOX_ONE_VERSION_BACK = :'firefox-one-version-back'
21
+ FIREFOX_TWO_VERSIONS_BACK = :'firefox-two-versions-back'
22
22
 
23
- SAFARI = :'safari-0'
24
- SAFARI_ONE_VERSION_BACK = :'safari-1'
25
- SAFARI_TWO_VERSIONS_BACK = :'safari-2'
23
+ SAFARI = :'safari'
24
+ SAFARI_ONE_VERSION_BACK = :'safari-one-version-back'
25
+ SAFARI_TWO_VERSIONS_BACK = :'safari-two-versions-back'
26
26
  IOS_SAFARI = :safari
27
27
 
28
28
  EDGE_CHROMIUM = :'edgechromium'
29
- EDGE_CHROMIUM_ONE_VERSION_BACK = :'edgechromium-1'
29
+ EDGE_CHROMIUM_ONE_VERSION_BACK = :'edgechromium-one-version-back'
30
30
 
31
31
  IE_11 = :ie
32
32
  EDGE_LEGACY = :edgelegacy
@@ -21,6 +21,14 @@ module Applitools
21
21
  end
22
22
  yield(default)
23
23
  end
24
+
25
+ def to_hash
26
+ return nil if empty?
27
+ map(&:to_hash)
28
+ # require 'pry'
29
+ # binding.pry
30
+ end
31
+
24
32
  end
25
33
  end
26
34
  end
@@ -50,12 +50,8 @@ module Applitools
50
50
  fully = args.select { |a| a.is_a?(TrueClass) || a.is_a?(FalseClass) }.first
51
51
  target = Applitools::Selenium::Target.window.tap do |t|
52
52
  t.timeout(match_timeout || USE_DEFAULT_MATCH_TIMEOUT)
53
- if is_a?(Applitools::Selenium::VisualGridEyes)
54
- t.fully(true)
55
- else
56
- t.fully(force_full_page_screenshot)
57
- end
58
- t.fully(fully) unless fully.nil?
53
+ # fully = force_full_page_screenshot if fully.nil?
54
+ t.fully(fully) if !fully.nil?
59
55
  end
60
56
  check(tag, target)
61
57
  end
@@ -10,7 +10,7 @@ module Applitools
10
10
  {
11
11
  force_full_page_screenshot: false,
12
12
  wait_before_screenshots: 0.1,
13
- stitch_mode: Applitools::Selenium::StitchModes::CSS,
13
+ # stitch_mode: Applitools::Selenium::StitchModes::CSS,
14
14
  hide_scrollbars: true,
15
15
  hide_caret: false,
16
16
  browsers_info: Applitools::Selenium::BrowsersInfo.new,
@@ -1,45 +1,136 @@
1
1
  # frozen_string_literal: false
2
2
  module Devices
3
3
  extend self
4
+ BlackberryPlayBook = 'Blackberry PlayBook'.freeze
5
+ BlackBerryZ30 = 'BlackBerry Z30'.freeze
6
+ GalaxyA5 = 'Galaxy A5'.freeze
7
+ GalaxyNote10 = 'Galaxy Note 10'.freeze
8
+ GalaxyNote10Plus = 'Galaxy Note 10 Plus'.freeze
9
+ GalaxyNote2 = 'Galaxy Note 2'.freeze
10
+ GalaxyNote3 = 'Galaxy Note 3'.freeze
11
+ GalaxyNote4 = 'Galaxy Note 4'.freeze
12
+ GalaxyNote8 = 'Galaxy Note 8'.freeze
13
+ GalaxyNote9 = 'Galaxy Note 9'.freeze
14
+ GalaxyS3 = 'Galaxy S3'.freeze
15
+ GalaxyS5 = 'Galaxy S5'.freeze
16
+ GalaxyS8 = 'Galaxy S8'.freeze
17
+ GalaxyS8Plus = 'Galaxy S8 Plus'.freeze
18
+ GalaxyS9 = 'Galaxy S9'.freeze
19
+ GalaxyS9Plus = 'Galaxy S9 Plus'.freeze
20
+ GalaxyS10 = 'Galaxy S10'.freeze
21
+ GalaxyS10Plus = 'Galaxy S10 Plus'.freeze
22
+ GalaxyS20 = 'Galaxy S20'.freeze
23
+ IPad = 'iPad'.freeze
24
+ IPad6thGen = 'iPad 6th Gen'.freeze
25
+ IPad7thGen = 'iPad 7th Gen'.freeze
26
+ IPadAir2 = 'iPad Air 2'.freeze
27
+ IPadMini = 'iPad Mini'.freeze
28
+ IPadPro = 'iPad Pro'.freeze
29
+ IPhone11 = 'iPhone 11'.freeze
30
+ IPhone11Pro = 'iPhone 11 Pro'.freeze
31
+ IPhone11ProMax = 'iPhone 11 Pro Max'.freeze
4
32
  IPhone4 = 'iPhone 4'.freeze
5
33
  IPhone5SE = 'iPhone 5/SE'.freeze
6
34
  IPhone678 = 'iPhone 6/7/8'.freeze
7
35
  IPhone678Plus = 'iPhone 6/7/8 Plus'.freeze
8
36
  IPhoneX = 'iPhone X'.freeze
9
- IPad = 'iPad'.freeze
10
- IPadPro = 'iPad Pro'.freeze
11
- BlackBerryZ30 = 'BlackBerry Z30'.freeze
37
+ IPhoneXR = 'iPhone XR'.freeze
38
+ IPhoneXS = 'iPhone XS'.freeze
39
+ IPhoneXSMax = 'iPhone XS Max'.freeze
40
+ KindleFireHDX = 'Kindle Fire HDX'.freeze
41
+ LaptopWithHIDPIScreen = 'Laptop with HiDPI screen'.freeze
42
+ LaptopWithMDPIScreen = 'Laptop with MDPI screen'.freeze
43
+ LaptopWithTouch = 'Laptop with touch'.freeze
44
+ LGG6 = 'LG G6'.freeze
45
+ LGOptimusL70 = 'LG Optimus L70'.freeze
46
+ MicrosoftLumia550 = 'Microsoft Lumia 550'.freeze
47
+ MicrosoftLumia950 = 'Microsoft Lumia 950'.freeze
48
+ Nexus10 = 'Nexus 10'.freeze
12
49
  Nexus4 = 'Nexus 4'.freeze
13
50
  Nexus5 = 'Nexus 5'.freeze
14
51
  Nexus5X = 'Nexus 5X'.freeze
15
52
  Nexus6 = 'Nexus 6'.freeze
16
53
  Nexus6P = 'Nexus 6P'.freeze
54
+ Nexus7 = 'Nexus 7'.freeze
55
+
56
+ NokiaLumia520 = 'Nokia Lumia 520'.freeze
57
+ NokiaN9 = 'Nokia N9'.freeze
58
+ OnePlus7T = 'OnePlus 7T'.freeze
59
+ OnePlus7TPro = 'OnePlus 7T Pro'.freeze
60
+ # OnePlus8 = 'OnePlus 8'.freeze
61
+ # OnePlus8Pro = 'OnePlus 8 Pro'.freeze
17
62
  Pixel2 = 'Pixel 2'.freeze
18
63
  Pixel2XL = 'Pixel 2 XL'.freeze
19
- LGOptimusL70 = 'LG Optimus L70'.freeze
20
- NokiaN9 = 'Nokia N9'.freeze
21
- NokiaLumia520 = 'Nokia Lumia 520'.freeze
22
- MicrosoftLumia550 = 'Microsoft Lumia 550'.freeze
23
- MicrosoftLumia950 = 'Microsoft Lumia 950'.freeze
24
- GalaxyS3 = 'Galaxy S III'.freeze
25
- GalaxyS5 = 'Galaxy S5'.freeze
26
- KindleFireHDX = 'Kindle Fire HDX'.freeze
27
- IPadMini = 'iPad Mini'.freeze
28
- BlackberryPlayBook = 'Blackberry PlayBook'.freeze
29
- Nexus10 = 'Nexus 10'.freeze
30
- Nexus7 = 'Nexus 7'.freeze
31
- GalaxyNote3 = 'Galaxy Note 3'.freeze
32
- GalaxyNote2 = 'Galaxy Note II'.freeze
33
- LaptopWithTouch = 'Laptop with touch'.freeze
34
- LaptopWithHDPIScreen = 'Laptop with HiDPI screen'.freeze
35
- LaptopWithMDPIScreen = 'Laptop with MDPI screen'.freeze
64
+ Pixel3 = 'Pixel 3'.freeze
65
+ Pixel3XL = 'Pixel 3 XL'.freeze
66
+ Pixel4 = 'Pixel 4'.freeze
67
+ Pixel4XL = 'Pixel 4 XL'.freeze
68
+ Pixel5 = 'Pixel 5'.freeze
36
69
 
37
70
  def enum_values
38
71
  [
39
- IPhone4, IPhone5SE, IPhone678, IPhone678Plus, IPhoneX, IPad, IPadPro, BlackBerryZ30, Nexus4, Nexus5, Nexus5X,
40
- Nexus6, Nexus6P, Pixel2, Pixel2XL, LGOptimusL70, NokiaN9, NokiaLumia520, MicrosoftLumia550, MicrosoftLumia950,
41
- GalaxyS3, GalaxyS5, KindleFireHDX, IPadMini, BlackberryPlayBook, Nexus10, Nexus7, GalaxyNote3, GalaxyNote2,
42
- LaptopWithTouch, LaptopWithHDPIScreen, LaptopWithMDPIScreen
72
+ BlackberryPlayBook,
73
+ BlackBerryZ30,
74
+ GalaxyA5,
75
+ GalaxyNote10,
76
+ GalaxyNote10Plus,
77
+ GalaxyNote2,
78
+ GalaxyNote3,
79
+ GalaxyNote4,
80
+ GalaxyNote8,
81
+ GalaxyNote9,
82
+ GalaxyS3,
83
+ GalaxyS5,
84
+ GalaxyS8,
85
+ GalaxyS8Plus,
86
+ GalaxyS9,
87
+ GalaxyS9Plus,
88
+ GalaxyS10,
89
+ GalaxyS10Plus,
90
+ GalaxyS20,
91
+ IPad,
92
+ IPad6thGen,
93
+ IPad7thGen,
94
+ IPadAir2,
95
+ IPadMini,
96
+ IPadPro,
97
+ IPhone11,
98
+ IPhone11Pro,
99
+ IPhone11ProMax,
100
+ IPhone4,
101
+ IPhone5SE,
102
+ IPhone678,
103
+ IPhone678Plus,
104
+ IPhoneX,
105
+ IPhoneXR,
106
+ IPhoneXS,
107
+ IPhoneXSMax,
108
+ KindleFireHDX,
109
+ LaptopWithHIDPIScreen,
110
+ LaptopWithMDPIScreen,
111
+ LaptopWithTouch,
112
+ LGG6,
113
+ LGOptimusL70,
114
+ MicrosoftLumia550,
115
+ MicrosoftLumia950,
116
+ Nexus10,
117
+ Nexus4,
118
+ Nexus5,
119
+ Nexus5X,
120
+ Nexus6,
121
+ Nexus6P,
122
+ Nexus7,
123
+ NokiaLumia520,
124
+ NokiaN9,
125
+ OnePlus7T,
126
+ OnePlus7TPro,
127
+ Pixel2,
128
+ Pixel2XL,
129
+ Pixel3,
130
+ Pixel3XL,
131
+ Pixel4,
132
+ Pixel4XL,
133
+ Pixel5
43
134
  ]
44
135
  end
45
136
  end
@@ -227,6 +227,22 @@ module Applitools::Selenium
227
227
  )
228
228
  end
229
229
 
230
+ def universal_driver_config
231
+ if respond_to?(:session_id)
232
+ {
233
+ serverUrl: server_url,
234
+ sessionId: session_id,
235
+ capabilities: capabilities.as_json
236
+ }
237
+ else
238
+ {
239
+ serverUrl: server_url,
240
+ sessionId: bridge.session_id,
241
+ capabilities: capabilities.as_json
242
+ }
243
+ end
244
+ end
245
+
230
246
  private
231
247
 
232
248
  attr_reader :cached_default_content_viewport_size
@@ -245,6 +261,10 @@ module Applitools::Selenium
245
261
  @driver ||= __getobj__
246
262
  end
247
263
 
264
+ def server_url
265
+ bridge.http.send(:server_url).to_s
266
+ end
267
+
248
268
  def extract_args(args)
249
269
  case args.size
250
270
  when 2
@@ -6,11 +6,11 @@ module Applitools
6
6
  options = Applitools::Utils.extract_options!(args)
7
7
  server_url = options.delete(:server_url)
8
8
  server_url = args.first unless server_url
9
- runner = options.delete(:visual_grid_runner) || options.delete(:runner)
9
+ runner = options.delete(:visual_grid_runner) || options.delete(:runner) || Applitools::ClassicRunner.new
10
10
  if runner.is_a? Applitools::Selenium::VisualGridRunner
11
11
  super Applitools::Selenium::VisualGridEyes.new(runner, server_url)
12
12
  else
13
- super Applitools::Selenium::SeleniumEyes.new(server_url, runner: runner || Applitools::ClassicRunner.new)
13
+ super Applitools::Selenium::SeleniumEyes.new(server_url, runner: runner)
14
14
  end
15
15
  end
16
16
  end