eyes_selenium 3.15.9.beta → 3.15.10.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: c1726416c0ff054135212015895d59d800cf4df87f84c58df0fc646d0aa873f3
4
- data.tar.gz: 9e3602e2481d33ab9c1d5c3fdf6644e85aa2c319aa8a8dfbf33b72bf9052f73e
3
+ metadata.gz: 3e0a6f39e7fb52685d58326ce17ea7504cf5fbd937e652f433e317e1b3cf6b10
4
+ data.tar.gz: 60323ba3ec38f81e1dd4e625f0a174bb9f9f231d034619d55076853379be6ecb
5
5
  SHA512:
6
- metadata.gz: 8eed00fb038b06b2e1977b8b834cd37874d0918141c9641c57698151484bb85908ff261e84648af407bda9d6fe6eeffdb158378741c7cbffe57a92d34bc4fbb6
7
- data.tar.gz: 3c6b41c24f16d650a4b416c6accfa9f79f50cb7dca3aeb65c435106158bd24e7f123e7bae05b39414644a856e347d3940d68c7d3fa87ea54b63e180d184fa9a7
6
+ metadata.gz: 3701bd9ce75d1503b66487c462d4bed8659814ecbde82d3f74b1a4c1deb198c950269bcc9778ffb2f205be123b953ecabb80ec20ea75533003f01e8f14ee8fa3
7
+ data.tar.gz: 783bb2ce9cab56451d163844b0c2d8126e9783295e5446e8a8f6bf77487be60376709f1b33e4eb1f25bb8258555abb962dee1fe5b7e1b88ebc02a3db7ac8f397
@@ -2,7 +2,7 @@ module Applitools
2
2
  module Selenium
3
3
  module Scripts
4
4
  PROCESS_RESOURCES = <<'END'
5
-
5
+ // @applitools/dom-snapshot@1.1.2
6
6
  function __processPageAndSerialize() {
7
7
  var processPageAndSerialize = (function () {
8
8
  'use strict';
@@ -94,6 +94,7 @@ function __processPageAndSerialize() {
94
94
  TEXT: 3,
95
95
  DOCUMENT: 9,
96
96
  DOCUMENT_TYPE: 10,
97
+ DOCUMENT_FRAGMENT_NODE: 11,
97
98
  };
98
99
 
99
100
  const domNodes = [
@@ -121,7 +122,7 @@ function __processPageAndSerialize() {
121
122
  function elementNodeFactory(domNodes, elementNode) {
122
123
  let node;
123
124
  const {nodeType} = elementNode;
124
- if (nodeType === NODE_TYPES.ELEMENT) {
125
+ if ([NODE_TYPES.ELEMENT, NODE_TYPES.DOCUMENT_FRAGMENT_NODE].includes(nodeType)) {
125
126
  if (elementNode.nodeName !== 'SCRIPT') {
126
127
  if (
127
128
  elementNode.nodeName === 'STYLE' &&
@@ -137,9 +138,9 @@ function __processPageAndSerialize() {
137
138
  }
138
139
 
139
140
  node = {
140
- nodeType: NODE_TYPES.ELEMENT,
141
+ nodeType: nodeType,
141
142
  nodeName: elementNode.nodeName,
142
- attributes: Object.keys(elementNode.attributes).map(key => {
143
+ attributes: Object.keys(elementNode.attributes || {}).map(key => {
143
144
  let value = elementNode.attributes[key].value;
144
145
  const name = elementNode.attributes[key].localName;
145
146
 
@@ -156,9 +157,21 @@ function __processPageAndSerialize() {
156
157
  ? childrenFactory(domNodes, elementNode.childNodes)
157
158
  : [],
158
159
  };
160
+
161
+ if (elementNode.shadowRoot) {
162
+ node.shadowRootIndex = elementNodeFactory(domNodes, elementNode.shadowRoot);
163
+ }
164
+
159
165
  if (elementNode.checked && !elementNode.attributes.checked) {
160
166
  node.attributes.push({name: 'checked', value: 'checked'});
161
167
  }
168
+ if (
169
+ elementNode.value !== undefined &&
170
+ elementNode.attributes.value === undefined &&
171
+ elementNode.tagName === 'INPUT'
172
+ ) {
173
+ node.attributes.push({name: 'value', value: elementNode.value});
174
+ }
162
175
  }
163
176
  } else if (nodeType === NODE_TYPES.TEXT) {
164
177
  node = {
@@ -213,7 +226,9 @@ function __processPageAndSerialize() {
213
226
  var extractFrames_1 = extractFrames;
214
227
 
215
228
  function uniq(arr) {
216
- return Array.from(new Set(arr)).filter(x => !!x);
229
+ const result = [];
230
+ new Set(arr).forEach(v => v && result.push(v));
231
+ return result;
217
232
  }
218
233
 
219
234
  var uniq_1 = uniq;
@@ -29,7 +29,8 @@ module Applitools
29
29
  self.options = {
30
30
  ignore_caret: true,
31
31
  ignore_mismatch: false,
32
- send_dom: nil
32
+ send_dom: nil,
33
+ script_hooks: { beforeCaptureScreenshot: '' }
33
34
  }
34
35
  reset_for_fullscreen
35
36
  end
@@ -173,6 +174,11 @@ module Applitools
173
174
  self
174
175
  end
175
176
 
177
+ def script_hook(hook)
178
+ options[:script_hooks][:beforeCaptureScreenshot] = hook
179
+ self
180
+ end
181
+
176
182
  def finalize
177
183
  return self unless frame_or_element
178
184
  region = frame_or_element
@@ -9,9 +9,10 @@ module Applitools
9
9
  MAX_ITERATIONS = 100
10
10
 
11
11
  attr_accessor :script, :running_test, :all_blobs, :resource_urls, :resource_cache, :put_cache, :server_connector,
12
- :rendering_info, :request_resources, :dom_url_mod, :result, :region_selectors, :size_mode, :region_to_check
12
+ :rendering_info, :request_resources, :dom_url_mod, :result, :region_selectors, :size_mode,
13
+ :region_to_check, :script_hooks
13
14
 
14
- def initialize(name, script, running_test, resource_cache, put_cache, rendering_info, server_connector, region_selectors, size_mode, region, mod = nil)
15
+ def initialize(name, script, running_test, resource_cache, put_cache, rendering_info, server_connector, region_selectors, size_mode, region, script_hooks, mod = nil)
15
16
  self.result = nil
16
17
  self.script = script
17
18
  self.running_test = running_test
@@ -22,6 +23,7 @@ module Applitools
22
23
  self.region_selectors = region_selectors
23
24
  self.size_mode = size_mode
24
25
  self.region_to_check = region
26
+ self.script_hooks = script_hooks if script_hooks.is_a?(Hash)
25
27
 
26
28
  self.dom_url_mod = mod
27
29
  super(name) do
@@ -168,7 +170,7 @@ module Applitools
168
170
  resources: request_resources,
169
171
  render_info: r_info,
170
172
  browser: {name: running_test.browser_info.browser_type, platform: running_test.browser_info.platform},
171
- script_hooks: nil,
173
+ script_hooks: script_hooks,
172
174
  selectors_to_find_regions_for: region_selectors,
173
175
  send_dom: running_test.eyes.config.send_dom.nil? ? false.to_s : running_test.eyes.config.send_dom.to_s
174
176
  )
@@ -165,6 +165,7 @@ module Applitools
165
165
  region_selectors,
166
166
  size_mod,
167
167
  region_to_check,
168
+ target.options[:script_hooks],
168
169
  mod
169
170
  )
170
171
 
@@ -75,14 +75,12 @@ module Applitools
75
75
  END
76
76
  begin
77
77
  sleep wait_before_screenshots
78
+
78
79
  script_result = driver.execute_async_script(script).freeze
79
80
  mod = Digest::SHA2.hexdigest(script_result)
80
81
 
81
82
  region_x_paths = get_regions_x_paths(target)
82
83
 
83
- # require 'pry'
84
- # binding.pry
85
-
86
84
  test_list.each do |t|
87
85
  t.check(tag, target, script_result.dup, visual_grid_manager, region_x_paths, size_mod, region_to_check, mod)
88
86
  end
@@ -109,8 +107,8 @@ module Applitools
109
107
 
110
108
  def collect_selenium_regions(target)
111
109
  selenium_regions = {:target => []}
112
- # ignore_regions = target.ignored_regions
113
- # floating_regions = target.floating_regions
110
+ ignore_regions = target.ignored_regions
111
+ floating_regions = target.floating_regions
114
112
  target_element = target.region_to_check
115
113
  setup_size_mode(target_element)
116
114
  # selenium_regions.map do |r|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '3.15.9.beta'.freeze
4
+ VERSION = '3.15.10.beta'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyes_selenium
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.15.9.beta
4
+ version: 3.15.10.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-12 00:00:00.000000000 Z
11
+ date: 2019-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eyes_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.15.9.beta
19
+ version: 3.15.10.beta
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.15.9.beta
26
+ version: 3.15.10.beta
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: 1.3.1
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 2.7.9
159
+ rubygems_version: 2.7.7
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Applitools Ruby Selenium SDK