eyes_core 3.15.2.beta → 3.15.3.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: 837d63c899d50ca985e2607ae9ef2f74e9aaff06db5efcdf9e03b5c7f30dbedb
4
- data.tar.gz: a1bd7821a06516b85b4ac745bff18c0beb26bb1088e4372b07b4298ab570c23e
3
+ metadata.gz: 6b771819a8907868bd80497e70a6bd10e60f7adb482f180c9de3968890883d96
4
+ data.tar.gz: da648cc4122596dfd58efc24e3699f94b54a9aff5ea9eaae4027801ee9efc520
5
5
  SHA512:
6
- metadata.gz: 396c179c201f8929266cb290fde60ac1b03ce5499d6740eeb373ab115acf75c36284e04d931c97495a7a00410004e06a6d759760e85a4432417d88d5da21f176
7
- data.tar.gz: c2e08021ab270424fc88bf63359664878e6bb1444794db58e11111e758b9b43d353ac53eb5d44dbb8cbee0d631667759bf9a3264e944c84cb097f3865db7b710
6
+ metadata.gz: bc92c6029cdd54ed6d15a2ba41c6f0951d3687add39d3eb9526c4d9ce0c2362b7c3679a541a751695046ab6fa9fa6fd5d585c11a06cbc7b26e9c1faff82af8b4
7
+ data.tar.gz: 0d90a2e75842ef1c1e9dca07bb7058c65d19bbeb209c2bc1f6fb69f010b3fbc930d92e12d58c0862ef8457a24bdf5e1f928bfa501eb18c833fccf4ee08e190d2
@@ -41,7 +41,7 @@ module Applitools::Connectivity
41
41
 
42
42
  def rendering_info
43
43
  response = get(server_url + RENDER_INFO_PATH, content_type: 'application/json')
44
- raise Applitools::EyesError, 'Error getting render info' unless response.status == HTTP_STATUS_CODES[:ok]
44
+ raise Applitools::EyesError, "Error getting render info (#{response.status}})" unless response.status == HTTP_STATUS_CODES[:ok]
45
45
  Oj.load response.body
46
46
  end
47
47
 
@@ -1,8 +1,10 @@
1
+ require 'applitools/core/eyes_configuration_dsl'
2
+
1
3
  module Applitools
2
4
  class AbstractConfiguration
3
5
  attr_reader :config_hash
4
6
  attr_accessor :validation_errors
5
- extend Applitools::Concerns::EyesConfigurationDSL
7
+ extend Applitools::EyesConfigurationDSL
6
8
 
7
9
  def initialize
8
10
  @config_hash = {}
@@ -1,5 +1,5 @@
1
1
  require 'applitools/core/rectangle_size'
2
- require 'applitools/core/concerns/session_types'
2
+ require 'applitools/core/session_types'
3
3
  require 'applitools/core/batch_info'
4
4
 
5
5
  module Applitools
@@ -60,7 +60,7 @@ module Applitools
60
60
  string_field :agent_id
61
61
  string_field :environment_name
62
62
  boolean_field :save_diffs
63
- enum_field :session_type, Applitools::Concerns::SessionTypes.enum_values
63
+ enum_field :session_type, Applitools::SessionTypes.enum_values
64
64
  object_field :batch_info, Applitools::BatchInfo
65
65
  string_field :baseline_env_name
66
66
  string_field :app_name
@@ -0,0 +1,158 @@
1
+ module Applitools
2
+ module EyesConfigurationDSL
3
+ def methods_to_delegate
4
+ @methods_to_delegate ||= []
5
+ end
6
+
7
+ def accessor_methods
8
+ @accessor_methods ||= []
9
+ end
10
+
11
+ def collect_method(field_name)
12
+ accessor_methods.push field_name.to_sym
13
+ methods_to_delegate.push field_name.to_sym
14
+ methods_to_delegate.push "#{field_name}=".to_sym
15
+ end
16
+
17
+ def boolean_field(field_name)
18
+ collect_method field_name
19
+ define_method(field_name) do
20
+ return true if config_hash[field_name]
21
+ false
22
+ end
23
+
24
+ define_method("#{field_name}=") do |*args|
25
+ value = args.shift
26
+ if value
27
+ config_hash[field_name] = true
28
+ else
29
+ config_hash[field_name] = false
30
+ end
31
+ end
32
+
33
+ define_method("defined_#{field_name}?") do
34
+ true
35
+ end
36
+ end
37
+
38
+ def string_field(field_name)
39
+ collect_method field_name
40
+ define_method(field_name) do
41
+ return '' unless config_hash[field_name.to_sym].is_a? String
42
+ config_hash[field_name.to_sym]
43
+ end
44
+
45
+ define_method("#{field_name}=") do |*args|
46
+ value = args.shift
47
+ raise Applitools::EyesIllegalArgument, "Expected #{field_name} to be a String but got #{value.class} instead" unless value.is_a? String
48
+ config_hash[field_name.to_sym] = value.freeze
49
+ end
50
+
51
+ define_method("defined_#{field_name}?") do
52
+ !send(field_name).empty?
53
+ end
54
+ end
55
+
56
+ # def rectangle_size_field(field_name)
57
+ # collect_method field_name
58
+ # define_method(field_name) do
59
+ # return Applitools::RectangleSize.from_hash(width: 0, height: 0) unless config_hash[field_name.to_sym].is_a? Applitools::RectangleSize
60
+ # config_hash[field_name.to_sym]
61
+ # end
62
+ #
63
+ # define_method("#{field_name}=") do |*args|
64
+ # value = args.shift
65
+ # raise Applitools::EyesIllegalArgument, "Expected #{field_name} to be an Applitools::RectangleClass but got #{value.class} instead" unless value.is_a? Applitools::RectangleSize
66
+ # config_hash[field_name.to_sym] = value
67
+ # end
68
+ #
69
+ # define_method("defined_#{field_name}?") do
70
+ # send(field_name).square > 0
71
+ # end
72
+ # end
73
+
74
+ # def batch_info_field(field_name)
75
+ # collect_method field_name
76
+ # define_method(field_name) do
77
+ # config_hash[field_name.to_sym]
78
+ # end
79
+ #
80
+ # define_method("#{field_name}=") do |*args|
81
+ # value = args.shift
82
+ # raise(
83
+ # Applitools::EyesIllegalArgument,
84
+ # "Expected Applitools::BatchInfo but got #{value.class}"
85
+ # ) unless value.is_a? Applitools::BatchInfo
86
+ # config_hash[field_name.to_sym] = value
87
+ # end
88
+ #
89
+ # define_method("defined_#{field_name}?") do
90
+ # value = send(field_name)
91
+ # value.is_a? Applitools::BatchInfo
92
+ # end
93
+ # end
94
+
95
+ def object_field(field_name, klass)
96
+ collect_method field_name
97
+ define_method(field_name) do
98
+ config_hash[field_name.to_sym]
99
+ end
100
+ define_method("#{field_name}=") do |*args|
101
+ value = args.shift
102
+ raise(
103
+ Applitools::EyesIllegalArgument,
104
+ "Expected #{klass} but got #{value.class}"
105
+ ) unless value.is_a? klass
106
+ config_hash[field_name.to_sym] = value
107
+ end
108
+ define_method("defined_#{field_name}?") do
109
+ value = send(field_name)
110
+ value.is_a? klass
111
+ end
112
+ end
113
+
114
+ def int_field(field_name)
115
+ collect_method(field_name)
116
+ define_method(field_name) do
117
+ config_hash[field_name.to_sym]
118
+ # value =
119
+ # return value if value.is_a? Integer
120
+ # 0
121
+ end
122
+
123
+ define_method("#{field_name}=") do |*args|
124
+ value = args.shift
125
+ return config_hash[field_name.to_sym] = value if value.is_a? Integer
126
+ return config_hash[field_name.to_sym] = value.to_i if value.respond_to? :to_i
127
+ raise Applitools::EyesIllegalArgument, "Expected #{field_name} to be an Integer"
128
+ end
129
+
130
+ define_method("defined_#{field_name}?") do
131
+ value = send(field_name)
132
+ value.is_a? Integer
133
+ end
134
+ end
135
+
136
+ def enum_field(field_name, available_values_array)
137
+ collect_method(field_name)
138
+
139
+ define_method(field_name) do
140
+ config_hash[field_name.to_sym]
141
+ end
142
+
143
+ define_method("#{field_name}=") do |*args|
144
+ value = args.shift
145
+ raise(
146
+ Applitools::EyesIllegalArgument,
147
+ "Unknown #{field_name} #{value}. Allowed session types: " \
148
+ "#{available_values_array.join(', ')}"
149
+ ) unless available_values_array.include? value
150
+ config_hash[field_name.to_sym] = value
151
+ end
152
+
153
+ define_method("defined_#{field_name}?") do
154
+ available_values_array.include? send(field_name)
155
+ end
156
+ end
157
+ end
158
+ end
@@ -0,0 +1,11 @@
1
+ module Applitools
2
+ module SessionTypes
3
+ extend self
4
+ SEQUENTIAL = 'SEQUENTIAL'
5
+ PROGRESSION = 'PROGRESSION'
6
+
7
+ def enum_values
8
+ [SEQUENTIAL, PROGRESSION]
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '3.15.2.beta'.freeze
4
+ VERSION = '3.15.3.beta'.freeze
5
5
  end
data/lib/eyes_core.rb CHANGED
@@ -64,7 +64,6 @@ require_relative 'applitools/extensions'
64
64
  require_relative 'applitools/version'
65
65
  require_relative 'applitools/chunky_png_patch'
66
66
 
67
- Applitools.require_dir 'core/concerns'
68
67
  Applitools.require_dir 'core'
69
68
  Applitools.require_dir 'connectivity'
70
69
  Applitools.require_dir 'utils'
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.2.beta
4
+ version: 3.15.3.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-03-31 00:00:00.000000000 Z
11
+ date: 2019-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oily_png
@@ -265,12 +265,10 @@ files:
265
265
  - lib/applitools/core/argument_guard.rb
266
266
  - lib/applitools/core/batch_info.rb
267
267
  - lib/applitools/core/class_name.rb
268
- - lib/applitools/core/concerns/eyes_configuration_dsl.rb
269
- - lib/applitools/core/concerns/jsonable.rb
270
- - lib/applitools/core/concerns/session_types.rb
271
268
  - lib/applitools/core/debug_screenshot_provider.rb
272
269
  - lib/applitools/core/eyes_base.rb
273
270
  - lib/applitools/core/eyes_base_configuration.rb
271
+ - lib/applitools/core/eyes_configuration_dsl.rb
274
272
  - lib/applitools/core/eyes_screenshot.rb
275
273
  - lib/applitools/core/fixed_cut_provider.rb
276
274
  - lib/applitools/core/fixed_scale_provider.rb
@@ -279,6 +277,7 @@ files:
279
277
  - lib/applitools/core/future.rb
280
278
  - lib/applitools/core/hash_extension.rb
281
279
  - lib/applitools/core/helpers.rb
280
+ - lib/applitools/core/jsonable.rb
282
281
  - lib/applitools/core/location.rb
283
282
  - lib/applitools/core/match_level_setter.rb
284
283
  - lib/applitools/core/match_result.rb
@@ -295,6 +294,7 @@ files:
295
294
  - lib/applitools/core/screenshot.rb
296
295
  - lib/applitools/core/session.rb
297
296
  - lib/applitools/core/session_start_info.rb
297
+ - lib/applitools/core/session_types.rb
298
298
  - lib/applitools/core/test_results.rb
299
299
  - lib/applitools/core/text_trigger.rb
300
300
  - lib/applitools/core/trigger.rb
@@ -1,189 +0,0 @@
1
- module Applitools
2
- module Concerns
3
- module EyesConfigurationDSL
4
- def methods_to_delegate
5
- @methods_to_delegate ||= []
6
- end
7
-
8
- def accessor_methods
9
- @accessor_methods ||= []
10
- end
11
-
12
- def collect_method(field_name)
13
- accessor_methods.push field_name.to_sym
14
- methods_to_delegate.push field_name.to_sym
15
- methods_to_delegate.push "#{field_name}=".to_sym
16
- end
17
-
18
- def boolean_field(field_name)
19
- collect_method field_name
20
- define_method(field_name) do
21
- return true if config_hash[field_name]
22
- false
23
- end
24
-
25
- define_method("#{field_name}=") do |*args|
26
- value = args.shift
27
- if value
28
- config_hash[field_name] = true
29
- else
30
- config_hash[field_name] = false
31
- end
32
- end
33
-
34
- define_method("defined_#{field_name}?") do
35
- true
36
- end
37
- end
38
-
39
- def string_field(field_name)
40
- collect_method field_name
41
- define_method(field_name) do
42
- return '' unless config_hash[field_name.to_sym].is_a? String
43
- config_hash[field_name.to_sym]
44
- end
45
-
46
- define_method("#{field_name}=") do |*args|
47
- value = args.shift
48
- raise Applitools::EyesIllegalArgument, "Expected #{field_name} to be a String but got #{value.class} instead" unless value.is_a? String
49
- config_hash[field_name.to_sym] = value.freeze
50
- end
51
-
52
- define_method("defined_#{field_name}?") do
53
- !send(field_name).empty?
54
- end
55
- end
56
-
57
- # def rectangle_size_field(field_name)
58
- # collect_method field_name
59
- # define_method(field_name) do
60
- # return Applitools::RectangleSize.from_hash(width: 0, height: 0) unless config_hash[field_name.to_sym].is_a? Applitools::RectangleSize
61
- # config_hash[field_name.to_sym]
62
- # end
63
- #
64
- # define_method("#{field_name}=") do |*args|
65
- # value = args.shift
66
- # raise Applitools::EyesIllegalArgument, "Expected #{field_name} to be an Applitools::RectangleClass but got #{value.class} instead" unless value.is_a? Applitools::RectangleSize
67
- # config_hash[field_name.to_sym] = value
68
- # end
69
- #
70
- # define_method("defined_#{field_name}?") do
71
- # send(field_name).square > 0
72
- # end
73
- # end
74
-
75
- # def batch_info_field(field_name)
76
- # collect_method field_name
77
- # define_method(field_name) do
78
- # config_hash[field_name.to_sym]
79
- # end
80
- #
81
- # define_method("#{field_name}=") do |*args|
82
- # value = args.shift
83
- # raise(
84
- # Applitools::EyesIllegalArgument,
85
- # "Expected Applitools::BatchInfo but got #{value.class}"
86
- # ) unless value.is_a? Applitools::BatchInfo
87
- # config_hash[field_name.to_sym] = value
88
- # end
89
- #
90
- # define_method("defined_#{field_name}?") do
91
- # value = send(field_name)
92
- # value.is_a? Applitools::BatchInfo
93
- # end
94
- # end
95
-
96
- def object_field(field_name, klass)
97
- collect_method field_name
98
- define_method(field_name) do
99
- config_hash[field_name.to_sym]
100
- end
101
- define_method("#{field_name}=") do |*args|
102
- value = args.shift
103
- raise(
104
- Applitools::EyesIllegalArgument,
105
- "Expected #{klass} but got #{value.class}"
106
- ) unless value.is_a? klass
107
- config_hash[field_name.to_sym] = value
108
- end
109
- define_method("defined_#{field_name}?") do
110
- value = send(field_name)
111
- value.is_a? klass
112
- end
113
- end
114
-
115
- def int_field(field_name)
116
- collect_method(field_name)
117
- define_method(field_name) do
118
- config_hash[field_name.to_sym]
119
- # value =
120
- # return value if value.is_a? Integer
121
- # 0
122
- end
123
-
124
- define_method("#{field_name}=") do |*args|
125
- value = args.shift
126
- return config_hash[field_name.to_sym] = value if value.is_a? Integer
127
- return config_hash[field_name.to_sym] = value.to_i if value.respond_to? :to_i
128
- raise Applitools::EyesIllegalArgument, "Expected #{field_name} to be an Integer"
129
- end
130
-
131
- define_method("defined_#{field_name}?") do
132
- value = send(field_name)
133
- value.is_a? Integer
134
- end
135
- end
136
-
137
- def enum_field(field_name, available_values_array)
138
- collect_method(field_name)
139
-
140
- define_method(field_name) do
141
- config_hash[field_name.to_sym]
142
- end
143
-
144
- define_method("#{field_name}=") do |*args|
145
- value = args.shift
146
- raise(
147
- Applitools::EyesIllegalArgument,
148
- "Unknown #{field_name} #{value}. Allowed session types: " \
149
- "#{available_values_array.join(', ')}"
150
- ) unless available_values_array.include? value
151
- config_hash[field_name.to_sym] = value
152
- end
153
-
154
- define_method("defined_#{field_name}?") do
155
- available_values_array.include? send(field_name)
156
- end
157
- end
158
-
159
- # def stitch_mode_field(field_name)
160
- # collect_method field_name
161
- # define_method(field_name) do
162
- # config_hash[field_name.to_sym]
163
- # end
164
- #
165
- # define_method("#{field_name}=") do |*args|
166
- # value = args.shift
167
- # raise(
168
- # Applitools::EyesIllegalArgument,
169
- # "Unknown stitch mode #{value}. Allowed session types: " \
170
- # "#{Applitools::Selenium::Concerns::StitchModes::CSS}, " \
171
- # "#{Applitools::Selenium::Concerns::StitchModes::SCROLL}"
172
- # ) unless
173
- # [
174
- # Applitools::Selenium::Concerns::StitchModes::CSS,
175
- # Applitools::Selenium::Concerns::StitchModes::SCROLL
176
- # ].include? value
177
- # config_hash[field_name.to_sym] = value
178
- # end
179
- #
180
- # define_method("defined_#{field_name}?") do
181
- # [
182
- # Applitools::Concerns::SessionTypes::SEQUENTIAL,
183
- # Applitools::Concerns::SessionTypes::PROGRESSION
184
- # ].include? config_hash[field_name.to_sym]
185
- # end
186
- # end
187
- end
188
- end
189
- end
@@ -1,13 +0,0 @@
1
- module Applitools
2
- module Concerns
3
- module SessionTypes
4
- extend self
5
- SEQUENTIAL = 'SEQUENTIAL'
6
- PROGRESSION = 'PROGRESSION'
7
-
8
- def enum_values
9
- [SEQUENTIAL, PROGRESSION]
10
- end
11
- end
12
- end
13
- end