appium_capybara 1.2.1 → 1.3.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 +4 -4
- data/appium_capybara.gemspec +1 -1
- data/example/Gemfile +1 -1
- data/example/appium.txt +2 -2
- data/example/spec/capybara_init.rb +2 -1
- data/lib/appium_capybara.rb +2 -3
- data/lib/appium_capybara/driver/appium/driver.rb +9 -1
- data/lib/appium_capybara/ext/selector_ext.rb +3 -13
- data/lib/appium_capybara/ext/{query_ext.rb → selector_query_ext.rb} +9 -7
- data/lib/appium_capybara/version.rb +2 -2
- data/release_notes.md +15 -1
- metadata +16 -24
- data/lib/appium_capybara/driver/base_ext.rb +0 -5
- data/lib/appium_capybara/ext/session_ext.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d66d327bb69cb59b65203b343dd8d51cc7af1af9
|
4
|
+
data.tar.gz: cb4d19b3eba30e99bbff1d2efc70dd35bd5e987d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ece5c4ff572a5dd92b137c351847b76440b106f6e83b3c5e5fbd1add8cafc98aee16d161373d51c78a004985859fa98750082aa500edcd003627db346937e8cf
|
7
|
+
data.tar.gz: 5630655cb736c741fee94f4408a50ebe92acc9dfbccedd5f05f91ef9d87d8125ee2bb3ffc8bf2b3311b7e7d3d7c40a838d1a4640ce4096d3d898c9ecb86916c4
|
data/appium_capybara.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.require_paths = ['lib']
|
22
22
|
|
23
23
|
s.add_runtime_dependency 'appium_lib', '>= 4.1.0'
|
24
|
-
s.add_runtime_dependency 'capybara', '~> 2.
|
24
|
+
s.add_runtime_dependency 'capybara', '~> 2.7'
|
25
25
|
|
26
26
|
s.add_development_dependency 'appium_thor', '~> 0.0', '>= 0.0.7'
|
27
27
|
|
data/example/Gemfile
CHANGED
data/example/appium.txt
CHANGED
data/lib/appium_capybara.rb
CHANGED
@@ -4,9 +4,8 @@ require_relative 'appium_capybara/driver/appium/driver'
|
|
4
4
|
require_relative 'appium_capybara/driver/appium/node'
|
5
5
|
|
6
6
|
require_relative 'appium_capybara/ext/base_ext'
|
7
|
-
require_relative 'appium_capybara/ext/
|
7
|
+
require_relative 'appium_capybara/ext/selector_query_ext'
|
8
8
|
require_relative 'appium_capybara/ext/selector_ext'
|
9
|
-
require_relative 'appium_capybara/ext/session_ext'
|
10
9
|
|
11
10
|
module Appium::Capybara
|
12
|
-
end
|
11
|
+
end
|
@@ -22,6 +22,14 @@ module Appium::Capybara
|
|
22
22
|
@appium_driver = Appium::Driver.new @options
|
23
23
|
# browser is the standard selenium driver without any appium methods
|
24
24
|
@browser = @appium_driver.start_driver
|
25
|
+
|
26
|
+
main = Process.pid
|
27
|
+
at_exit do
|
28
|
+
# Store the exit status of the test run since it goes away after calling the at_exit proc...
|
29
|
+
@exit_status = $!.status if $!.is_a?(SystemExit)
|
30
|
+
quit if Process.pid == main
|
31
|
+
exit @exit_status if @exit_status # Force exit with stored status
|
32
|
+
end
|
25
33
|
end
|
26
34
|
@browser
|
27
35
|
end
|
@@ -79,7 +87,7 @@ module Appium::Capybara
|
|
79
87
|
# override
|
80
88
|
# Capybara always passes an options param but appium_lib can't do anything with it.
|
81
89
|
def save_screenshot(path, options = {})
|
82
|
-
appium_driver.screenshot path
|
90
|
+
appium_driver.screenshot path if @appium_driver
|
83
91
|
end
|
84
92
|
|
85
93
|
# new
|
@@ -1,20 +1,10 @@
|
|
1
1
|
module Capybara
|
2
2
|
class Selector
|
3
|
+
|
3
4
|
def custom(f, &block)
|
4
|
-
@format = f
|
5
|
-
@custom = block if block
|
6
|
-
@custom
|
5
|
+
@format, @expression = f, block if block
|
7
6
|
end
|
8
7
|
|
9
|
-
def call(locator)
|
10
|
-
if @format == :css
|
11
|
-
@css.call(locator)
|
12
|
-
elsif @format == :xpath
|
13
|
-
@xpath.call(locator)
|
14
|
-
else
|
15
|
-
@custom.call(locator)
|
16
|
-
end
|
17
|
-
end
|
18
8
|
end
|
19
9
|
end
|
20
10
|
|
@@ -29,4 +19,4 @@ Capybara.add_selector(:name) do
|
|
29
19
|
end
|
30
20
|
Capybara.add_selector(:accessibility_id) do
|
31
21
|
custom(:accessibility_id) { |locator| locator }
|
32
|
-
end
|
22
|
+
end
|
@@ -1,14 +1,15 @@
|
|
1
|
-
class Capybara::
|
1
|
+
class Capybara::Queries::SelectorQuery < Capybara::Queries::BaseQuery
|
2
|
+
|
2
3
|
# @api private
|
3
4
|
def resolve_for(node, exact = nil)
|
4
5
|
node.synchronize do
|
5
6
|
children = if selector.format == :css
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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|
|
12
13
|
if node.is_a?(Capybara::Node::Base)
|
13
14
|
Capybara::Node::Element.new(node.session, child, node, self)
|
14
15
|
else
|
@@ -18,4 +19,5 @@ class Capybara::Query < Capybara::Queries::BaseQuery
|
|
18
19
|
Capybara::Result.new(children, self)
|
19
20
|
end
|
20
21
|
end
|
22
|
+
|
21
23
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
module Capybara
|
3
|
-
VERSION = '1.
|
4
|
-
DATE = '
|
3
|
+
VERSION = '1.3.0' unless defined? ::Appium::Capybara::VERSION
|
4
|
+
DATE = '2016-04-22' unless defined? ::Appium::Capybara::DATE
|
5
5
|
end
|
6
6
|
end
|
data/release_notes.md
CHANGED
@@ -1,6 +1,20 @@
|
|
1
|
+
#### v1.3.0 2016-04-22
|
2
|
+
|
3
|
+
- [9a2517c](https://github.com/appium/appium_capybara/commit/9a2517c7797ae1719a4ef91b0db939b11e9af2e5) Release 1.3.0
|
4
|
+
- [30496b0](https://github.com/appium/appium_capybara/commit/30496b00cdca96a98c87a7987b03f396d42f9584) Release 1.3.0
|
5
|
+
- [e77c23b](https://github.com/appium/appium_capybara/commit/e77c23b5806e3de20a813edb93a0c386e14c2c68) Capybara 2.7 support
|
6
|
+
- [6e43a9e](https://github.com/appium/appium_capybara/commit/6e43a9e77e8e7186b45a9a7c9650ab4a5af750e8) End file appium_capybara.rb with new line
|
7
|
+
- [a1d776d](https://github.com/appium/appium_capybara/commit/a1d776d1b89aff5a0c340f58ec2df062989b70e0) Fix for wrong attribute used in resolve_for
|
8
|
+
- [0aa208b](https://github.com/appium/appium_capybara/commit/0aa208be11e78d82f3fec4011daec13c71d588fa) Update extensions of Capybara classes to support version 2.7
|
9
|
+
- [834d0b1](https://github.com/appium/appium_capybara/commit/834d0b1a15b2f447a8ba10ef2f5d93f62a6f29e6) Merge pull request #25 from appium/fix_query
|
10
|
+
- [a68a6f3](https://github.com/appium/appium_capybara/commit/a68a6f3f0247c056c2475982ab18aba57783e34c) Query extension now uses expression instead of locator
|
11
|
+
- [7695c14](https://github.com/appium/appium_capybara/commit/7695c141aef4635923317980916ee8b263b47acd) Merge pull request #24 from vgrigoruk/master
|
12
|
+
- [580a476](https://github.com/appium/appium_capybara/commit/580a4769fc1ce2d631cc2b59598f007e4a3f63d3) make sure app is running when making a screenshot. Auto-quit driver when test session ends
|
13
|
+
- [697a000](https://github.com/appium/appium_capybara/commit/697a0004930d1d74e19b6b6603b58300845aaa7c) Update example for iOS 8
|
14
|
+
|
15
|
+
|
1
16
|
#### v1.2.1 2014-12-29
|
2
17
|
|
3
|
-
- [57ad02c](https://github.com/appium/appium_capybara/commit/57ad02c3aac2c34f5710149bff6ea92d5309d421) Release 1.2.1
|
4
18
|
- [1ab8564](https://github.com/appium/appium_capybara/commit/1ab856478e7495347dbbd5d2737c9cc55106b3bf) Release 1.2.1
|
5
19
|
- [97de881](https://github.com/appium/appium_capybara/commit/97de8812b54d84d2a4681672c436f06609080334) Loosen restriction on ruby_lib version
|
6
20
|
- [691164f](https://github.com/appium/appium_capybara/commit/691164f033e6b952ca1fe2ce131a40c76c03e825) Update contributing.md
|
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.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- scott.bonebrake@gmail.com
|
@@ -10,60 +10,54 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: appium_lib
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 4.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - '>='
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 4.1.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: capybara
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ~>
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '2.
|
36
|
-
- - ">="
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: 2.4.1
|
35
|
+
version: '2.7'
|
39
36
|
type: :runtime
|
40
37
|
prerelease: false
|
41
38
|
version_requirements: !ruby/object:Gem::Requirement
|
42
39
|
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '2.4'
|
46
|
-
- - ">="
|
40
|
+
- - ~>
|
47
41
|
- !ruby/object:Gem::Version
|
48
|
-
version: 2.
|
42
|
+
version: '2.7'
|
49
43
|
- !ruby/object:Gem::Dependency
|
50
44
|
name: appium_thor
|
51
45
|
requirement: !ruby/object:Gem::Requirement
|
52
46
|
requirements:
|
53
|
-
- -
|
47
|
+
- - ~>
|
54
48
|
- !ruby/object:Gem::Version
|
55
49
|
version: '0.0'
|
56
|
-
- -
|
50
|
+
- - '>='
|
57
51
|
- !ruby/object:Gem::Version
|
58
52
|
version: 0.0.7
|
59
53
|
type: :development
|
60
54
|
prerelease: false
|
61
55
|
version_requirements: !ruby/object:Gem::Requirement
|
62
56
|
requirements:
|
63
|
-
- -
|
57
|
+
- - ~>
|
64
58
|
- !ruby/object:Gem::Version
|
65
59
|
version: '0.0'
|
66
|
-
- -
|
60
|
+
- - '>='
|
67
61
|
- !ruby/object:Gem::Version
|
68
62
|
version: 0.0.7
|
69
63
|
description: Enables appium support in Capybara.
|
@@ -75,7 +69,7 @@ executables: []
|
|
75
69
|
extensions: []
|
76
70
|
extra_rdoc_files: []
|
77
71
|
files:
|
78
|
-
-
|
72
|
+
- .gitignore
|
79
73
|
- Gemfile
|
80
74
|
- LICENSE-2.0.txt
|
81
75
|
- README.md
|
@@ -92,11 +86,9 @@ files:
|
|
92
86
|
- lib/appium_capybara.rb
|
93
87
|
- lib/appium_capybara/driver/appium/driver.rb
|
94
88
|
- lib/appium_capybara/driver/appium/node.rb
|
95
|
-
- lib/appium_capybara/driver/base_ext.rb
|
96
89
|
- lib/appium_capybara/ext/base_ext.rb
|
97
|
-
- lib/appium_capybara/ext/query_ext.rb
|
98
90
|
- lib/appium_capybara/ext/selector_ext.rb
|
99
|
-
- lib/appium_capybara/ext/
|
91
|
+
- lib/appium_capybara/ext/selector_query_ext.rb
|
100
92
|
- lib/appium_capybara/version.rb
|
101
93
|
- release_notes.md
|
102
94
|
homepage: https://github.com/appium/appium_capybara
|
@@ -109,12 +101,12 @@ require_paths:
|
|
109
101
|
- lib
|
110
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
111
103
|
requirements:
|
112
|
-
- -
|
104
|
+
- - '>='
|
113
105
|
- !ruby/object:Gem::Version
|
114
106
|
version: 1.9.3
|
115
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
108
|
requirements:
|
117
|
-
- -
|
109
|
+
- - '>='
|
118
110
|
- !ruby/object:Gem::Version
|
119
111
|
version: '0'
|
120
112
|
requirements: []
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Capybara
|
2
|
-
class Session
|
3
|
-
def reset!
|
4
|
-
# Work around for issue https://github.com/jnicklas/capybara/issues/1237
|
5
|
-
browser_initialized = driver.respond_to?(:browser_initialized?) ? driver.browser_initialized? : true
|
6
|
-
|
7
|
-
if @touched && browser_initialized
|
8
|
-
driver.reset!
|
9
|
-
# Ugly hack to not run this assertion for Appium
|
10
|
-
assert_no_selector(:xpath, "/html/body/*") unless driver.instance_of? Appium::Capybara::Driver
|
11
|
-
@touched = false
|
12
|
-
end
|
13
|
-
raise_server_error!
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|