eyes_selenium 3.15.3.beta → 3.15.4.beta

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a16bd000d3c6425d1a5bdce022190199236939cd6386afe54bc808567c32a58
4
- data.tar.gz: 07e34b7850610d964fd05d6bfec8b61af58427b4e78905af148b4dee32914085
3
+ metadata.gz: 528f158809bd96603814c886253b93137ec2d7c06b362838a0c3d3a92d506f77
4
+ data.tar.gz: d338946ba20679c7a9e76cfa225fcedb95da3ad3f7e00eb1bda6bb5c347ec0f7
5
5
  SHA512:
6
- metadata.gz: af6c6901ed20979de2da90cca6cbc8900d6bb33e55cc9e88d3a4915e67e7d2c3b4276d262b7f7d0566d63391f0f6e528b2405b18e855e840fa654e311c5cf94f
7
- data.tar.gz: ab3f2253b38875e6e0f779f4f691bc388f84c466fabdaca790b099321e508bc5dbb345d4ba60141d7db47ea4bcf29659b7af412fb6a4dc67078fba5db4205591
6
+ metadata.gz: 7b3c248b7052e22be4a1bb3b30bead9398830b4e1cf4fc83ff4aa782f69c2394bae9582bd76842d843d996e5a8b31502b3c56e17dc1511083b96798842a3239e
7
+ data.tar.gz: 5f620abb599c9d298aaf545a4f29972d31c88cf3b5288ef8b488b8df6cc6b310619a1daa9a42612148e21e9577eae881d68b87563912e3989ace0801ecd49099
@@ -49,6 +49,12 @@ module Applitools
49
49
  self
50
50
  end
51
51
 
52
+ def add_device_emulation(emu)
53
+ Applitools::ArgumentGuard.not_nil emu, 'emulation_info'
54
+ Applitools::ArgumentGuard.is_a? emu, 'emulation_info', Applitools::Selenium::EmulationBaseInfo
55
+ add_browser { |b| b.emulation_info(emu) }
56
+ end
57
+
52
58
  def deep_clone
53
59
  new_config = self.class.new
54
60
  config_keys.each do |k|
@@ -35,6 +35,11 @@ module Applitools
35
35
  browser_info.baseline_env_name = value
36
36
  self
37
37
  end
38
+
39
+ def emulation_info(value)
40
+ browser_info.emulation_info = value
41
+ self
42
+ end
38
43
  end
39
44
  end
40
45
  end
@@ -0,0 +1,185 @@
1
+ require 'applitools/selenium/visual_grid/emulation_base_info'
2
+ module Applitools
3
+ module Selenium
4
+ class ChromeEmulationInfo < EmulationBaseInfo
5
+ module DEVICES
6
+ IPhone4 = 'iPhone 4'.freeze
7
+ IPhone5SE = 'iPhone 5/SE'.freeze
8
+ IPhone678 = 'iPhone 6/7/8'.freeze
9
+ IPhone678Plus = 'iPhone 6/7/8 Plus'.freeze
10
+ IPhoneX = 'iPhone X'.freeze
11
+ IPad = 'iPad'.freeze
12
+ IPadPro = 'iPad Pro'.freeze
13
+ BlackBerryZ30 = 'BlackBerry Z30'.freeze
14
+ Nexus4 = 'Nexus 4'.freeze
15
+ Nexus5 = 'Nexus 5'.freeze
16
+ Nexus5X = 'Nexus 5X'.freeze
17
+ Nexus6 = 'Nexus 6'.freeze
18
+ Nexus6P = 'Nexus 6P'.freeze
19
+ Pixel2 = 'Pixel 2'.freeze
20
+ Pixel2XL = 'Pixel 2 XL'.freeze
21
+ LGOptimusL70 = 'LG Optimus L70'.freeze
22
+ NokiaN9 = 'Nokia N9'.freeze
23
+ NokiaLumia520 = 'Nokia Lumia 520'.freeze
24
+ MicrosoftLumia550 = 'Microsoft Lumia 550'.freeze
25
+ MicrosoftLumia950 = 'Microsoft Lumia 950'.freeze
26
+ GalaxyS3 = 'Galaxy S III'.freeze
27
+ GalaxyS5 = 'Galaxy S5'.freeze
28
+ KindleFireHDX = 'Kindle Fire HDX'.freeze
29
+ IPadMini = 'iPad Mini'.freeze
30
+ BlackberryPlayBook = 'Blackberry PlayBook'.freeze
31
+ Nexus10 = 'Nexus 10'.freeze
32
+ Nexus7 = 'Nexus 7'.freeze
33
+ GalaxyNote3 = 'Galaxy Note 3'.freeze
34
+ GalaxyNote2 = 'Galaxy Note II'.freeze
35
+ LaptopWithTouch = 'Laptop with touch'.freeze
36
+ LaptopWithHDPIScreen = 'Laptop with HiDPI screen'.freeze
37
+ LaptopWithMDPIScreen = 'Laptop with MDPI screen'.freeze
38
+ end
39
+
40
+ class << self
41
+ def i_phone_4(orientation)
42
+ new DEVICES::IPhone4, orientation
43
+ end
44
+
45
+ def i_phone_5_se(orientation)
46
+ new DEVICES::IPhone5SE, orientation
47
+ end
48
+
49
+ def i_phone_6_7_8(orientation)
50
+ new DEVICES::IPhone678, orientation
51
+ end
52
+
53
+ def i_phone_6_7_8_plus(orientation)
54
+ new DEVICES::IPhone678Plus, orientation
55
+ end
56
+
57
+ def i_phone_x(orientation)
58
+ new DEVICES::IPhoneX, orientation
59
+ end
60
+
61
+ def i_pad(orientation)
62
+ new DEVICES::IPad, orientation
63
+ end
64
+
65
+ def i_pad_pro(orientation)
66
+ new DEVICES::IPadPro, orientation
67
+ end
68
+
69
+ def black_berry_z30(orientation)
70
+ new DEVICES::BlackBerryZ30, orientation
71
+ end
72
+
73
+ def nexus_4(orientation)
74
+ new DEVICES::Nexus4, orientation
75
+ end
76
+
77
+ def nexus_5(orientation)
78
+ new DEVICES::Nexus5, orientation
79
+ end
80
+
81
+ def nexus_5x(orientation)
82
+ new DEVICES::Nexus5X, orientation
83
+ end
84
+
85
+ def nexus_6(orientation)
86
+ new DEVICES::Nexus6, orientation
87
+ end
88
+
89
+ def nexus_6p(orientation)
90
+ new DEVICES::Nexus6P, orientation
91
+ end
92
+
93
+ def pixel_2(orientation)
94
+ new DEVICES::Pixel2, orientation
95
+ end
96
+
97
+ def pixel_2xl(orientation)
98
+ new DEVICES::Pixel2XL, orientation
99
+ end
100
+
101
+ def lg_optimus_l70(orientation)
102
+ new DEVICES::LGOptimusL70, orientation
103
+ end
104
+
105
+ def nokia_n9(orientation)
106
+ new DEVICES::NokiaN9, orientation
107
+ end
108
+
109
+ def nokia_lumia_520(orientation)
110
+ new DEVICES::NokiaLumia520, orientation
111
+ end
112
+
113
+ def microsoft_lumia_550(orientation)
114
+ new DEVICES::MicrosoftLumia550, orientation
115
+ end
116
+
117
+ def microsoft_lumia_950(orientation)
118
+ new DEVICES::MicrosoftLumia950, orientation
119
+ end
120
+
121
+ def galaxy_s3(orientation)
122
+ new DEVICES::GalaxyS3, orientation
123
+ end
124
+
125
+ def galaxy_s5(orientation)
126
+ new DEVICES::GalaxyS5, orientation
127
+ end
128
+
129
+ def kndle_fire_hdx(orientation)
130
+ new DEVICES::KindleFireHDX, orientation
131
+ end
132
+
133
+ def i_pad_mini(orientation)
134
+ new DEVICES::IPadMini, orientation
135
+ end
136
+
137
+ def blackberry_play_book(orientation)
138
+ new DEVICES::BlackberryPlayBook, orientation
139
+ end
140
+
141
+ def nexus_10(orientation)
142
+ new DEVICES::Nexus10, orientation
143
+ end
144
+
145
+ def nexus_7(orientation)
146
+ new DEVICES::Nexus7, orientation
147
+ end
148
+
149
+ def galaxy_note_3(orientation)
150
+ new DEVICES::GalaxyNote3, orientation
151
+ end
152
+
153
+ def galaxy_note_2(orientation)
154
+ new DEVICES::GalaxyNote2, orientation
155
+ end
156
+
157
+ def laptop_with_touch(orientation)
158
+ new DEVICES::LaptopWithTouch, orientation
159
+ end
160
+
161
+ def laptop_with_hdpi_screen(orientation)
162
+ new DEVICES::LaptopWithHDPIScreen, orientation
163
+ end
164
+
165
+ def laptop_with_mdpi_screen(orientation)
166
+ new DEVICES::LaptopWithMDPIScreen, orientation
167
+ end
168
+ end
169
+
170
+ attr_accessor :device_name
171
+
172
+ def initialize(device_name, screen_orientation)
173
+ super(screen_orientation)
174
+ self.device_name = device_name
175
+ end
176
+
177
+ def json_data
178
+ {
179
+ deviceName: device_name,
180
+ screenOrientation: screen_orientation
181
+ }
182
+ end
183
+ end
184
+ end
185
+ end
@@ -0,0 +1,17 @@
1
+ module Applitools
2
+ module Selenium
3
+ class EmulationBaseInfo
4
+ module ORIENTATIONS
5
+ PORTRAIT = 'portrait'
6
+ LANDSCAPE = 'landscape'
7
+ end
8
+ extend Applitools::Helpers
9
+ attr_accessor :screen_orientation
10
+ abstract_attr_accessor :device_name
11
+
12
+ def initialize(screen_orientation)
13
+ self.screen_orientation = screen_orientation
14
+ end
15
+ end
16
+ end
17
+ end
@@ -43,7 +43,6 @@ module Applitools
43
43
  match_data.tag = name
44
44
  update_default_settings(match_data)
45
45
  match_data.read_target(target_to_check, driver)
46
-
47
46
  check_result = check_window_base(
48
47
  dummy_region_provider, timeout, match_data
49
48
  )
@@ -109,6 +108,12 @@ module Applitools
109
108
 
110
109
  end
111
110
 
111
+ def viewport_size
112
+ status = render_statuses[render_statuses.keys.first]
113
+ size = status['deviceSize']
114
+ Applitools::RectangleSize.new(size['width'], size['height'])
115
+ end
116
+
112
117
  def title
113
118
  return driver.title unless dont_get_title
114
119
  rescue StandardError => e
@@ -118,7 +123,7 @@ module Applitools
118
123
  end
119
124
 
120
125
  def get_app_output_with_screenshot(region_provider, last_screenshot)
121
- dom_url = ''
126
+ # dom_url = ''
122
127
  # captured_dom_data = dom_data
123
128
  # unless captured_dom_data.empty?
124
129
  # begin
@@ -158,7 +163,7 @@ module Applitools
158
163
  Applitools::AppOutputWithScreenshot.new(
159
164
  Applitools::AppOutput.new(a_title, '').tap do |o|
160
165
  o.location = region.location unless region.empty?
161
- # o.dom_url = dom_url
166
+ o.dom_url = dom_url
162
167
  o.screenshot_url = screenshot_url if respond_to?(:screenshot_url) && !screenshot_url.nil?
163
168
  end,
164
169
  nil,
@@ -22,9 +22,11 @@ module Applitools
22
22
  string_field :platform
23
23
  string_field :size_mode
24
24
  string_field :baseline_env_name
25
+ object_field :emulation_info, Applitools::Selenium::EmulationBaseInfo
25
26
 
26
27
  def to_s
27
- "#{viewport_size} (#{browser_type})"
28
+ return "#{viewport_size} (#{browser_type})" unless emulation_info
29
+ "#{emulation_info.device_name} - #{emulation_info.screen_orientation}"
28
30
  end
29
31
  end
30
32
  end
@@ -2,8 +2,18 @@ module Applitools
2
2
  module Selenium
3
3
  class RenderInfo
4
4
  include Applitools::Jsonable
5
- json_fields :width, :height, :sizeMode
5
+ json_fields :width, :height, :sizeMode, :emulationInfo
6
6
  # , :region, :emulationInfo
7
+
8
+ def json_data
9
+ result = {
10
+ width: width,
11
+ height: height,
12
+ sizeMode: size_mode
13
+ }
14
+ result['emulationInfo'] = json_value(emulation_info) if emulation_info
15
+ result
16
+ end
7
17
  end
8
18
  end
9
19
  end
@@ -147,6 +147,7 @@ module Applitools
147
147
  r.width = running_test.browser_info.viewport_size.width
148
148
  r.height = running_test.browser_info.viewport_size.height
149
149
  r.size_mode = running_test.browser_info.size_mode
150
+ r.emulation_info = running_test.browser_info.emulation_info if running_test.browser_info.emulation_info
150
151
  end
151
152
 
152
153
  dom = Applitools::Selenium::RGridDom.new(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '3.15.3.beta'.freeze
4
+ VERSION = '3.15.4.beta'.freeze
5
5
  end
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: 3.15.3.beta
4
+ version: 3.15.4.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-01 00:00:00.000000000 Z
11
+ date: 2019-04-02 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: 3.15.3.beta
19
+ version: 3.15.4.beta
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: 3.15.3.beta
26
+ version: 3.15.4.beta
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -115,6 +115,8 @@ files:
115
115
  - lib/applitools/selenium/test_list.rb
116
116
  - lib/applitools/selenium/viewport_screenshot.rb
117
117
  - lib/applitools/selenium/viewport_size.rb
118
+ - lib/applitools/selenium/visual_grid/chrome_emulation_info.rb
119
+ - lib/applitools/selenium/visual_grid/emulation_base_info.rb
118
120
  - lib/applitools/selenium/visual_grid/eyes_connector.rb
119
121
  - lib/applitools/selenium/visual_grid/render_browser_info.rb
120
122
  - lib/applitools/selenium/visual_grid/render_info.rb