eyes_selenium 2.9.0 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eyes_selenium/eyes/driver.rb +1 -1
- data/lib/eyes_selenium/version.rb +1 -1
- data/spec/driver_passthrough_spec.rb +58 -0
- data/spec/fixtures/static_test_file.html +15 -0
- data/spec/spec_helper.rb +23 -0
- metadata +7 -3
- data/spec/find_spec.rb +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9aa7d7f310d5bbc7cc4e77ec5a056c2890b8486
|
4
|
+
data.tar.gz: f84ed2d2c04ae7fbd2e35dd9744dcfe2283de02d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46d7bc31e33e518f2b052b7f4ea0c8a7350c831a2df1e69a1db437fa33fe88dc588abb24efeca06ff386017df7d1356889f70f8b5dabc5585414071828b7226a
|
7
|
+
data.tar.gz: 4f8e885eb1826283237dbc16d2765503fb1681dfd54ea196d3dcd7b16dbc85c940209d298665c61a8bf085316f63ec61b1e39df789897d3cddf49e6d6f47e585
|
@@ -38,7 +38,7 @@ class Applitools::Driver
|
|
38
38
|
DRIVER_METHODS = [
|
39
39
|
:title, :execute_script, :execute_async_script, :quit, :close, :get,
|
40
40
|
:post, :page_source, :window_handles, :window_handle, :switch_to,
|
41
|
-
:navigate, :manage, :capabilities
|
41
|
+
:navigate, :manage, :capabilities, :current_url
|
42
42
|
]
|
43
43
|
|
44
44
|
## If driver is not provided, Applitools::Driver will raise an EyesError exception.
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'passthrough_methods' do
|
4
|
+
|
5
|
+
before(:each) do |example|
|
6
|
+
@eyes = Applitools::Eyes.new
|
7
|
+
@eyes.api_key = 'dummy_key'
|
8
|
+
driver = Selenium::WebDriver.for :firefox
|
9
|
+
@driver = @eyes.open(app_name: 'the-internet', test_name: example.metadata[:full_description],
|
10
|
+
viewport_size: { width: 800, height: 600 }, driver: driver)
|
11
|
+
@driver.get STATIC_FILE
|
12
|
+
end
|
13
|
+
|
14
|
+
after(:each) do
|
15
|
+
@eyes.close
|
16
|
+
@driver.quit
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'current_url' do
|
20
|
+
url = @driver.current_url
|
21
|
+
expect(url).to eq STATIC_FILE
|
22
|
+
end
|
23
|
+
|
24
|
+
describe 'find_element(s)' do
|
25
|
+
context 'single element' do
|
26
|
+
|
27
|
+
it 'explicit' do
|
28
|
+
link = @driver.find_element(:css, 'a')
|
29
|
+
expect(link).to_not be nil
|
30
|
+
expect(link).to be_a Applitools::Element
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'by hash' do
|
34
|
+
link = @driver.find_element(css: 'a')
|
35
|
+
expect(link).to_not be nil
|
36
|
+
expect(link).to be_a Applitools::Element
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'all elements' do
|
42
|
+
|
43
|
+
it 'explicit' do
|
44
|
+
collection = @driver.find_elements(css: 'a')
|
45
|
+
expect(collection).to_not be nil
|
46
|
+
expect(collection[0]).to be_a Applitools::Element
|
47
|
+
expect(collection[1]).to be_a Applitools::Element
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'by hash' do
|
51
|
+
collection = @driver.find_elements(css: 'a')
|
52
|
+
expect(collection).to_not be nil
|
53
|
+
expect(collection[0]).to be_a Applitools::Element
|
54
|
+
expect(collection[1]).to be_a Applitools::Element
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
|
4
|
+
<a href="#">first link</a>
|
5
|
+
<a href="#">second link</a>
|
6
|
+
<a href="#">third link</a>
|
7
|
+
|
8
|
+
<form id="login">
|
9
|
+
<input name="username" type="text"/>
|
10
|
+
<input name="password" type="password"/>
|
11
|
+
<input name="submit" type="submit" value="Continue!"/>
|
12
|
+
</form>
|
13
|
+
|
14
|
+
</body>
|
15
|
+
</html>
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'eyes_selenium'
|
2
|
+
|
3
|
+
STATIC_FILE = "file://#{File.dirname(__FILE__)}/fixtures/static_test_file.html"
|
4
|
+
|
5
|
+
RSpec.configure do |config|
|
6
|
+
config.before do
|
7
|
+
#mocks out connection to Applitools.
|
8
|
+
allow_any_instance_of(Applitools::AgentConnector).to receive(:start_session) do
|
9
|
+
Applitools::Session.new('dummy_id', 'dummy_url', true )
|
10
|
+
end
|
11
|
+
|
12
|
+
allow_any_instance_of(Applitools::AgentConnector).to receive(:stop_session) do
|
13
|
+
Applitools::TestResults.new()
|
14
|
+
end
|
15
|
+
|
16
|
+
allow_any_instance_of(Applitools::AgentConnector).to receive(:match_window) do
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyes_selenium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Applitools team
|
@@ -180,7 +180,9 @@ files:
|
|
180
180
|
- lib/eyes_selenium/utils/image_delta_compressor.rb
|
181
181
|
- lib/eyes_selenium/utils/image_utils.rb
|
182
182
|
- lib/eyes_selenium/version.rb
|
183
|
-
- spec/
|
183
|
+
- spec/driver_passthrough_spec.rb
|
184
|
+
- spec/fixtures/static_test_file.html
|
185
|
+
- spec/spec_helper.rb
|
184
186
|
- test_script.rb
|
185
187
|
homepage: http://www.applitools.com
|
186
188
|
licenses:
|
@@ -207,4 +209,6 @@ signing_key:
|
|
207
209
|
specification_version: 4
|
208
210
|
summary: Applitools Ruby SDK
|
209
211
|
test_files:
|
210
|
-
- spec/
|
212
|
+
- spec/driver_passthrough_spec.rb
|
213
|
+
- spec/fixtures/static_test_file.html
|
214
|
+
- spec/spec_helper.rb
|
data/spec/find_spec.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'eyes_selenium'
|
2
|
-
|
3
|
-
describe 'find_element(s)' do
|
4
|
-
|
5
|
-
before(:each) do |example|
|
6
|
-
@eyes = Applitools::Eyes.new
|
7
|
-
@eyes.api_key = ENV['APPLITOOLS_ACCESS_KEY']
|
8
|
-
driver = Selenium::WebDriver.for :firefox
|
9
|
-
@driver = @eyes.open(app_name: 'the-internet', test_name: example.metadata[:full_description],
|
10
|
-
viewport_size: {width: 800, height: 600}, driver: driver)
|
11
|
-
@driver.get 'http://the-internet.herokuapp.com'
|
12
|
-
end
|
13
|
-
|
14
|
-
after(:each) do
|
15
|
-
@eyes.close
|
16
|
-
@driver.quit
|
17
|
-
end
|
18
|
-
|
19
|
-
context 'single element' do
|
20
|
-
|
21
|
-
it 'explicit' do
|
22
|
-
link = @driver.find_element(:css, 'a')
|
23
|
-
expect(link).to_not be nil
|
24
|
-
expect(link).to be_a Applitools::Element
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'by hash' do
|
28
|
-
link = @driver.find_element(css: 'a')
|
29
|
-
expect(link).to_not be nil
|
30
|
-
expect(link).to be_a Applitools::Element
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
context 'all elements' do
|
36
|
-
|
37
|
-
it 'explicit' do
|
38
|
-
collection = @driver.find_elements(css: 'a')
|
39
|
-
expect(collection).to_not be nil
|
40
|
-
expect(collection[0]).to be_a Applitools::Element
|
41
|
-
expect(collection[1]).to be_a Applitools::Element
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'by hash' do
|
45
|
-
collection = @driver.find_elements(css: 'a')
|
46
|
-
expect(collection).to_not be nil
|
47
|
-
expect(collection[0]).to be_a Applitools::Element
|
48
|
-
expect(collection[1]).to be_a Applitools::Element
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|