eyes_calabash 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.
Files changed (29) hide show
  1. checksums.yaml +5 -5
  2. data/lib/applitools/calabash/calabash_element.rb +2 -0
  3. data/lib/applitools/calabash/calabash_screenshot_provider.rb +2 -0
  4. data/lib/applitools/calabash/environment_detector.rb +2 -0
  5. data/lib/applitools/calabash/eyes.rb +5 -3
  6. data/lib/applitools/calabash/eyes_calabash_android_screenshot.rb +13 -2
  7. data/lib/applitools/calabash/eyes_calabash_ios_screenshot.rb +2 -0
  8. data/lib/applitools/calabash/eyes_calabash_screenshot.rb +2 -0
  9. data/lib/applitools/calabash/eyes_hooks.rb +2 -0
  10. data/lib/applitools/calabash/eyes_settings.rb +2 -0
  11. data/lib/applitools/calabash/full_page_capture_algorithm/android_scroll_view.rb +12 -2
  12. data/lib/applitools/calabash/full_page_capture_algorithm/base.rb +2 -0
  13. data/lib/applitools/calabash/full_page_capture_algorithm/ios_ui_table_view.rb +2 -0
  14. data/lib/applitools/calabash/full_page_capture_algorithm.rb +2 -0
  15. data/lib/applitools/calabash/os_versions.rb +2 -0
  16. data/lib/applitools/calabash/rspec_matchers.rb +2 -0
  17. data/lib/applitools/calabash/steps/android_eyes_session.rb +2 -0
  18. data/lib/applitools/calabash/steps/android_matchers.rb +2 -0
  19. data/lib/applitools/calabash/steps/eyes_session.rb +2 -0
  20. data/lib/applitools/calabash/steps/eyes_settings.rb +2 -0
  21. data/lib/applitools/calabash/steps/ios_eyes_session.rb +2 -0
  22. data/lib/applitools/calabash/steps/ios_matchers.rb +2 -0
  23. data/lib/applitools/calabash/steps/matchers.rb +2 -0
  24. data/lib/applitools/calabash/target.rb +2 -0
  25. data/lib/applitools/calabash/utils.rb +2 -0
  26. data/lib/applitools/calabash_steps.rb +2 -0
  27. data/lib/applitools/version.rb +3 -1
  28. data/lib/eyes_calabash.rb +2 -0
  29. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 64b0df620bd26d01ac3fca5d5cec1b7196cec3c1
4
- data.tar.gz: eaa08651deab7967e5e1a19b4ff907122f798a4d
2
+ SHA256:
3
+ metadata.gz: 11d22966246a25abfe5d1600ce58e77b383b949454a142ec0d2e91522a5d7ffa
4
+ data.tar.gz: e4a6bc88083509e7e0af75acf6b2dcd29243dead9ebfa6f93e0b4a424350af8a
5
5
  SHA512:
6
- metadata.gz: 1856eeec383b3893480bc478ce8dbf17c5c9024584d0fbc00f22656da2363cdc6bd4be76a6ed0eda51faea5989e9fb7f761dd5833af3d06391fac892e904c58e
7
- data.tar.gz: af1af3d348c621cfec5acea47aa8ca7048a5b625c43b5f14a7fa9e8c2e79ad7e7580e0335fae53b3992465bf2d47427ca2201126d61366b4c48eefb1af03af11
6
+ metadata.gz: 0be1a9a0e26d23bc3f5aac622a759e7ec1728a7d8259007e3a22a03a7a6dddab1f249e51c2e81fdbef0161bee82ec0f5a88c9b6a9deec9ad27e13a05ebad693b
7
+ data.tar.gz: 452561e10708fb5d74671d3cbb44e3023f2a910a09d1fea8a32ded7408871ab321f0275053ffdf3c48f2442e09bbde2f0b7d3192b1b2106f5402d751bec6108f
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Applitools
2
4
  module Calabash
3
5
  class CalabashElement
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Applitools
2
4
  module Calabash
3
5
  class CalabashScreenshotProvider
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Applitools
2
4
  module Calabash
3
5
  module EnvironmentDetector
@@ -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
- :debug_screenshot, :debug_screenshot_provider, :tag_for_debug
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.debug_screenshot = false
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 { debug_screenshot }
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
- raise Applitools::EyesIllegalArgument, "Unknown density = #{value}" unless ANDROID_DENSITY[value.to_i]
53
- @scale_factor = ANDROID_DENSITY[value.to_i]
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,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'eyes_calabash_screenshot'
2
4
  module Applitools
3
5
  module Calabash
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: false
2
+
1
3
  module Applitools
2
4
  module Calabash
3
5
  class EyesCalabashScreenshot < Applitools::EyesScreenshot
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  if respond_to?(:Before)
2
4
  Before('@eyes') do |scenario|
3
5
  get_scenario_tags(scenario)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'singleton'
2
4
  require 'securerandom'
3
5
  module Applitools
@@ -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
- Applitools::Calabash::EyesCalabashAndroidScreenshot.new(
42
+ calabash_android_screenshot(
33
43
  Applitools::Screenshot.from_image(stitched_image),
34
- density: screenshot_provider.density
44
+ screenshot_provider.density
35
45
  )
36
46
  end
37
47
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Applitools
2
4
  module Calabash
3
5
  module FullPageCaptureAlgorithm
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'base'
2
4
 
3
5
  module Applitools
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Applitools::Calabash.require_dir 'calabash/full_page_capture_algorithm'
2
4
 
3
5
  module Applitools
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Applitools
2
4
  module Calabash
3
5
  module OsVersions
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/expectations'
2
4
 
3
5
  RSpec::Matchers.define :match_baseline do |expected|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Then(/^set OS$/) do
2
4
  sdk_version = begin
3
5
  perform_action('android_sdk_version')
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Then(/^ignore status bar$/) do
2
4
  raise Applitools::EyesError, '@target is not set' unless @target
3
5
  step %(query element "view id:'statusBarBackground'")
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Then(/^create eyes$/) do
2
4
  eyes_settings = Applitools::Calabash::EyesSettings.instance
3
5
  eyes_settings.eyes ||= Applitools::Calabash::Eyes.new.tap do |eyes|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Given(/^eyes application name is "([^"]*)"$/) do |name|
2
4
  Applitools::Calabash::EyesSettings.instance.app_name = name
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Then(/^set OS$/) do
2
4
  Applitools::Calabash::EyesSettings.instance.eyes.host_os = "iOS #{default_device.ios_major_version}"
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Then(/^the whole screen should match a baseline/) do
2
4
  step %(create target)
3
5
  step %(target should match a baseline)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Then(/^create target$/) do
2
4
  @target = nil
3
5
  @target = Applitools::Calabash::Target.new
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Applitools
2
4
  module Calabash
3
5
  class Target
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Applitools
2
4
  module Calabash
3
5
  module Utils
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Applitools::Calabash.require_environment(
2
4
  'applitools/calabash/steps/matchers',
3
5
  Applitools::Calabash::EnvironmentDetector.current_environment
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: false
2
+
1
3
  module Applitools
2
- VERSION = '3.14.3'.freeze
4
+ VERSION = '3.14.4'.freeze
3
5
  end
data/lib/eyes_calabash.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: false
2
+
1
3
  require 'eyes_core'
2
4
 
3
5
  module Applitools
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyes_calabash
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.14.3
4
+ version: 3.14.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-19 00:00:00.000000000 Z
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 3.14.3
61
+ version: 3.14.4
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 3.14.3
68
+ version: 3.14.4
69
69
  description: Applitools Ruby Calabash SDK
70
70
  email:
71
71
  - team@applitools.com
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  requirements: []
123
123
  rubyforge_project:
124
- rubygems_version: 2.6.14
124
+ rubygems_version: 2.7.7
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Applitools Ruby Calabash SDK