eyes_core 3.2.1 → 3.2.2

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: c88e7c7471138c545eb26cd0d3071f2dbf913b96
4
- data.tar.gz: af7acdaacc4fdad1954e0c7882d4d548bf1ef4b2
3
+ metadata.gz: 64f8c3db87db9835c4dc79c765959e83c8aeb946
4
+ data.tar.gz: 7d727cecee7d09a6a9fe4f835bcbb4adab06c5f4
5
5
  SHA512:
6
- metadata.gz: 462827e9166de30c60354313015f28172b4d7010320ebbe069a8a707634f661002658369c5d7cbf8f8383e10d77434373279c2eb98ee52e77a8037791a481c9d
7
- data.tar.gz: b2faaa4260c1f8fbda48e70a91b4bb94b369f8eda013de55c1d1549665ebbef7ff888f53bf29b41e390cd2a5d95c8050de5d2b038edc5d2b2c9feab82b86e04a
6
+ metadata.gz: '018bbc1ef29fa85b6bf41e4265926372dc04cfb27bc1afcdd71655ce495c2707736f713ceffe774b670282e1b1551c10e54d879eb5a6776e526d881590b8a69c'
7
+ data.tar.gz: 46a71295b6d39855ee931165c4eb804dcee4c5d8c0032ff6c1344c2f5e7ceea8c5dffd6be95b748171d347b1a20689e0c0cc5233f0ceb992f259c57d65436ad5
@@ -1,3 +1,19 @@
1
1
  module Applitools::Connectivity
2
- Proxy = Struct.new(:uri, :user, :password)
2
+ Proxy = Struct.new(:uri, :user, :password) do
3
+ def to_hash
4
+ result = {}
5
+ result[:uri] = uri.is_a?(URI) ? uri : URI(uri)
6
+ result[:user] = user unless user.nil?
7
+ result[:password] = password unless password.nil?
8
+ result
9
+ end
10
+
11
+ def uri=(value)
12
+ if value.is_a? URI
13
+ super
14
+ else
15
+ super URI.parse(value)
16
+ end
17
+ end
18
+ end
3
19
  end
@@ -22,7 +22,7 @@ module Applitools::Connectivity
22
22
 
23
23
  attr_accessor :server_url, :api_key
24
24
  attr_reader :endpoint_url
25
- attr_accessor :proxy
25
+ attr_reader :proxy
26
26
 
27
27
  def server_url=(url)
28
28
  @server_url = url.nil? ? DEFAULT_SERVER_URL : url
@@ -37,6 +37,14 @@ module Applitools::Connectivity
37
37
  self.proxy = Proxy.new uri, user, password
38
38
  end
39
39
 
40
+ def proxy=(value)
41
+ unless value.nil? || value.is_a?(Applitools::Connectivity::Proxy)
42
+ raise Applitools::EyesIllegalArgument.new 'Expected value to be instance of Applitools::Connectivity::Proxy,' \
43
+ ' got #{value.class}'
44
+ end
45
+ @proxy = value
46
+ end
47
+
40
48
  def match_window(session, data)
41
49
  # Notice that this does not include the screenshot.
42
50
  json_data = Oj.dump(Applitools::Utils.camelcase_hash_keys(data.to_hash)).force_encoding('BINARY')
@@ -86,7 +94,11 @@ module Applitools::Connectivity
86
94
  end
87
95
 
88
96
  def request(url, method, options = {})
89
- Faraday::Connection.new(url, ssl: { ca_file: SSL_CERT }, proxy: @proxy || nil).send(method) do |req|
97
+ Faraday::Connection.new(
98
+ url,
99
+ ssl: { ca_file: SSL_CERT },
100
+ proxy: @proxy.nil? ? nil : @proxy.to_hash
101
+ ).send(method) do |req|
90
102
  req.options.timeout = DEFAULT_TIMEOUT
91
103
  req.headers = DEFAULT_HEADERS.merge(options[:headers] || {})
92
104
  req.headers['Content-Type'] = options[:content_type] if options.key?(:content_type)
@@ -1,6 +1,7 @@
1
1
  require 'securerandom'
2
2
  module Applitools
3
3
  class BatchInfo
4
+ attr_accessor :name, :sterted_at, :id
4
5
  def initialize(name = nil, started_at = Time.now)
5
6
  @name = name
6
7
  @started_at = started_at
@@ -14,5 +15,9 @@ module Applitools
14
15
  started_at: @started_at.iso8601
15
16
  }
16
17
  end
18
+
19
+ def to_s
20
+ to_hash.to_s
21
+ end
17
22
  end
18
23
  end
@@ -32,9 +32,10 @@ module Applitools
32
32
 
33
33
  attr_accessor :app_name, :baseline_name, :branch_name, :parent_branch_name, :batch, :agent_id, :full_agent_id,
34
34
  :match_timeout, :save_new_tests, :save_failed_tests, :failure_reports, :default_match_settings, :cut_provider,
35
- :scale_ratio, :host_os, :host_app, :base_line_name, :position_provider, :viewport_size, :verbose_results
35
+ :scale_ratio, :host_os, :host_app, :base_line_name, :position_provider, :viewport_size, :verbose_results,
36
+ :inferred_environment
36
37
 
37
- abstract_attr_accessor :base_agent_id, :inferred_environment
38
+ abstract_attr_accessor :base_agent_id
38
39
  abstract_method :capture_screenshot, true
39
40
  abstract_method :title, true
40
41
  abstract_method :set_viewport_size, true
@@ -53,6 +54,7 @@ module Applitools
53
54
  @user_inputs = UserInputArray.new
54
55
  self.app_output_provider = Object.new
55
56
  self.verbose_results = false
57
+ @inferred_environment = nil
56
58
 
57
59
  get_app_output_method = ->(r, s) { get_app_output_with_screenshot r, s }
58
60
 
@@ -65,6 +67,14 @@ module Applitools
65
67
  @default_match_settings = { match_level: MATCH_LEVEL[:strict], exact: nil }
66
68
  end
67
69
 
70
+ def batch
71
+ if @batch.nil?
72
+ logger.info 'No batch set'
73
+ self.batch = BatchInfo.new
74
+ end
75
+ @batch
76
+ end
77
+
68
78
  def full_agent_id
69
79
  if !agent_id.nil? && !agent_id.empty?
70
80
  "#{agent_id} [#{base_agent_id}]"
@@ -396,13 +406,8 @@ module Applitools
396
406
  self.viewport_size = get_viewport_size
397
407
  end
398
408
 
399
- if batch.nil?
400
- logger.info 'No batch set'
401
- test_batch = BatchInfo.new
402
- else
403
- logger.info "Batch is #{batch}"
404
- test_batch = batch
405
- end
409
+ logger.info "Batch is #{batch}"
410
+ test_batch = batch
406
411
 
407
412
  app_env = app_environment
408
413
 
@@ -1,3 +1,3 @@
1
1
  module Applitools
2
- VERSION = '3.2.1'.freeze
2
+ VERSION = '3.2.2'.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.2.1
4
+ version: 3.2.2
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-04-13 00:00:00.000000000 Z
11
+ date: 2017-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oily_png