eyes_core 3.15.4.beta → 3.15.5.beta

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
  SHA256:
3
- metadata.gz: 86201bfea58959c8bfe46f33e8b340e134636856b8bbe86ca4ab184e4ee5ff16
4
- data.tar.gz: 7aabf30b0b9bc52e4f30efefd906fedcbc593f624018ae8b45ccf50779b567d1
3
+ metadata.gz: 05c5e4a10067d6eac35875c9400aae6bcd3506f059d74863b7d56c6347627cf4
4
+ data.tar.gz: b3e91e6173ac7cd8c4ebf301203b20b18b6c37850bea9fbc307b0d414735d0da
5
5
  SHA512:
6
- metadata.gz: ddb0b2b3a128cef7a50d694f12da55d1c755dc19cfc08839aac7ec4df1b9b0cd2f359ddf6d107a0d9278cf4ef4d51ca9e8e49753d99896787a522b675996a66c
7
- data.tar.gz: 72cf23f15e9f2816dd2d2e45d6bc591efb86de661f9cc67722b538c028fa19f8b26a4cdadbc39a381a4aa254269acf35fcc5aee8323cd4566b05709de788731b
6
+ metadata.gz: d00b47bbbd3fbdc878dc4eaada899b66d2bca68fbd07d25c3fb012557f7c5e4027de9c8b26fcd208e5c8ba4622baaaa7cb1c2327aa5336b859a77a2da834ac5a
7
+ data.tar.gz: 5dbc43c8c9751c0f498a2d2e2b9fb27f5e8eefca949abd7cf90d1a8d966599b2197b12d820909fd2bb22adf149e9fd0f65bfb3cc02526e396c4172c7ddf8e1df
@@ -269,7 +269,6 @@ module Applitools::Connectivity
269
269
  url,
270
270
  ssl: { ca_file: SSL_CERT },
271
271
  proxy: @proxy.nil? ? nil : @proxy.to_hash
272
- # proxy: Applitools::Connectivity::Proxy.new('http://localhost:8000').to_hash
273
272
  ).send(method) do |req|
274
273
  req.options.timeout = DEFAULT_TIMEOUT
275
274
  req.headers = DEFAULT_HEADERS.merge(options[:headers] || {})
@@ -284,7 +283,6 @@ module Applitools::Connectivity
284
283
  url,
285
284
  ssl: { ca_file: SSL_CERT },
286
285
  proxy: @proxy.nil? ? nil : @proxy.to_hash
287
- # proxy: Applitools::Connectivity::Proxy.new('http://localhost:8000').to_hash
288
286
  ).send(method) do |req|
289
287
  req.options.timeout = options[:timeout] || DEFAULT_TIMEOUT
290
288
  req.headers = DEFAULT_HEADERS.merge(options[:headers] || {})
@@ -31,8 +31,8 @@ module Applitools
31
31
  attr_accessor :config
32
32
 
33
33
  def_delegators 'Applitools::EyesLogger', :logger, :log_handler, :log_handler=
34
- def_delegators 'server_connector', :api_key, :api_key=, :server_url, :server_url=,
35
- :set_proxy, :proxy, :proxy=
34
+ # def_delegators 'server_connector', :api_key, :api_key=, :server_url, :server_url=,
35
+ # :set_proxy, :proxy, :proxy=
36
36
 
37
37
  # @!attribute [rw] verbose_results
38
38
  # If set to true it will display test results in verbose format, including all fields returned by the server
@@ -45,7 +45,7 @@ module Applitools
45
45
 
46
46
  attr_accessor :batch, :full_agent_id,
47
47
  :match_timeout, :save_new_tests, :save_failed_tests, :failure_reports, :default_match_settings, :cut_provider,
48
- :scale_ratio, :host_os, :host_app, :position_provider, :viewport_size, :verbose_results,
48
+ :scale_ratio, :position_provider, :viewport_size, :verbose_results,
49
49
  :inferred_environment, :remove_session_if_matching, :server_scale, :server_remainder, :match_level, :exact,
50
50
  :compare_with_parent_branch, :results
51
51
 
@@ -62,8 +62,9 @@ module Applitools
62
62
  def_delegators 'config', *Applitools::EyesBaseConfiguration.methods_to_delegate
63
63
 
64
64
  def initialize(server_url = nil)
65
- self.server_connector = Applitools::Connectivity::ServerConnector.new(server_url)
65
+ @server_connector = Applitools::Connectivity::ServerConnector.new(server_url)
66
66
  ensure_config
67
+ self.server_url = server_url if server_url
67
68
  self.disabled = false
68
69
  @viewport_size = nil
69
70
  self.match_timeout = DEFAULT_MATCH_TIMEOUT
@@ -101,6 +102,20 @@ module Applitools
101
102
  self.config = Applitools::EyesBaseConfiguration.new
102
103
  end
103
104
 
105
+ def config=(value)
106
+ Applitools::ArgumentGuard.not_nil value, 'config'
107
+ Applitools::ArgumentGuard.is_a? value, 'config', Applitools::EyesBaseConfiguration
108
+ raise Applitools::EyesError, 'You can\'t use new config if eyes are opened' if open?
109
+ @config = value
110
+ end
111
+
112
+ def server_connector
113
+ @server_connector.server_url = config.server_url
114
+ @server_connector.api_key = config.api_key
115
+ @server_connector.proxy = config.proxy if config.proxy
116
+ @server_connector
117
+ end
118
+
104
119
  def match_level=(value)
105
120
  return @match_level = value if Applitools::MATCH_LEVEL.values.include?(value)
106
121
  return @match_level = Applitools::MATCH_LEVEL[value.to_sym] if Applitools::MATCH_LEVEL.keys.include?(value.to_sym)
@@ -502,7 +517,7 @@ module Applitools
502
517
  private
503
518
 
504
519
  attr_accessor :running_session, :last_screenshot, :scale_provider, :session_start_info, :should_match_window_run_once_on_timeout, :app_output_provider,
505
- :failed, :server_connector
520
+ :failed
506
521
 
507
522
  attr_reader :user_inputs, :properties
508
523
 
@@ -1,6 +1,7 @@
1
1
  require 'applitools/core/rectangle_size'
2
2
  require 'applitools/core/session_types'
3
3
  require 'applitools/core/batch_info'
4
+ require 'applitools/connectivity/proxy'
4
5
 
5
6
  module Applitools
6
7
  class EyesBaseConfiguration < AbstractConfiguration
@@ -8,7 +9,9 @@ module Applitools
8
9
  branch_name: ENV['APPLITOOLS_BRANCH'] || '',
9
10
  parent_branch_name: ENV['APPLITOOLS_PARENT_BRANCH'] || '',
10
11
  baseline_branch_name: ENV['APPLITOOLS_BASELINE_BRANCH'] || '',
11
- save_diffs: false
12
+ save_diffs: false,
13
+ server_url: 'https://eyessdk.applitools.com',
14
+ api_key: ENV['APPLITOOLS_API_KEY'] || ''
12
15
  }.freeze
13
16
 
14
17
  class << self
@@ -66,6 +69,11 @@ module Applitools
66
69
  string_field :app_name
67
70
  string_field :test_name
68
71
  object_field :viewport_size, Applitools::RectangleSize
72
+ string_field :api_key
73
+ string_field :server_url
74
+ string_field :host_os
75
+ string_field :host_app
76
+ object_field :proxy, Applitools::Connectivity::Proxy
69
77
 
70
78
  def short_description
71
79
  "#{test_name} of #{app_name}"
@@ -38,7 +38,6 @@ module Applitools
38
38
  def string_field(field_name)
39
39
  collect_method field_name
40
40
  define_method(field_name) do
41
- return '' unless config_hash[field_name.to_sym].is_a? String
42
41
  config_hash[field_name.to_sym]
43
42
  end
44
43
 
@@ -49,7 +48,9 @@ module Applitools
49
48
  end
50
49
 
51
50
  define_method("defined_#{field_name}?") do
52
- !send(field_name).empty?
51
+ value = send(field_name)
52
+ return false if value.nil?
53
+ !value.empty?
53
54
  end
54
55
  end
55
56
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '3.15.4.beta'.freeze
4
+ VERSION = '3.15.5.beta'.freeze
5
5
  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.15.4.beta
4
+ version: 3.15.5.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-02 00:00:00.000000000 Z
11
+ date: 2019-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oily_png
@@ -333,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
333
333
  version: 1.3.1
334
334
  requirements: []
335
335
  rubyforge_project:
336
- rubygems_version: 2.7.7
336
+ rubygems_version: 2.7.9
337
337
  signing_key:
338
338
  specification_version: 4
339
339
  summary: Core of the Applitools Ruby SDK