unobtainium 0.7.1 → 0.8.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/Gemfile.lock +1 -1
- data/lib/unobtainium/drivers/appium.rb +62 -3
- data/lib/unobtainium/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a03cc8ff5ee6dcf02b0b2b967a32ccc3053b093
|
4
|
+
data.tar.gz: ea904b1a9f7e20fd051d74fefec4a33b9c9c21ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4db733242a110f7bdb634cfe883ba3553e6b0022774800daa7b9de8058b4fbbeafcc475911d9c5eef56b9b117689fd9b8124fc27bf405b3ff5c03fdf9c0fe49
|
7
|
+
data.tar.gz: 18bc60d149c2a2856085c511fc3cf477bc6a061a125e1a96058de4bdd581cff347a8897393653a9b4a10d76ee2271eb75aad289907a343a2699bbc7d344ba125
|
data/Gemfile.lock
CHANGED
@@ -19,6 +19,60 @@ module Unobtainium
|
|
19
19
|
##
|
20
20
|
# Driver implementation wrapping the appium_lib gem.
|
21
21
|
class Appium
|
22
|
+
##
|
23
|
+
# Proxy for the actual Appium driver.
|
24
|
+
#
|
25
|
+
# There's an unfortunate disparity of functionality between the
|
26
|
+
# Appium::Driver class, and the Selenium::WebDriver class. For maximum
|
27
|
+
# compability, we want the latter's functionality. But for maximum
|
28
|
+
# mobile functionality, we want the former.
|
29
|
+
#
|
30
|
+
# The DriverProxy class takes this into account when forwarding
|
31
|
+
# requests.
|
32
|
+
class DriverProxy
|
33
|
+
##
|
34
|
+
# Initialize
|
35
|
+
def initialize(driver, compatibility = true)
|
36
|
+
@appium_driver = driver
|
37
|
+
@selenium_driver = driver.start_driver
|
38
|
+
|
39
|
+
# Prioritize the two different drivers according to whether
|
40
|
+
# compatibility with Selenium is more desirable than functionality.
|
41
|
+
# Note that this only matters when both classes implement the same
|
42
|
+
# methods! Differently named methods will always be supported either
|
43
|
+
# way.
|
44
|
+
if compatibility
|
45
|
+
@drivers = [@selenium_driver, @appium_driver]
|
46
|
+
else
|
47
|
+
@drivers = [@appium_driver, @selenium_driver]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# Map any missing method to the driver implementation
|
53
|
+
def respond_to_missing?(meth, include_private = false)
|
54
|
+
@drivers.each do |driver|
|
55
|
+
if not driver.nil? and driver.respond_to?(meth, include_private)
|
56
|
+
return true
|
57
|
+
end
|
58
|
+
end
|
59
|
+
return super
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# Map any missing method to the driver implementation
|
64
|
+
def method_missing(meth, *args, &block)
|
65
|
+
@drivers.each do |driver|
|
66
|
+
if not driver.nil? and driver.respond_to?(meth)
|
67
|
+
return driver.send(meth.to_s, *args, &block)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
# :nocov:
|
71
|
+
return super
|
72
|
+
# :nocov:
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
22
76
|
# Recognized labels for matching the driver
|
23
77
|
LABELS = {
|
24
78
|
ios: [:iphone, :ipad],
|
@@ -95,9 +149,14 @@ module Unobtainium
|
|
95
149
|
##
|
96
150
|
# Create and return a driver instance
|
97
151
|
def create(_, options)
|
98
|
-
#
|
99
|
-
|
100
|
-
|
152
|
+
# Determine compatibility option
|
153
|
+
compat = options.fetch(:webdriver_compatibility, true)
|
154
|
+
options.delete(:webdriver_compatibility)
|
155
|
+
|
156
|
+
# Create & return proxy
|
157
|
+
driver = ::Appium::Driver.new(options)
|
158
|
+
result = DriverProxy.new(driver, compat)
|
159
|
+
return result
|
101
160
|
end
|
102
161
|
|
103
162
|
private
|
data/lib/unobtainium/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unobtainium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Finkhaeuser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|