eyes_core 3.14.2 → 3.14.3

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: cb52c6e800a0c68741e5457a6a0701ecd7a140dd
4
- data.tar.gz: 236b3a5872b65eac9af5adf2af8f992def5ef6ed
3
+ metadata.gz: 5d9bf7c4a1a591be9f9e5a4fa1f97b5f6d89fdf1
4
+ data.tar.gz: b46c22f0b9a08fe8e7f1e768306bb787a6bf026c
5
5
  SHA512:
6
- metadata.gz: 9eeb6512ea56c8b3d8e2caa4c187a121d841587d3c97072094a24085576313f2bc13f6de7ad2181b880a397b5b4a740fa6617a4badb52bd6079818cb691056ac
7
- data.tar.gz: 56f36fd54268dabed644de5ab3eafa933a7cf3b229810918f9a36f805bc424f9b46033647565902cc6c98d78b978c3677934ef3645093e121cebdc759a883478
6
+ metadata.gz: 117dc8fdfc6a5dad6576c2d120ffc6d8fcde6c290eab3c5452e606d437fbd74900426148a16940b4897d0be9c90346ab42718708a976a33da24fb7fd89a07b77
7
+ data.tar.gz: 05340e98ffa98f3fcc433329c4bef32acafadd12c6cb39c0bf429a2cb37f2a1caf9c169047d71bbf32ee568712dd5a244c061e7c35792613fe5fe03fd9292592
@@ -8,7 +8,7 @@ module Applitools
8
8
  def initialize(server_url = Applitools::Connectivity::ServerConnector::DEFAULT_SERVER_URL)
9
9
  super
10
10
  self.base_agent_id = "eyes.calabash.ruby/#{Applitools::VERSION}".freeze
11
- self.debug_screenshot = true
11
+ self.debug_screenshot = false
12
12
  self.debug_screenshot_provider = Applitools::DebugScreenshotProvider.new
13
13
  .tag_access { tag_for_debug }
14
14
  .debug_flag_access { debug_screenshot }
@@ -8,7 +8,8 @@ module Applitools
8
8
  213 => 1.33,
9
9
  240 => 1.5,
10
10
  320 => 2,
11
- 480 => 3
11
+ 480 => 3,
12
+ 640 => 4
12
13
  }.freeze
13
14
 
14
15
  def initialize(*args)
@@ -19,7 +19,7 @@ if respond_to?(:After)
19
19
  After('@eyes') do |_scenario|
20
20
  eyes = Applitools::Calabash::EyesSettings.instance.eyes
21
21
  Applitools::Calabash::EyesSettings.instance.eyes.remove_context if eyes && eyes.open?
22
- step %(terminate eyes session)
22
+ step %(terminate eyes session) if eyes && eyes.running_session?
23
23
  end
24
24
  end
25
25
 
@@ -2,8 +2,9 @@ require 'rspec/expectations'
2
2
 
3
3
  RSpec::Matchers.define :match_baseline do |expected|
4
4
  match do |actual|
5
- result = Applitools::Calabash::EyesSettings.instance.eyes.check(expected, actual)
6
- result.as_expected?
5
+ eyes = Applitools::Calabash::EyesSettings.instance.eyes
6
+ result = eyes.check(expected, actual)
7
+ eyes.new_session? || result.as_expected?
7
8
  end
8
9
 
9
10
  failure_message do |_actual|
@@ -35,7 +35,8 @@ module Applitools
35
35
  attr_accessor :app_name, :baseline_name, :branch_name, :parent_branch_name, :batch, :agent_id, :full_agent_id,
36
36
  :match_timeout, :save_new_tests, :save_failed_tests, :failure_reports, :default_match_settings, :cut_provider,
37
37
  :scale_ratio, :host_os, :host_app, :base_line_name, :position_provider, :viewport_size, :verbose_results,
38
- :inferred_environment, :remove_session_if_matching, :server_scale, :server_remainder, :match_level, :exact
38
+ :inferred_environment, :remove_session_if_matching, :server_scale, :server_remainder, :match_level, :exact,
39
+ :compare_with_parent_branch
39
40
 
40
41
  abstract_attr_accessor :base_agent_id
41
42
  abstract_method :capture_screenshot, true
@@ -74,6 +75,7 @@ module Applitools
74
75
  self.match_level = Applitools::MATCH_LEVEL[:strict]
75
76
  self.server_scale = 0
76
77
  self.server_remainder = 0
78
+ self.compare_with_parent_branch = false
77
79
  end
78
80
 
79
81
  def match_level=(value)
@@ -155,6 +157,14 @@ module Applitools
155
157
  @open
156
158
  end
157
159
 
160
+ def running_session?
161
+ running_session.nil? ? false : true
162
+ end
163
+
164
+ def new_session?
165
+ running_session && running_session.new_session?
166
+ end
167
+
158
168
  def app_name
159
169
  !current_app_name.nil? && !current_app_name.empty? ? current_app_name : @app_name
160
170
  end
@@ -217,7 +227,8 @@ module Applitools
217
227
  logger.info "openBase(app_name: #{options[:app_name]}, test_name: #{options[:test_name]}," \
218
228
  " viewport_size: #{options[:viewport_size]})"
219
229
 
220
- raise Applitools::EyesError.new 'API key is missing! Please set it using api_key=' if api_key.nil?
230
+ raise Applitools::EyesError.new 'API key is missing! Please set it using api_key=' if
231
+ api_key.nil? || (api_key && api_key.empty?)
221
232
 
222
233
  self.viewport_size = options[:viewport_size]
223
234
  self.session_type = options[:session_type]
@@ -451,6 +462,10 @@ module Applitools
451
462
  self.current_app_name = nil
452
463
  end
453
464
 
465
+ def compare_with_parent_branch=(value)
466
+ @compare_with_parent_branch = value ? true : false
467
+ end
468
+
454
469
  private
455
470
 
456
471
  attr_accessor :running_session, :last_screenshot, :current_app_name, :test_name, :session_type,
@@ -570,15 +585,14 @@ module Applitools
570
585
  self.viewport_size = get_viewport_size
571
586
  end
572
587
 
573
- logger.info "Batch is #{batch}"
574
- test_batch = batch
588
+ logger.info "Batch is #{@batch}" if @batch
575
589
 
576
590
  app_env = app_environment
577
591
 
578
592
  logger.info "Application environment is #{app_env}"
579
593
 
580
594
  self.session_start_info = SessionStartInfo.new agent_id: base_agent_id, app_id_or_name: app_name,
581
- scenario_id_or_name: test_name, batch_info: test_batch,
595
+ scenario_id_or_name: test_name, batch_info: @batch,
582
596
  env_name: baseline_name, environment: app_env,
583
597
  default_match_settings: default_match_settings,
584
598
  branch_name: branch_name, parent_branch_name: parent_branch_name,
@@ -20,7 +20,7 @@ module Applitools
20
20
  'MatchLevel' => 'Strict',
21
21
  'SplitTopHeight' => 0,
22
22
  'SplitBottomHeight' => 0,
23
- 'IgnoreCaret' => false,
23
+ 'IgnoreCaret' => true,
24
24
  'Ignore' => [],
25
25
  'Floating' => [],
26
26
  'Exact' => {
@@ -23,7 +23,7 @@ module Applitools
23
23
  end
24
24
 
25
25
  def from_struct(value)
26
- new value.width, value.height
26
+ new value.width.to_i, value.height.to_i
27
27
  end
28
28
  end
29
29
 
@@ -14,6 +14,7 @@ module Applitools
14
14
  @branch_name = options[:branch_name]
15
15
  @parent_branch_name = options[:parent_branch_name]
16
16
  @properties = options[:properties]
17
+ @compare_with_parent_branch = options[:compare_with_parent_branch]
17
18
  end
18
19
 
19
20
  def to_hash
@@ -22,12 +23,13 @@ module Applitools
22
23
  app_id_or_name: @app_id_or_name,
23
24
  ver_id: @ver_id,
24
25
  scenario_id_or_name: @scenario_id_or_name,
25
- batch_info: @batch_info.to_hash,
26
+ batch_info: @batch_info && @batch_info.to_hash,
26
27
  env_name: @env_name,
27
28
  environment: @environment.to_hash,
28
29
  default_match_settings: @default_match_settings,
29
30
  branch_name: @branch_name,
30
31
  parent_branch_name: @parent_branch_name,
32
+ compare_with_parent_branch: @compare_with_parent_branch,
31
33
  properties: @properties
32
34
  }
33
35
  end
@@ -127,8 +127,8 @@ module Applitools::Utils
127
127
 
128
128
  # true if test is running on mobile device
129
129
  def mobile_device?
130
+ return nil unless defined?(Appium::Driver)
130
131
  return $driver if $driver && $driver.is_a?(Appium::Driver)
131
- nil
132
132
  end
133
133
 
134
134
  # true if test is running on Android device
@@ -1,3 +1,3 @@
1
1
  module Applitools
2
- VERSION = '3.14.2'.freeze
2
+ VERSION = '3.14.3'.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.14.2
4
+ version: 3.14.3
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-12-30 00:00:00.000000000 Z
11
+ date: 2018-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oily_png
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  version: '0'
303
303
  requirements: []
304
304
  rubyforge_project:
305
- rubygems_version: 2.6.8
305
+ rubygems_version: 2.6.14
306
306
  signing_key:
307
307
  specification_version: 4
308
308
  summary: Applitools Ruby SDK