appium_capybara 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/appium_capybara/driver/appium/driver.rb +36 -42
- data/lib/appium_capybara/version.rb +2 -2
- data/release_notes.md +9 -0
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6edab193f01c55c877d14ef3f75e94eee19b8984
|
4
|
+
data.tar.gz: 516a8beca9bba1989a413e7ad16d946663b6a133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f426caf84fd43ee66b88d075ef160d165a69bc6a7b78d265c969df7af66362d9e8929bfb408309fde302a5b741bf3b52641d5edf0bc298edc9b6f6c7dde2ff2
|
7
|
+
data.tar.gz: 41c64a552d3734197da528b4d2d6885d182bfa989f0796afaea9ed1446dc9c19248da7e264a6b20f49b71272b694af2003590fc88c3391e421624604d93874e5
|
data/README.md
CHANGED
@@ -33,6 +33,18 @@ end
|
|
33
33
|
Capybara.default_driver = :appium
|
34
34
|
```
|
35
35
|
|
36
|
+
## Capybara server
|
37
|
+
appium_capybara driver automatically starts a Rails server in `test` environment.
|
38
|
+
|
39
|
+
By default Capybara starts this web server listening to localhost only and on a random port. It is advised
|
40
|
+
to force Capybara to listen to all interface and listen to a specific port, and set this server address
|
41
|
+
in your mobile application.
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
Capybara.server_host = '0.0.0.0' # Listen to all interfaces
|
45
|
+
Capybara.server_port = 56844 # Open port TCP 56844, change at your convenience
|
46
|
+
```
|
47
|
+
|
36
48
|
## Publishing to rubygems
|
37
49
|
|
38
50
|
Make sure to run `thor bump` or manually modify version.rb before publishing. RubyGems will not allow the same
|
@@ -1,10 +1,9 @@
|
|
1
1
|
module Appium::Capybara
|
2
|
-
class
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
attr_reader :app, :options
|
2
|
+
# methods in this class either override selenium driver methods
|
3
|
+
# or they're new and specific to appium.
|
4
|
+
class Appium::Capybara::Driver < Capybara::Selenium::Driver
|
7
5
|
|
6
|
+
# override
|
8
7
|
def browser
|
9
8
|
unless @browser
|
10
9
|
@browser = Appium::Driver.new @options
|
@@ -14,72 +13,67 @@ module Appium::Capybara
|
|
14
13
|
@browser
|
15
14
|
end
|
16
15
|
|
17
|
-
|
18
|
-
@app = app
|
19
|
-
@options = DEFAULT_OPTIONS.merge(options)
|
20
|
-
end
|
21
|
-
|
22
|
-
def browser_initialized?
|
23
|
-
!@browser.nil?
|
24
|
-
end
|
25
|
-
|
26
|
-
def reset!
|
27
|
-
browser.driver.reset
|
28
|
-
end
|
29
|
-
|
30
|
-
def wait?
|
31
|
-
false
|
32
|
-
end
|
33
|
-
|
16
|
+
# override
|
34
17
|
def find_xpath(selector)
|
35
18
|
browser.find_elements(:xpath, selector).map { |node| Appium::Capybara::Node.new(self, node) }
|
36
19
|
end
|
37
20
|
|
21
|
+
# override
|
38
22
|
def find_css(selector)
|
39
23
|
browser.find_elements(:css, selector).map { |node| Appium::Capybara::Node.new(self, node) }
|
40
24
|
end
|
41
25
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
@browser.driver_quit if @browser
|
48
|
-
rescue Errno::ECONNREFUSED
|
49
|
-
# Browser must have already gone
|
50
|
-
ensure
|
51
|
-
@browser = nil
|
52
|
-
end
|
53
|
-
|
54
|
-
def current_url
|
55
|
-
raise NotImplementedError,
|
56
|
-
"Appium::Capybara::Driver does not support current_url because it does not apply to mobile applications"
|
26
|
+
# override
|
27
|
+
def reset!
|
28
|
+
# invoking the browser method after the browser has closed will cause it to relaunch
|
29
|
+
# use @browser to avoid the relaunch.
|
30
|
+
@browser.driver.reset if @browser
|
57
31
|
end
|
58
32
|
|
59
|
-
|
60
|
-
|
61
|
-
|
33
|
+
# new
|
34
|
+
def browser_initialized?
|
35
|
+
!! @browser
|
62
36
|
end
|
63
37
|
|
38
|
+
# new
|
64
39
|
def dismiss_alert
|
65
40
|
browser.alert_dismiss
|
66
41
|
end
|
67
42
|
|
43
|
+
# new
|
68
44
|
def accept_alert
|
69
45
|
browser.alert_accept
|
70
46
|
end
|
71
47
|
|
48
|
+
# new
|
72
49
|
def scroll_up
|
73
50
|
browser.driver.execute_script("mobile: scroll", direction: "up")
|
74
51
|
end
|
75
52
|
|
53
|
+
# new
|
76
54
|
def scroll_down
|
77
55
|
browser.driver.execute_script("mobile: scroll", direction: "down")
|
78
56
|
end
|
79
57
|
|
58
|
+
# new
|
80
59
|
# Use :landscape or :portrait
|
81
60
|
def rotate(opts)
|
82
61
|
browser.driver.rotate opts
|
83
62
|
end
|
84
|
-
|
85
|
-
|
63
|
+
|
64
|
+
# new
|
65
|
+
def find_custom(finder, locator)
|
66
|
+
browser.find_elements(finder, locator).map { |node| Appium::Capybara::Node.new(self, node) }
|
67
|
+
end
|
68
|
+
|
69
|
+
# override
|
70
|
+
def quit
|
71
|
+
@browser.driver_quit if @browser
|
72
|
+
rescue Errno::ECONNREFUSED
|
73
|
+
# Browser must have already gone
|
74
|
+
ensure
|
75
|
+
@browser = nil
|
76
|
+
end
|
77
|
+
|
78
|
+
end # Appium::Capybara::Driver < Capybara::Selenium::Driver
|
79
|
+
end # Appium::Capybara
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
module Capybara
|
3
|
-
VERSION = '0.0
|
4
|
-
DATE = '2014-08-
|
3
|
+
VERSION = '0.1.0' unless defined? ::Appium::Capybara::VERSION
|
4
|
+
DATE = '2014-08-08' unless defined? ::Appium::Capybara::DATE
|
5
5
|
end
|
6
6
|
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
#### v0.1.0 2014-08-08
|
2
|
+
|
3
|
+
- [bdd66a2](https://github.com/appium/appium_capybara/commit/bdd66a2dc3a10fa2f8211b61d3b4ea8ef1315155) Release 0.1.0
|
4
|
+
- [fc263fb](https://github.com/appium/appium_capybara/commit/fc263fb315cc5265d5c08e8e19796470dc74b124) Merge pull request #10 from randoum/master
|
5
|
+
- [fadc4be](https://github.com/appium/appium_capybara/commit/fadc4be5684f4216c3773f6115c27db8f81878dc) Minor fixes
|
6
|
+
- [b919826](https://github.com/appium/appium_capybara/commit/b91982622ac7e1a5c86e04d8783b3bcaa613f712) Merge pull request #8 from appium/capybara_selenium_driver
|
7
|
+
- [068e298](https://github.com/appium/appium_capybara/commit/068e29830ec0b906e348d745ed80375fa4a27416) Inherit from Capybara::Selenium::Driver
|
8
|
+
|
9
|
+
|
1
10
|
#### v0.0.4 2014-08-07
|
2
11
|
|
3
12
|
- [16061f4](https://github.com/appium/appium_capybara/commit/16061f43ef4ac0796bc05f9d4af9e22e58d769e1) Release 0.0.4
|
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: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- scott.bonebrake@gmail.com
|
@@ -9,66 +9,66 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: appium_lib
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '4'
|
21
|
-
- -
|
21
|
+
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 4.1.0
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- - ~>
|
28
|
+
- - "~>"
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: '4'
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 4.1.0
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: capybara
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.4'
|
41
|
-
- -
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: 2.4.1
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- - ~>
|
48
|
+
- - "~>"
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '2.4'
|
51
|
-
- -
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: 2.4.1
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: appium_thor
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - ~>
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0.0'
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: 0.0.7
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- - ~>
|
68
|
+
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0.0'
|
71
|
-
- -
|
71
|
+
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: 0.0.7
|
74
74
|
description: Enables appium support in Capybara.
|
@@ -79,7 +79,7 @@ executables: []
|
|
79
79
|
extensions: []
|
80
80
|
extra_rdoc_files: []
|
81
81
|
files:
|
82
|
-
- .gitignore
|
82
|
+
- ".gitignore"
|
83
83
|
- Gemfile
|
84
84
|
- LICENSE-2.0.txt
|
85
85
|
- README.md
|
@@ -112,12 +112,12 @@ require_paths:
|
|
112
112
|
- lib
|
113
113
|
required_ruby_version: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 1.9.3
|
118
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- -
|
120
|
+
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|