appium_capybara 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/Gemfile +1 -1
- data/example/appium.txt +1 -1
- data/example/spec/capybara_init.rb +2 -2
- data/example/spec/home_page.rb +1 -1
- data/example/spec/spec_helper.rb +2 -4
- data/lib/appium_capybara.rb +2 -2
- data/lib/appium_capybara/driver/appium/driver.rb +18 -18
- data/lib/appium_capybara/ext/base_ext.rb +1 -1
- data/lib/appium_capybara/ext/selector_ext.rb +1 -3
- data/lib/appium_capybara/ext/selector_query_ext.rb +12 -13
- data/lib/appium_capybara/version.rb +3 -3
- data/release_notes.md +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 838caf9468d6e6513df67cc554df7109b7efeb4154960f0355af05613cf6cd25
|
4
|
+
data.tar.gz: 800173f5e38349d0264a2fd978f9bfb201d3af333c495f816fd165c5af371358
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5617b2c7eb1b8745aae6ee8bc0752952c3609a7d8fca3c6469bc395f1779ecf16ef8cc2039ecb9c5bba63ca7393b1e4cbaf85f15e8686ac1fe073e8ade342c1c
|
7
|
+
data.tar.gz: a9df43925ed328b4a8a1fc1d123c177dedacb1ecbf331627e8bdbc96c0fcc0e14cb18ce1684b8469baf1d010b70d96d04daf00fab09ef9ee3c38743c776fc41f
|
data/example/Gemfile
CHANGED
data/example/appium.txt
CHANGED
@@ -6,10 +6,10 @@ require 'site_prism'
|
|
6
6
|
|
7
7
|
caps = Appium.load_appium_txt file: File.expand_path('./', 'appium.txt'), verbose: true
|
8
8
|
|
9
|
-
url =
|
9
|
+
url = 'http://localhost:4723/wd/hub'.freeze
|
10
10
|
|
11
11
|
Capybara.register_driver(:appium) do |app|
|
12
|
-
all_options = caps.merge(
|
12
|
+
all_options = caps.merge(appium_lib: { server_url: url }, global_driver: false)
|
13
13
|
puts all_options.inspect
|
14
14
|
|
15
15
|
Appium::Capybara::Driver.new app, all_options
|
data/example/spec/home_page.rb
CHANGED
data/example/spec/spec_helper.rb
CHANGED
@@ -4,11 +4,9 @@ require_relative 'capybara_init'
|
|
4
4
|
require_relative 'home_page'
|
5
5
|
|
6
6
|
RSpec.configure do |config|
|
7
|
-
config.after(:each)
|
8
|
-
Capybara.current_session.driver.quit
|
9
|
-
end
|
7
|
+
config.after(:each) { Capybara.current_session.driver.quit }
|
10
8
|
|
11
9
|
config.after do |result|
|
12
10
|
Capybara.current_session.driver.save_screenshot 'error.png' if result.exception
|
13
11
|
end
|
14
|
-
end
|
12
|
+
end
|
data/lib/appium_capybara.rb
CHANGED
@@ -8,7 +8,7 @@ module Appium::Capybara
|
|
8
8
|
# starts new driver
|
9
9
|
def appium_driver
|
10
10
|
# must use self to reference the 'browser' method
|
11
|
-
|
11
|
+
browser unless @appium_driver
|
12
12
|
|
13
13
|
@appium_driver
|
14
14
|
end
|
@@ -18,18 +18,18 @@ module Appium::Capybara
|
|
18
18
|
# Creates and starts a new appium driver.
|
19
19
|
# To access the browser without creating one use @browser
|
20
20
|
def browser
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
21
|
+
return @browser if @browser
|
22
|
+
|
23
|
+
@appium_driver = Appium::Driver.new @options, false
|
24
|
+
# browser is the standard selenium driver without any appium methods
|
25
|
+
@browser = @appium_driver.start_driver
|
26
|
+
|
27
|
+
main = Process.pid
|
28
|
+
at_exit do
|
29
|
+
# Store the exit status of the test run since it goes away after calling the at_exit proc...
|
30
|
+
@exit_status = $ERROR_INFO.status if $ERROR_INFO.is_a?(SystemExit)
|
31
|
+
quit if Process.pid == main
|
32
|
+
exit @exit_status if @exit_status # Force exit with stored status
|
33
33
|
end
|
34
34
|
@browser
|
35
35
|
end
|
@@ -53,29 +53,29 @@ module Appium::Capybara
|
|
53
53
|
|
54
54
|
# @deprecated This method is being removed
|
55
55
|
def browser_initialized?
|
56
|
-
|
56
|
+
!!@browser
|
57
57
|
end
|
58
58
|
|
59
59
|
# override
|
60
60
|
# type and options are passed but can be ignored.
|
61
|
-
def dismiss_modal(type, options={}, &blk)
|
61
|
+
def dismiss_modal(type, options = {}, &blk)
|
62
62
|
appium_driver.alert_dismiss
|
63
63
|
end
|
64
64
|
|
65
65
|
# override
|
66
66
|
# type and options are passed but can be ignored.
|
67
|
-
def accept_modal(type, options={}, &blk)
|
67
|
+
def accept_modal(type, options = {}, &blk)
|
68
68
|
appium_driver.alert_accept
|
69
69
|
end
|
70
70
|
|
71
71
|
# new
|
72
72
|
def scroll_up
|
73
|
-
browser.execute_script(
|
73
|
+
browser.execute_script('mobile: scroll', direction: 'up')
|
74
74
|
end
|
75
75
|
|
76
76
|
# new
|
77
77
|
def scroll_down
|
78
|
-
browser.execute_script(
|
78
|
+
browser.execute_script('mobile: scroll', direction: 'down')
|
79
79
|
end
|
80
80
|
|
81
81
|
# new
|
@@ -4,20 +4,19 @@ class Capybara::Queries::SelectorQuery < Capybara::Queries::BaseQuery
|
|
4
4
|
def resolve_for(node, exact = nil)
|
5
5
|
node.synchronize do
|
6
6
|
children = if selector.format == :css
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
7
|
+
node.find_css(css)
|
8
|
+
elsif selector.format == :xpath
|
9
|
+
node.find_xpath(xpath(exact))
|
10
|
+
else
|
11
|
+
node.find_custom(selector.format, @expression)
|
12
|
+
end.map do |child|
|
13
|
+
if node.is_a?(Capybara::Node::Base)
|
14
|
+
Capybara::Node::Element.new(node.session, child, node, self)
|
15
|
+
else
|
16
|
+
Capybara::Node::Simple.new(child)
|
17
|
+
end
|
18
|
+
end
|
19
19
|
Capybara::Result.new(children, self)
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
23
22
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
module Capybara
|
3
|
-
VERSION = '1.8.
|
4
|
-
DATE = '2019-
|
3
|
+
VERSION = '1.8.1'.freeze unless defined? ::Appium::Capybara::VERSION
|
4
|
+
DATE = '2019-06-23'.freeze unless defined? ::Appium::Capybara::DATE
|
5
5
|
end
|
6
|
-
end
|
6
|
+
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
#### v1.8.1 2019-06-23
|
2
|
+
|
3
|
+
- [805b248](https://github.com/appium/appium_capybara/commit/805b24839f414c936e408739a871be9df3620fbf) Release 1.8.1
|
4
|
+
- [d684bc1](https://github.com/appium/appium_capybara/commit/d684bc1ffe5849d31c4895ba5a47be9d4ca50f08) tweak syntax (#49)
|
5
|
+
- [3b10096](https://github.com/appium/appium_capybara/commit/3b100967193128fa04a4ef5cab0e49c38d44f8e8) fix custom format definition (#48)
|
6
|
+
|
7
|
+
|
1
8
|
#### v1.8.0 2019-05-18
|
2
9
|
|
3
10
|
- [3d83516](https://github.com/appium/appium_capybara/commit/3d835164e59b03469a6250a7688c48d290dccfd2) Release 1.8.0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- scott.bonebrake@gmail.com
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-06-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: appium_lib
|