eyes_selenium 2.13.0 → 2.14.0

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
  SHA1:
3
- metadata.gz: f603b15d48721199afd412c0ac75b003c7419ba1
4
- data.tar.gz: 95d4bfa2257872778dea75a96fc412d877e6876c
3
+ metadata.gz: 8d008a6a2abb48a6c633b3c3aadb1586b5af4303
4
+ data.tar.gz: 3148c465e5f3258095557c5ff285d31dcac25e80
5
5
  SHA512:
6
- metadata.gz: 78da07d75facb51ea948e39f586d781d82b17a88e20a46fd08181393d816b616d0fe7e47b3483decb47b028d28b89af8eced65633a5fc5ee5deddc5ce3e7ab6b
7
- data.tar.gz: 3550f72becadce05d6bbc20464b78f2cf1af9418b203b701d26caa295e95a63773bcd10a0b644462c377dd1f409310df589126512b49354563f0824d3b396236
6
+ metadata.gz: 3e77f65816dbd4133e7ac5a5ddecae22804c25b87330a0d84dcc7e6524fcd7a007f8be079ce3a35b26227d83ef0eb878729a45eb05b9f12f4a77fdee2f5cafb0
7
+ data.tar.gz: 59a7d7d1840360d8fdf33092279a881d366513171df41be97eeb6e5f65a18ed477fa923389dbe97b52dccc457924a7bac34c6e25c19079fcb98bb681bf216bbb
@@ -1,7 +1,6 @@
1
1
  require 'eyes_selenium'
2
- require 'openssl'
2
+ require 'appium_lib'
3
3
 
4
- OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
5
4
  ##
6
5
  # Based on Appium example: https://github.com/appium/appium/blob/master/sample-code/examples/ruby/
7
6
 
@@ -11,7 +10,7 @@ def android_caps
11
10
  deviceName: 'Samsung Galaxy S4 Emulator',
12
11
  platformName: 'Android',
13
12
  platformVersion: 4.4,
14
- app: '/Users/daniel/test/NotesList.apk',
13
+ app: ENV['ANDROID_NOTES_LIST_APP'],
15
14
  appPackage: 'com.example.android.notepad',
16
15
  appActivity: '.NotesList',
17
16
  # orientation: 'landscape',
@@ -23,7 +22,7 @@ def ios_caps
23
22
  deviceName: 'iPhone 6',
24
23
  platformName: 'ios',
25
24
  platformVersion: 8.3,
26
- app: '/Users/daniel/Library/Developer/Xcode/DerivedData/HelloXcode-cldusyhxlaclfkbirmthhbgpchqv/Build/Products/Debug-iphonesimulator/HelloXcode.app',
25
+ app: ENV['IOS_DEMO_APP'],
27
26
  orientation: 'landscape',
28
27
  newCommandTimeout: 300
29
28
  }
@@ -36,12 +35,12 @@ def appium_opts
36
35
  end
37
36
 
38
37
 
39
- @eyes = Applitools::Eyes.new(server_url: 'https://localhost.applitools.com')
38
+ @eyes = Applitools::Eyes.new
40
39
  @eyes.log_handler = Logger.new(STDOUT)
41
40
  @eyes.api_key = ENV['APPLITOOLS_API_KEY']
42
41
  begin
43
- @driver = Appium::Driver.new({caps: android_caps, appium_lib: appium_opts})
44
- # @driver = Appium::Driver.new({caps: ios_caps, appium_lib: appium_opts})
42
+ # @driver = Appium::Driver.new({caps: android_caps, appium_lib: appium_opts})
43
+ @driver = Appium::Driver.new({caps: ios_caps, appium_lib: appium_opts})
45
44
  @driver.start_driver
46
45
  # @driver.driver.rotate :landscape
47
46
  puts "Screen size: #{@driver.driver.manage.window.size}"
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "selenium-webdriver", [">= 2.45.0"]
22
- spec.add_dependency "appium_lib", [">= 6.0.0"]
23
22
  spec.add_dependency "httparty"
24
23
  spec.add_dependency "oily_png", [">= 1.1.0"]
25
24
 
@@ -1,10 +1,10 @@
1
1
  require 'socket'
2
2
  require 'selenium-webdriver'
3
- require 'appium_lib'
4
3
 
5
4
  class Applitools::Driver
6
5
 
7
- # Prepares an image (in place!) for being sent to the Eyes server (e.g., handling rotation, scaling etc.).
6
+ # Rotates the image as necessary. The rotation is either manually forced by passing a value in
7
+ # the +rotation+ parameter, or automatically inferred if the +rotation+ parameter is +nil+.
8
8
  #
9
9
  # +driver+:: +Applitools::Driver+ The driver which produced the screenshot.
10
10
  # +image+:: +ChunkyPNG::Canvas+ The image to normalize.
@@ -12,7 +12,7 @@ class Applitools::Driver
12
12
  # negative values = counter-clockwise, 0 = force no rotation, +nil+ = rotate
13
13
  # automatically when needed.
14
14
  #
15
- def self.normalize_image!(driver, image, rotation)
15
+ def self.normalize_rotation!(driver, image, rotation)
16
16
  EyesLogger.debug "#{__method__}()"
17
17
  if rotation != 0
18
18
  num_quadrants = 0
@@ -125,7 +125,7 @@ class Applitools::Driver
125
125
  # FIXME Check if screenshot_taker is still required
126
126
  screenshot = screenshot_taker ? screenshot_taker.screenshot : driver.screenshot_as(:base64)
127
127
  screenshot = Applitools::Utils::ImageUtils.png_image_from_base64(screenshot)
128
- Applitools::Driver.normalize_image!(self, screenshot, rotation)
128
+ Applitools::Driver.normalize_rotation!(self, screenshot, rotation)
129
129
  case output_type
130
130
  when :base64
131
131
  screenshot = Applitools::Utils::ImageUtils.base64_from_png_image(screenshot)
@@ -128,8 +128,10 @@ class Applitools::Eyes
128
128
 
129
129
  if driver.is_a?(Selenium::WebDriver::Driver)
130
130
  @driver = Applitools::Driver.new(self, {driver: driver})
131
- elsif driver.is_a?(Appium::Driver)
131
+ elsif defined?(Appium::Driver) && driver.is_a?(Appium::Driver)
132
132
  @driver = Applitools::Driver.new(self, {driver: driver.driver, is_mobile_device: true})
133
+ elsif defined?(Watir::Browser) && driver.is_a?(Watir::Browser)
134
+ @driver = Applitools::Driver.new(self, {driver: driver.driver})
133
135
  else
134
136
  unless driver.is_a?(Applitools::Driver)
135
137
  raise Applitools::EyesError.new("Driver is not a Selenium::WebDriver::Driver (#{driver.class.name})")
@@ -276,7 +278,7 @@ class Applitools::Eyes
276
278
 
277
279
  private
278
280
 
279
- def disabled?
281
+ def disabled?
280
282
  is_disabled
281
283
  end
282
284
 
@@ -1,3 +1,3 @@
1
1
  module Applitools
2
- VERSION = '2.13.0'
2
+ VERSION = '2.14.0'
3
3
  end
data/watir_test.rb ADDED
@@ -0,0 +1,21 @@
1
+ require 'eyes_selenium'
2
+ require 'logger'
3
+ require 'watir-webdriver'
4
+
5
+
6
+ browser = Watir::Browser.new
7
+ eyes = Applitools::Eyes.new
8
+ eyes.api_key = ENV['APPLITOOLS_API_KEY']
9
+ eyes.log_handler = Logger.new(STDOUT)
10
+
11
+ begin
12
+ eyes.test(app_name: 'Ruby SDK', test_name: 'Applitools website test', viewport_size: {width: 1024, height: 768}, driver: browser) do |driver|
13
+ driver.get 'http://www.applitools.com'
14
+ eyes.check_window('initial')
15
+ eyes.check_region(:css, '.pricing', 'Pricing button')
16
+ driver.find_element(:css, '.pricing a').click
17
+ eyes.check_window('pricing page')
18
+ end
19
+ ensure
20
+ browser.quit
21
+ 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: 2.13.0
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-29 00:00:00.000000000 Z
11
+ date: 2015-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.45.0
27
- - !ruby/object:Gem::Dependency
28
- name: appium_lib
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 6.0.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: 6.0.0
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: httparty
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -184,6 +170,7 @@ files:
184
170
  - spec/fixtures/static_test_file.html
185
171
  - spec/spec_helper.rb
186
172
  - test_script.rb
173
+ - watir_test.rb
187
174
  homepage: http://www.applitools.com
188
175
  licenses:
189
176
  - Apache License, Version 2.0