eyes_selenium 1.32.0 → 1.33.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODVjMzAyNzUzNGRiMTIxMDYxNzkyNjc3ZWMwNjE0YWUwODM0YmM1OQ==
4
+ MWY0MTNiMDBmZDQxNDkzMDMxZTIzNzExNjE4ZGFiYWVhOGQzZDAzMg==
5
5
  data.tar.gz: !binary |-
6
- N2I0NjY0MzAyNGEwZjYxYjM0YzIzMDIzOGIyODc2YWFkN2YyMjViZA==
6
+ NDM0MGY4Y2MyMTk2YzBhY2FiY2UyMDhiMGU4MGY0ZTg3ZmI0NzBmYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjBmZDE0ODZlMzg0ZmE3MDlkZTJjY2Q0ZWNiNWIxMjc0MTk3YWIyNTYzZDVh
10
- NWMzNTY5OGRmNjE4MTU3NzI3MTIyNjIzMTU3NDM5NjBlZGI5NDlhMDNiNWY4
11
- YjM0MzI5YjUxNGY3ZWNhYTQxNDZmMTdiMGI2NDY4MDZmN2E3ZTc=
9
+ YjQyNTFhMGFjZjA2Y2U0ZmZmNDY0ZTdjZGUyYTVmN2Q4ZDZmMWI1MzAyN2Q0
10
+ MmVlZjIwM2M0MWM1ZThlMjBlYTAzNTgyMGZhOTNhM2EyMjUwNDg3MjJlYTgx
11
+ NWNmMWM4NTc5M2QxMzBiZGJhYWFmYmI2MWRmYjAxNWJjZjgzNGI=
12
12
  data.tar.gz: !binary |-
13
- ODYxODM2NjE0MGM4NzM2ZWE4YTZkMmM4MWY4YTQzOTU5OGIzZTAxOGFmMTM1
14
- NjVhMzczMTRkZWJhODg0NTQ0OWFlZDg2ZWZlODY0N2NiYzZiODFkMjJhMDAw
15
- NDU4NGM1MjM5NGM3YjM3Zjg0N2JjNDgyZTE2NDUyNzU3NDdmMjg=
13
+ NTkyM2U2MmNmYmY5NjI5NDJkZWRmYjAzNmFiMDA1MTYzMGNmMDcyMWEyODJj
14
+ YmY2ODViMTY3NGM0M2NjNmQ5YTE4MWNiNjQwNzBhM2VkNDExMDExNTczNmY3
15
+ MDlhNTg4MTdhMjliMTkxNTgxNzhmZWZlMmZmZmYwMzI3NWY2MzI=
@@ -0,0 +1,47 @@
1
+ require 'eyes_selenium'
2
+
3
+ Applitools::Eyes.config[:apikey] = 'YOUR_API_KEY'
4
+
5
+ ##
6
+ # Based on Appium example: https://github.com/appium/appium/blob/master/sample-code/examples/ruby/
7
+
8
+ desired_capabilities = {
9
+ "device" => "Android",
10
+ "version" => "4.2",
11
+ "app" => "http://appium.s3.amazonaws.com/NotesList.apk",
12
+ "app-package" => "com.example.android.notepad",
13
+ "app-activity" => ".NotesList"
14
+ }
15
+
16
+ def create_note(text)
17
+ @driver.find_element(:name, "New note").click
18
+ @driver.find_element(:tag_name, "textfield").send_keys text
19
+ @eyes.check_window("Note: #{text}")
20
+ @driver.find_element(:name, "Save").click
21
+ end
22
+
23
+ def clear_note_by_text(text)
24
+ @driver.find_element(:name, "#{text}").click
25
+ @driver.find_element(:tag_name, "textfield").clear
26
+ @driver.find_element(:name, "Save").click
27
+ end
28
+
29
+ @eyes = Applitools::Eyes.new
30
+ begin
31
+ @driver = Selenium::WebDriver.for(:remote, :url => 'http://127.0.0.1:4723/wd/hub', :desired_capabilities => desired_capabilities)
32
+ @driver = @eyes.open(app_name: 'Selenium Israel', test_name: 'Appium Notepad', driver: @driver)
33
+ @eyes.check_window("No notes")
34
+
35
+ create_note "I didn't expect a kind of Spanish Inquisition!"
36
+ create_note "Nobody expects the Spanish Inquisition!"
37
+ @eyes.check_window("Two notes")
38
+
39
+ clear_note_by_text "I didn't expect a kind of Spanish Inquisition!"
40
+ @eyes.check_window("One note")
41
+
42
+ @eyes.close
43
+ ensure
44
+ sleep 5
45
+ @eyes.abort_if_not_closed
46
+ @driver.quit
47
+ end
@@ -15,7 +15,7 @@ class Applitools::AgentConnector
15
15
 
16
16
  def match_window(session, data)
17
17
  self.class.headers 'Content-Type' => 'application/octet-stream'
18
- json_data = data.to_hash.to_json.encode('BINARY') # Notice that this does not include the screenshot
18
+ json_data = data.to_hash.to_json.force_encoding('BINARY') # Notice that this does not include the screenshot
19
19
  body = [json_data.length].pack('L>') + json_data + data.screenshot
20
20
 
21
21
  res = self.class.post(uri + "/#{session.id}",basic_auth: auth, body: body)
@@ -1,3 +1,3 @@
1
1
  module Applitools
2
- VERSION = '1.32.0'
2
+ VERSION = '1.33.0'
3
3
  end
data/test_script.rb CHANGED
@@ -3,8 +3,10 @@
3
3
  ## run `./rake install` in applitools root directory (here), this should install the gem (after we release the gem, users will run `gem install eyes` instead
4
4
 
5
5
  require 'eyes_selenium'
6
+ require 'logger'
6
7
 
7
8
  Applitools::Eyes.config[:apikey] = 'YOUR_API_KEY'
9
+ Applitools::Eyes.log_handler = Logger.new(STDOUT)
8
10
 
9
11
  eyes = Applitools::Eyes.new
10
12
 
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: 1.32.0
4
+ version: 1.33.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: 2014-02-17 00:00:00.000000000 Z
11
+ date: 2014-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -135,6 +135,7 @@ files:
135
135
  - LICENSE.txt
136
136
  - README.md
137
137
  - Rakefile
138
+ - appium_eyes_example.rb
138
139
  - certs/cacert.pem
139
140
  - eyes_selenium.gemspec
140
141
  - lib/eyes_selenium.rb