eyes_core 3.14.3 → 3.14.4
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 +5 -5
- data/ext/eyes_core/extconf.rb +2 -0
- data/ext/eyes_core/eyes_core.c +7 -7
- data/ext/eyes_core/eyes_core.h +1 -6
- data/lib/applitools/appium/eyes.rb +12 -0
- data/lib/applitools/appium/initialize_1.9.rb +22 -0
- data/lib/applitools/appium/initialize_2.0.rb +17 -0
- data/lib/applitools/appium/utils.rb +44 -0
- data/lib/applitools/calabash/calabash_element.rb +2 -0
- data/lib/applitools/calabash/calabash_screenshot_provider.rb +2 -0
- data/lib/applitools/calabash/environment_detector.rb +2 -0
- data/lib/applitools/calabash/eyes.rb +5 -3
- data/lib/applitools/calabash/eyes_calabash_android_screenshot.rb +13 -2
- data/lib/applitools/calabash/eyes_calabash_ios_screenshot.rb +2 -0
- data/lib/applitools/calabash/eyes_calabash_screenshot.rb +2 -0
- data/lib/applitools/calabash/eyes_hooks.rb +2 -0
- data/lib/applitools/calabash/eyes_settings.rb +2 -0
- data/lib/applitools/calabash/full_page_capture_algorithm.rb +2 -0
- data/lib/applitools/calabash/full_page_capture_algorithm/android_scroll_view.rb +12 -2
- data/lib/applitools/calabash/full_page_capture_algorithm/base.rb +2 -0
- data/lib/applitools/calabash/full_page_capture_algorithm/ios_ui_table_view.rb +2 -0
- data/lib/applitools/calabash/os_versions.rb +2 -0
- data/lib/applitools/calabash/rspec_matchers.rb +2 -0
- data/lib/applitools/calabash/steps/android_eyes_session.rb +2 -0
- data/lib/applitools/calabash/steps/android_matchers.rb +2 -0
- data/lib/applitools/calabash/steps/eyes_session.rb +2 -0
- data/lib/applitools/calabash/steps/eyes_settings.rb +2 -0
- data/lib/applitools/calabash/steps/ios_eyes_session.rb +2 -0
- data/lib/applitools/calabash/steps/ios_matchers.rb +2 -0
- data/lib/applitools/calabash/steps/matchers.rb +2 -0
- data/lib/applitools/calabash/target.rb +2 -0
- data/lib/applitools/calabash/utils.rb +2 -0
- data/lib/applitools/calabash_steps.rb +2 -0
- data/lib/applitools/capybara/capybara_settings.rb +25 -0
- data/lib/applitools/capybara/driver.rb +39 -0
- data/lib/applitools/chunky_png/resampling.rb +2 -0
- data/lib/applitools/chunky_png_patch.rb +2 -0
- data/lib/applitools/connectivity/proxy.rb +2 -0
- data/lib/applitools/connectivity/server_connector.rb +23 -1
- data/lib/applitools/core/abstract_region.rb +2 -0
- data/lib/applitools/core/app_environment.rb +2 -0
- data/lib/applitools/core/app_output.rb +16 -4
- data/lib/applitools/core/app_output_with_screenshot.rb +2 -0
- data/lib/applitools/core/argument_guard.rb +3 -1
- data/lib/applitools/core/batch_info.rb +13 -5
- data/lib/applitools/core/class_name.rb +2 -0
- data/lib/applitools/core/debug_screenshot_provider.rb +4 -2
- data/lib/applitools/core/eyes_base.rb +45 -9
- data/lib/applitools/core/eyes_screenshot.rb +10 -1
- data/lib/applitools/core/fixed_cut_provider.rb +2 -0
- data/lib/applitools/core/fixed_scale_provider.rb +2 -0
- data/lib/applitools/core/floating_region.rb +10 -0
- data/lib/applitools/core/fluent_interface.rb +8 -1
- data/lib/applitools/core/hash_extension.rb +2 -0
- data/lib/applitools/core/helpers.rb +24 -0
- data/lib/applitools/core/location.rb +19 -1
- data/lib/applitools/core/match_level_setter.rb +2 -0
- data/lib/applitools/core/match_result.rb +2 -0
- data/lib/applitools/core/match_results.rb +2 -0
- data/lib/applitools/core/match_single_check_data.rb +2 -0
- data/lib/applitools/core/match_single_task.rb +2 -0
- data/lib/applitools/core/match_window_data.rb +26 -4
- data/lib/applitools/core/match_window_task.rb +2 -0
- data/lib/applitools/core/mouse_trigger.rb +2 -0
- data/lib/applitools/core/padding_bounds.rb +2 -0
- data/lib/applitools/core/rectangle_size.rb +16 -0
- data/lib/applitools/core/region.rb +32 -9
- data/lib/applitools/core/region_provider.rb +2 -0
- data/lib/applitools/core/screenshot.rb +6 -0
- data/lib/applitools/core/session.rb +2 -0
- data/lib/applitools/core/session_start_info.rb +2 -0
- data/lib/applitools/core/test_results.rb +2 -0
- data/lib/applitools/core/text_trigger.rb +2 -0
- data/lib/applitools/core/trigger.rb +2 -0
- data/lib/applitools/extensions.rb +2 -0
- data/lib/applitools/eyes_logger.rb +4 -2
- data/lib/applitools/method_tracer.rb +2 -0
- data/lib/applitools/rspec/target_matcher.rb +2 -0
- data/lib/applitools/sauce.rb +2 -1
- data/lib/applitools/utils/eyes_selenium_utils.rb +91 -15
- data/lib/applitools/utils/image_delta_compressor.rb +2 -0
- data/lib/applitools/utils/image_utils.rb +2 -0
- data/lib/applitools/utils/utils.rb +14 -0
- data/lib/applitools/version.rb +3 -1
- data/lib/eyes_core.rb +2 -0
- data/lib/eyes_rspec.rb +4 -0
- data/lib/require_utils.rb +2 -0
- metadata +10 -4
- data/lib/applitools/capybara.rb +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: fe32cd2c89eaeca5364e583f6c0027484463d2bd37ad1d9f510f09df4dbafbf7
|
|
4
|
+
data.tar.gz: 86db35f1492c056b6d191c9bee530306e14fea703e3ca2be411e6ea64790c7e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b62c4b68937b383566c02f975296acb3dcebd5548f6db821b2e3856ead3a71f26be77c35b64c3f30848a958bb5f920588eeb99fa9f897c6b9e1172496da0780
|
|
7
|
+
data.tar.gz: c5475b5a9be55894f4caf6ee63e01b44626209f553e17161797c7a27dc17f91c6b67c9b30b0342a4f5f3715f76bdb5f08761ee76a79f3975192b2043b49bde5c
|
data/ext/eyes_core/extconf.rb
CHANGED
data/ext/eyes_core/eyes_core.c
CHANGED
|
@@ -11,8 +11,8 @@ VALUE c_resampling_first_step(VALUE self, VALUE dst_dimension_x, VALUE dst_dimen
|
|
|
11
11
|
unsigned long int source_width, source_height, c_dst_dimension_x, c_dst_dimension_y, w_m, h_m;
|
|
12
12
|
VALUE result_array;
|
|
13
13
|
|
|
14
|
-
source_width = NUM2UINT(rb_funcall(self, rb_intern("width"), 0
|
|
15
|
-
source_height = NUM2UINT(rb_funcall(self, rb_intern("height"), 0
|
|
14
|
+
source_width = NUM2UINT(rb_funcall(self, rb_intern("width"), 0));
|
|
15
|
+
source_height = NUM2UINT(rb_funcall(self, rb_intern("height"), 0));
|
|
16
16
|
|
|
17
17
|
c_dst_dimension_x = NUM2UINT(dst_dimension_x);
|
|
18
18
|
c_dst_dimension_y = NUM2UINT(dst_dimension_y);
|
|
@@ -57,9 +57,9 @@ PIXEL* get_c_array(VALUE self) {
|
|
|
57
57
|
PIXEL* ary;
|
|
58
58
|
VALUE pixels;
|
|
59
59
|
|
|
60
|
-
pixels = rb_funcall(self, rb_intern("pixels"), 0
|
|
61
|
-
w = NUM2UINT(rb_funcall(self, rb_intern("width"), 0
|
|
62
|
-
h = NUM2UINT(rb_funcall(self, rb_intern("height"), 0
|
|
60
|
+
pixels = rb_funcall(self, rb_intern("pixels"), 0);
|
|
61
|
+
w = NUM2UINT(rb_funcall(self, rb_intern("width"), 0));
|
|
62
|
+
h = NUM2UINT(rb_funcall(self, rb_intern("height"), 0));
|
|
63
63
|
ary = (PIXEL*)malloc( w*h*sizeof(PIXEL));
|
|
64
64
|
|
|
65
65
|
for(i=0; i<w*h; i++) {
|
|
@@ -95,8 +95,8 @@ BYTE interpolate_char(double t, BYTE c0, BYTE c1, BYTE c2, BYTE c3) {
|
|
|
95
95
|
return (BYTE)(res);
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
PIXEL raw_merge_pixels(PIXEL* merge_pixels, unsigned int size) {
|
|
99
|
-
unsigned int i, real_colors, acum_r, acum_g, acum_b, acum_a;
|
|
98
|
+
PIXEL raw_merge_pixels(PIXEL* merge_pixels, unsigned long int size) {
|
|
99
|
+
unsigned long int i, real_colors, acum_r, acum_g, acum_b, acum_a;
|
|
100
100
|
BYTE new_r, new_g, new_b, new_a;
|
|
101
101
|
PIXEL pix;
|
|
102
102
|
|
data/ext/eyes_core/eyes_core.h
CHANGED
|
@@ -13,11 +13,6 @@ typedef unsigned char BYTE; // Bytes use 8 bits unsigned integers
|
|
|
13
13
|
#define BUILD_PIXEL(r, g, b, a) (((PIXEL) (r) << 24) + ((PIXEL) (g) << 16) + ((PIXEL) (b) << 8) + (PIXEL) (a))
|
|
14
14
|
#define INT8_MULTIPLY(a, b) (((((a) * (b) + 0x80) >> 8) + ((a) * (b) + 0x80)) >> 8)
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
void Init_resampling();
|
|
19
|
-
|
|
20
|
-
|
|
21
16
|
BYTE interpolate_char(double, BYTE, BYTE, BYTE, BYTE);
|
|
22
17
|
|
|
23
18
|
PIXEL* get_bicubic_points(PIXEL*, unsigned long int, unsigned long int, unsigned long int, unsigned long int);
|
|
@@ -27,7 +22,7 @@ VALUE c_resampling_first_step(VALUE, VALUE, VALUE);
|
|
|
27
22
|
VALUE get_ruby_array(VALUE, PIXEL*, unsigned long int);
|
|
28
23
|
PIXEL get_line_pixel(PIXEL*, unsigned long int, long int, unsigned long int);
|
|
29
24
|
PIXEL get_column_pixel(PIXEL*, unsigned long int, long int, unsigned long int, unsigned long int);
|
|
30
|
-
PIXEL raw_merge_pixels(PIXEL*, unsigned int);
|
|
25
|
+
PIXEL raw_merge_pixels(PIXEL*, unsigned long int);
|
|
31
26
|
PIXEL* c_scale_points(PIXEL*, unsigned long int, unsigned long int, unsigned long int, unsigned long int);
|
|
32
27
|
|
|
33
28
|
#endif
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: false
|
|
2
|
+
|
|
3
|
+
module Applitools::Appium
|
|
4
|
+
module Eyes
|
|
5
|
+
def perform_driver_settings_for_appium_driver
|
|
6
|
+
self.region_visibility_strategy = Applitools::Selenium::NopRegionVisibilityStrategy.new
|
|
7
|
+
self.force_driver_resolution_as_viewport_size = true
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
private :perform_driver_settings_for_appium_driver
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: false
|
|
2
|
+
|
|
3
|
+
module Applitools::Appium
|
|
4
|
+
module Init19
|
|
5
|
+
extend self
|
|
6
|
+
|
|
7
|
+
def init
|
|
8
|
+
Applitools::Utils::EyesSeleniumUtils.module_eval do
|
|
9
|
+
alias_method :super_mobile_device?, :mobile_device?
|
|
10
|
+
alias_method :super_android?, :android?
|
|
11
|
+
alias_method :super_ios?, :ios?
|
|
12
|
+
alias_method :super_platform_version, :platform_version
|
|
13
|
+
alias_method :super_current_scroll_position, :current_scroll_position
|
|
14
|
+
include Applitools::Appium::Utils
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Applitools::Selenium::Eyes.class_eval do
|
|
18
|
+
include Applitools::Appium::Eyes
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: false
|
|
2
|
+
|
|
3
|
+
module Applitools::Appium
|
|
4
|
+
module Init20
|
|
5
|
+
extend self
|
|
6
|
+
def init
|
|
7
|
+
Applitools::Utils::EyesSeleniumUtils.module_eval do
|
|
8
|
+
prepend Applitools::Appium::Utils
|
|
9
|
+
extend self
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
Applitools::Selenium::Eyes.class_eval do
|
|
13
|
+
prepend Applitools::Appium::Eyes
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: false
|
|
2
|
+
|
|
3
|
+
module Applitools::Appium
|
|
4
|
+
module Utils
|
|
5
|
+
# true if test is running on mobile device
|
|
6
|
+
def mobile_device?
|
|
7
|
+
return nil unless defined?(Appium::Driver)
|
|
8
|
+
return $driver if $driver && $driver.is_a?(Appium::Driver)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# true if test is running on Android device
|
|
12
|
+
def android?(driver)
|
|
13
|
+
driver.respond_to?(:appium_device) && driver.appium_device == :android
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# true if test is running on iOS device
|
|
17
|
+
def ios?(driver)
|
|
18
|
+
driver.respond_to?(:appium_device) && driver.appium_device == :ios
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @param [Applitools::Selenium::Driver] driver
|
|
22
|
+
def platform_version(driver)
|
|
23
|
+
driver.respond_to?(:caps) && driver.caps[:platformVersion]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# def current_position
|
|
27
|
+
# result = nil
|
|
28
|
+
# begin
|
|
29
|
+
# logger.info 'current_position()'
|
|
30
|
+
# result = Applitools::Utils::EyesSeleniumUtils.current_scroll_position(executor)
|
|
31
|
+
# logger.info "Current position: #{result}"
|
|
32
|
+
# rescue Applitools::EyesDriverOperationException
|
|
33
|
+
# result = Applitools::Location::TOP_LEFT
|
|
34
|
+
# end
|
|
35
|
+
# result
|
|
36
|
+
# end
|
|
37
|
+
|
|
38
|
+
def current_scroll_position(driver)
|
|
39
|
+
super
|
|
40
|
+
rescue
|
|
41
|
+
Applitools::Location::TOP_LEFT
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: false
|
|
2
|
+
|
|
1
3
|
module Applitools
|
|
2
4
|
module Calabash
|
|
3
5
|
class Eyes < Applitools::EyesBase
|
|
4
6
|
attr_accessor :device_pixel_ratio, :full_page_capture_algorithm, :base_agent_id, :title,
|
|
5
|
-
:
|
|
7
|
+
:debug_screenshots, :debug_screenshot_provider, :tag_for_debug
|
|
6
8
|
attr_reader :context
|
|
7
9
|
|
|
8
10
|
def initialize(server_url = Applitools::Connectivity::ServerConnector::DEFAULT_SERVER_URL)
|
|
9
11
|
super
|
|
10
12
|
self.base_agent_id = "eyes.calabash.ruby/#{Applitools::VERSION}".freeze
|
|
11
|
-
self.
|
|
13
|
+
self.debug_screenshots = false
|
|
12
14
|
self.debug_screenshot_provider = Applitools::DebugScreenshotProvider.new
|
|
13
15
|
.tag_access { tag_for_debug }
|
|
14
|
-
.debug_flag_access {
|
|
16
|
+
.debug_flag_access { debug_screenshots }
|
|
15
17
|
end
|
|
16
18
|
|
|
17
19
|
def open(options = {})
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative 'eyes_calabash_screenshot'
|
|
2
4
|
module Applitools
|
|
3
5
|
module Calabash
|
|
4
6
|
class EyesCalabashAndroidScreenshot < ::Applitools::Calabash::EyesCalabashScreenshot
|
|
7
|
+
extend Forwardable
|
|
8
|
+
def_delegators 'Applitools::EyesLogger', :logger
|
|
9
|
+
|
|
5
10
|
ANDROID_DENSITY = {
|
|
6
11
|
120 => 0.75,
|
|
7
12
|
160 => 1,
|
|
@@ -9,9 +14,14 @@ module Applitools
|
|
|
9
14
|
240 => 1.5,
|
|
10
15
|
320 => 2,
|
|
11
16
|
480 => 3,
|
|
17
|
+
560 => 3.5,
|
|
12
18
|
640 => 4
|
|
13
19
|
}.freeze
|
|
14
20
|
|
|
21
|
+
DENSITY_DEFAULT = 160
|
|
22
|
+
|
|
23
|
+
class UnknownDeviceDensity < ::Applitools::EyesError; end
|
|
24
|
+
|
|
15
25
|
def initialize(*args)
|
|
16
26
|
options = if args.last.is_a? Hash
|
|
17
27
|
args.pop
|
|
@@ -49,8 +59,9 @@ module Applitools
|
|
|
49
59
|
end
|
|
50
60
|
|
|
51
61
|
def density=(value)
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
logger.warn("Trying to set unknown device density - #{value}") unless
|
|
63
|
+
ANDROID_DENSITY.keys.include?(value.to_i)
|
|
64
|
+
@scale_factor = value.to_f / DENSITY_DEFAULT
|
|
54
65
|
end
|
|
55
66
|
end
|
|
56
67
|
end
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative 'base'
|
|
2
4
|
module Applitools
|
|
3
5
|
module Calabash
|
|
4
6
|
module FullPageCaptureAlgorithm
|
|
7
|
+
module CalabashAndroidScreenshot
|
|
8
|
+
def calabash_android_screenshot(screenshot, density)
|
|
9
|
+
Applitools::Calabash::EyesCalabashAndroidScreenshot.new(
|
|
10
|
+
screenshot, density: density
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
5
14
|
class AndroidScrollView < Base
|
|
15
|
+
include CalabashAndroidScreenshot
|
|
6
16
|
def initialize(*args)
|
|
7
17
|
super
|
|
8
18
|
@entire_content = nil
|
|
@@ -29,9 +39,9 @@ module Applitools
|
|
|
29
39
|
|
|
30
40
|
restore_original_position
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
calabash_android_screenshot(
|
|
33
43
|
Applitools::Screenshot.from_image(stitched_image),
|
|
34
|
-
|
|
44
|
+
screenshot_provider.density
|
|
35
45
|
)
|
|
36
46
|
end
|
|
37
47
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Applitools
|
|
4
|
+
module Selenium
|
|
5
|
+
module Capybara
|
|
6
|
+
module CapybaraSettings
|
|
7
|
+
# Registers Capybara driver which will be used by eyes and sets it as default Capybara driver.
|
|
8
|
+
# The name of the driver is :eyes, and the driver is a descendant of class Capybara::Selenium::Driver.
|
|
9
|
+
# Options are eventually passed to drivers constructor
|
|
10
|
+
# @param [Hash] options
|
|
11
|
+
# @example
|
|
12
|
+
# Applitools.register_capybara_driver :browser => :chrome
|
|
13
|
+
# @example
|
|
14
|
+
# Applitools.register_capybara_driver :browser => :remote, :url => 'remote_url', :desired_capabilities => {}
|
|
15
|
+
def register_capybara_driver(options = {})
|
|
16
|
+
::Capybara.register_driver :eyes do |app|
|
|
17
|
+
Applitools::Selenium::Capybara::Driver.new app, options
|
|
18
|
+
end
|
|
19
|
+
::Capybara.default_driver = :eyes
|
|
20
|
+
::Capybara.javascript_driver = :eyes
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|