eyes_selenium 1.32.0 → 1.33.0
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 +8 -8
- data/appium_eyes_example.rb +47 -0
- data/lib/eyes_selenium/eyes/agent_connector.rb +1 -1
- data/lib/eyes_selenium/version.rb +1 -1
- data/test_script.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWY0MTNiMDBmZDQxNDkzMDMxZTIzNzExNjE4ZGFiYWVhOGQzZDAzMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDM0MGY4Y2MyMTk2YzBhY2FiY2UyMDhiMGU4MGY0ZTg3ZmI0NzBmYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjQyNTFhMGFjZjA2Y2U0ZmZmNDY0ZTdjZGUyYTVmN2Q4ZDZmMWI1MzAyN2Q0
|
10
|
+
MmVlZjIwM2M0MWM1ZThlMjBlYTAzNTgyMGZhOTNhM2EyMjUwNDg3MjJlYTgx
|
11
|
+
NWNmMWM4NTc5M2QxMzBiZGJhYWFmYmI2MWRmYjAxNWJjZjgzNGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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.
|
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)
|
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.
|
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-
|
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
|