eyes_core 3.12.0 → 3.13.0

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
  SHA1:
3
- metadata.gz: bc49ba9e29b2b8a74c01e6434f9771a2cd27073e
4
- data.tar.gz: 3d3ae218ea0cceedbe4d54f9f5c73a30a170998a
3
+ metadata.gz: 3cdf33bdcd17edc90839aa972220da8f8a7b1703
4
+ data.tar.gz: f90b947ead660f07029641479835bfb7da5828a1
5
5
  SHA512:
6
- metadata.gz: a7dd3be6a04caab29073db00e05ed79daa0a240dbd8f607a66e543872162876c078ef658afbcc890ac84dafb791a888741d3afa166a0528194a1b26abf5f020e
7
- data.tar.gz: a669d428b9fd58029c7248f4a77a7483d42030471c9446cb1df5e5800fa784b0dfe8c76dfe3adc70d30a8b6e19d0e00273651d9670a647437d726dd2998c1aff
6
+ metadata.gz: 06f4fe2a9ba78498e0fc90d3fa360cb9f2bdef28c222926e71e4d05f5ea04a90fbb777d2d11c7d56ef5c076bb85a0745c167f32d5e6b85630447d001cbc35afe
7
+ data.tar.gz: ec9ba5bfac4a9577def13baee3bbb4191c0490e28da79c63b260a2f0401ff1643ebe08bae58732ad72642479f24d0ade4e50687a393b52aae1845f9a2bbe58dc
@@ -419,19 +419,27 @@ module Applitools
419
419
 
420
420
  logger.info results.to_s(verbose_results)
421
421
 
422
- if results.failed?
423
- logger.error "--- Failed test ended. see details at #{session_results_url}"
424
- error_message = "#{session_start_info.scenario_id_or_name} of #{session_start_info.app_id_or_name}. " \
425
- "See details at #{session_results_url}."
426
- raise Applitools::TestFailedError.new error_message, results if throw_exception
422
+ if results.unresolved?
423
+ if results.new?
424
+ logger.error "--- New test ended. see details at #{session_results_url}"
425
+ error_message = "New test '#{session_start_info.scenario_id_or_name}' " \
426
+ "of '#{session_start_info.app_id_or_name}' " \
427
+ "Please approve the baseline at #{session_results_url} "
428
+ raise Applitools::NewTestError.new error_message, results if throw_exception
429
+ else
430
+ logger.error "--- Differences are found. see details at #{session_results_url}"
431
+ error_message = "Test '#{session_start_info.scenario_id_or_name}' " \
432
+ "of '#{session_start_info.app_id_or_name}' " \
433
+ "detected differences! See details at #{session_results_url}"
434
+ raise Applitools::DiffsFoundError.new error_message, results if throw_exception
435
+ end
427
436
  return results
428
437
  end
429
438
 
430
- if results.new?
431
- instructions = "Please approve the new baseline at #{session_results_url}"
432
- logger.info "--- New test ended. #{instructions}"
433
- error_message = "#{session_start_info.scenario_id_or_name} of #{session_start_info.app_id_or_name}. " \
434
- "#{instructions}"
439
+ if results.failed?
440
+ logger.error "--- Failed test ended. see details at #{session_results_url}"
441
+ error_message = "Test '#{session_start_info.scenario_id_or_name}' of '#{session_start_info.app_id_or_name}' " \
442
+ "is failed! See details at #{session_results_url}"
435
443
  raise Applitools::TestFailedError.new error_message, results if throw_exception
436
444
  return results
437
445
  end
@@ -4,9 +4,9 @@ module Applitools
4
4
  # Creates a FixedCutProvider instance
5
5
  # @param [Applitools::Region] crop_region Outside space of the region will be cropped
6
6
  # @param [Integer] header A top field to crop
7
+ # @param [Integer] footer A bottom field to crop
7
8
  # @param [Integer] left A left field to crop
8
9
  # @param [Integer] right A right field to crop
9
- # @param [Integer] footer A bottom field to crop
10
10
  # @example Creates cut provider by a Region
11
11
  # Applitools::FixedCutProvider.new Applitools::Region.new(20,20, 300, 300)
12
12
  # @example Creates cut provider by a set of fields
@@ -3,30 +3,43 @@ require 'yaml'
3
3
  module Applitools
4
4
  class TestResults
5
5
  attr_accessor :is_new, :url, :screenshot
6
- attr_reader :steps, :matches, :mismatches, :missing, :original_results
6
+ attr_reader :status, :steps, :matches, :mismatches, :missing, :original_results
7
7
 
8
8
  def initialize(results = {})
9
+ @original_results = results
9
10
  @steps = results.fetch('steps', 0)
10
11
  @matches = results.fetch('matches', 0)
11
12
  @mismatches = results.fetch('mismatches', 0)
12
13
  @missing = results.fetch('missing', 0)
14
+ @status = results.fetch('status', 0)
13
15
  @is_new = nil
14
16
  @url = nil
15
- @original_results = results
16
17
  end
17
18
 
18
19
  def passed?
19
- !(original_results['isAborted'] || original_results['isDifferent'] || original_results['isNew'])
20
+ status == 'Passed'
20
21
  end
21
22
 
22
23
  def failed?
23
- original_results['isDifferent'] && !(original_results['isAborted'] || original_results['isNew'])
24
+ status == 'Failed'
25
+ end
26
+
27
+ def unresolved?
28
+ status == 'Unresolved'
24
29
  end
25
30
 
26
31
  def new?
27
32
  original_results['isNew']
28
33
  end
29
34
 
35
+ def different?
36
+ original_results['isDifferent']
37
+ end
38
+
39
+ def aborted?
40
+ original_results['isAborted']
41
+ end
42
+
30
43
  def ==(other)
31
44
  if other.is_a? self.class
32
45
  result = true
@@ -1,3 +1,3 @@
1
1
  module Applitools
2
- VERSION = '3.12.0'.freeze
2
+ VERSION = '3.13.0'.freeze
3
3
  end
data/lib/eyes_core.rb CHANGED
@@ -54,6 +54,7 @@ module Applitools
54
54
 
55
55
  # @!visibility private
56
56
  class NewTestError < TestFailedError; end
57
+ class DiffsFoundError < TestFailedError; end
57
58
  end
58
59
 
59
60
  require_relative 'applitools/method_tracer'
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.12.0
4
+ version: 3.13.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-09-13 00:00:00.000000000 Z
11
+ date: 2017-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oily_png