eyes_core 3.11.3 → 3.12.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: 6a7f6907cd0187127b80c8bd66d16d2db2a9ccd3
4
- data.tar.gz: 8459dc647e493bcbd98842d914542d7f08096bb9
3
+ metadata.gz: bc49ba9e29b2b8a74c01e6434f9771a2cd27073e
4
+ data.tar.gz: 3d3ae218ea0cceedbe4d54f9f5c73a30a170998a
5
5
  SHA512:
6
- metadata.gz: eb6a6c9d02180a40f0d40dfea4e74d19853d3dcc72e88ed11a8fa1d791e9ef6cbb1770491f4489cdc161bb3558626d5274373235a6bbd333da164ff3ba020019
7
- data.tar.gz: 971577f4b1a7929c6e85194fb454cdaeeae7921005ac1a03470b52db676f0b3d61377d1617ae75aa3f30ef0a118211f8200870a71eb139c36ff4cef2a5b84fc0
6
+ metadata.gz: a7dd3be6a04caab29073db00e05ed79daa0a240dbd8f607a66e543872162876c078ef658afbcc890ac84dafb791a888741d3afa166a0528194a1b26abf5f020e
7
+ data.tar.gz: a669d428b9fd58029c7248f4a77a7483d42030471c9446cb1df5e5800fa784b0dfe8c76dfe3adc70d30a8b6e19d0e00273651d9670a647437d726dd2998c1aff
@@ -13,7 +13,7 @@ module Applitools
13
13
  {
14
14
  'os' => @os,
15
15
  'hostingApp' => @hosting_app,
16
- 'displaySize' => @display_size.to_hash,
16
+ 'displaySize' => @display_size && @display_size.to_hash,
17
17
  'inferred' => @inferred
18
18
  }
19
19
  end
@@ -195,6 +195,11 @@ module Applitools
195
195
  return false
196
196
  end
197
197
 
198
+ if open?
199
+ abort_if_not_closed
200
+ raise Applitools::EyesError.new 'A test is already running'
201
+ end
202
+
198
203
  Applitools::ArgumentGuard.hash options, 'open_base parameter', [:test_name]
199
204
  default_options = { session_type: 'SEQUENTIAL' }
200
205
  options = default_options.merge options
@@ -214,20 +219,32 @@ module Applitools
214
219
 
215
220
  raise Applitools::EyesError.new 'API key is missing! Please set it using api_key=' if api_key.nil?
216
221
 
217
- if open?
218
- abort_if_not_closed
219
- raise Applitools::EyesError.new 'A test is already running'
220
- end
221
-
222
222
  self.viewport_size = options[:viewport_size]
223
223
  self.session_type = options[:session_type]
224
224
 
225
+ yield if block_given?
226
+
225
227
  self.open = true
226
228
  rescue Applitools::EyesError => e
227
229
  logger.error e.message
228
230
  raise e
229
231
  end
230
232
 
233
+ def ensure_running_session
234
+ return if running_session
235
+
236
+ logger.info 'No running session, calling start session..'
237
+ start_session
238
+ logger.info 'Done!'
239
+ @match_window_task = Applitools::MatchWindowTask.new(
240
+ logger,
241
+ running_session,
242
+ match_timeout,
243
+ app_output_provider,
244
+ server_connector
245
+ )
246
+ end
247
+
231
248
  def check_window_base(region_provider, retry_timeout, match_window_data)
232
249
  if disabled?
233
250
  logger.info "#{__method__} Ignored"
@@ -246,18 +263,7 @@ module Applitools
246
263
 
247
264
  tag = '' if tag.nil?
248
265
 
249
- if running_session.nil?
250
- logger.info 'No running session, calling start session..'
251
- start_session
252
- logger.info 'Done!'
253
- @match_window_task = Applitools::MatchWindowTask.new(
254
- logger,
255
- running_session,
256
- match_timeout,
257
- app_output_provider,
258
- server_connector
259
- )
260
- end
266
+ ensure_running_session
261
267
 
262
268
  match_window_data.user_inputs = user_inputs
263
269
 
@@ -551,7 +557,7 @@ module Applitools
551
557
  logger.info 'start_session()'
552
558
 
553
559
  if viewport_size
554
- set_viewport_size(viewport_size)
560
+ set_viewport_size(viewport_size, true)
555
561
  else
556
562
  self.viewport_size = get_viewport_size
557
563
  end
@@ -7,6 +7,7 @@ module Applitools
7
7
  attr_accessor :image
8
8
 
9
9
  COORDINATE_TYPES = {
10
+ context_as_is: 'CONTEXT_AS_IS',
10
11
  screenshot_as_is: 'SCREENSHOT_AS_IS',
11
12
  context_relative: 'CONTEXT_RELATIVE'
12
13
  }.freeze
@@ -78,6 +78,7 @@ module Applitools
78
78
  @top = i_top
79
79
  @width = i_right - i_left
80
80
  @height = i_bottom - i_top
81
+ self
81
82
  end
82
83
 
83
84
  def contains?(other_left, other_top)
@@ -314,7 +314,7 @@ module Applitools::Utils
314
314
  Applitools::EyesLogger.error 'Zoom workaround failed.'
315
315
  end
316
316
 
317
- raise Applitools::TestFailedError.new 'Failed to set viewport size'
317
+ raise Applitools::TestFailedError.new "Failed to set viewport size (#{viewport_size})"
318
318
  end
319
319
 
320
320
  def set_browser_size(executor, required_size)
@@ -1,3 +1,3 @@
1
1
  module Applitools
2
- VERSION = '3.11.3'.freeze
2
+ VERSION = '3.12.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyes_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.3
4
+ version: 3.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-13 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oily_png