calabash 1.9.9.pre2 → 1.9.9.pre3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -0
- data/lib/calabash.rb +4 -2
- data/lib/calabash/android/build/java_keystore.rb +1 -0
- data/lib/calabash/android/console_helpers.rb +1 -0
- data/lib/calabash/android/defaults.rb +23 -13
- data/lib/calabash/android/device.rb +84 -19
- data/lib/calabash/android/environment.rb +2 -0
- data/lib/calabash/android/gestures.rb +4 -3
- data/lib/calabash/android/interactions.rb +1 -0
- data/lib/calabash/android/lib/.irbrc +61 -48
- data/lib/calabash/android/lib/TestServer.apk +0 -0
- data/lib/calabash/android/life_cycle.rb +3 -2
- data/lib/calabash/android/orientation.rb +1 -0
- data/lib/calabash/android/physical_buttons.rb +3 -1
- data/lib/calabash/android/screenshot.rb +0 -1
- data/lib/calabash/android/text.rb +1 -0
- data/lib/calabash/application.rb +20 -1
- data/lib/calabash/cli/generate.rb +10 -2
- data/lib/calabash/console_helpers.rb +101 -13
- data/lib/calabash/defaults.rb +36 -3
- data/lib/calabash/device.rb +28 -3
- data/lib/calabash/gestures.rb +12 -12
- data/lib/calabash/http/request.rb +1 -0
- data/lib/calabash/http/retriable_client.rb +1 -0
- data/lib/calabash/interactions.rb +2 -1
- data/lib/calabash/ios.rb +2 -0
- data/lib/calabash/ios/conditions.rb +1 -0
- data/lib/calabash/ios/console_helpers.rb +1 -0
- data/lib/calabash/ios/defaults.rb +32 -17
- data/lib/calabash/ios/device/device_implementation.rb +5 -1
- data/lib/calabash/ios/device/gestures_mixin.rb +27 -7
- data/lib/calabash/ios/device/rotation_mixin.rb +2 -2
- data/lib/calabash/ios/device/routes/error.rb +1 -0
- data/lib/calabash/ios/device/routes/playback_route_mixin.rb +1 -1
- data/lib/calabash/ios/device/routes/uia_route_mixin.rb +1 -1
- data/lib/calabash/ios/device/uia_mixin.rb +1 -1
- data/lib/calabash/ios/gestures.rb +107 -0
- data/lib/calabash/ios/interactions.rb +1 -0
- data/lib/calabash/ios/lib/.irbrc +61 -47
- data/lib/calabash/ios/orientation.rb +1 -0
- data/lib/calabash/ios/runtime.rb +1 -0
- data/lib/calabash/ios/scroll.rb +7 -7
- data/lib/calabash/ios/text.rb +3 -0
- data/lib/calabash/ios/uia.rb +1 -0
- data/lib/calabash/lib/skeleton/.gitignore +19 -0
- data/lib/calabash/lib/skeleton/Gemfile +5 -0
- data/lib/calabash/life_cycle.rb +3 -2
- data/lib/calabash/location.rb +5 -6
- data/lib/calabash/logger.rb +1 -0
- data/lib/calabash/orientation.rb +1 -0
- data/lib/calabash/page.rb +1 -0
- data/lib/calabash/screenshot.rb +1 -0
- data/lib/calabash/server.rb +1 -0
- data/lib/calabash/text.rb +3 -2
- data/lib/calabash/utility.rb +2 -1
- data/lib/calabash/version.rb +1 -1
- data/lib/calabash/wait.rb +1 -0
- metadata +114 -114
- data/lib/calabash/android/cucumber.rb +0 -3
- data/lib/calabash/android/scroll.rb +0 -5
- data/lib/calabash/patch/run_loop.rb +0 -90
@@ -1,90 +0,0 @@
|
|
1
|
-
require 'run_loop'
|
2
|
-
|
3
|
-
if RunLoop.const_defined?(:Ipa)
|
4
|
-
"\033[34mRunLoop::Ipa patch can be removed.\033[0m"
|
5
|
-
else
|
6
|
-
"\033[34mApplying RunLoop::Ipa patch.\033[0m"
|
7
|
-
|
8
|
-
# @!visibility private
|
9
|
-
module RunLoop
|
10
|
-
# A model of the an .ipa - a application binary for iOS devices.
|
11
|
-
class Ipa
|
12
|
-
|
13
|
-
|
14
|
-
# The path to this .ipa.
|
15
|
-
# @!attribute [r] path
|
16
|
-
# @return [String] A path to this .ipa.
|
17
|
-
attr_reader :path
|
18
|
-
|
19
|
-
# The bundle identifier of this ipa.
|
20
|
-
# @!attribute [r] bundle_identifier
|
21
|
-
# @return [String] The bundle identifier of this ipa; obtained by inspecting
|
22
|
-
# the app's Info.plist.
|
23
|
-
attr_reader :bundle_identifier
|
24
|
-
|
25
|
-
# Create a new ipa instance.
|
26
|
-
# @param [String] path_to_ipa The path the .ipa file.
|
27
|
-
# @return [Calabash::Ipa] A new ipa instance.
|
28
|
-
# @raise [RuntimeError] If the file does not exist.
|
29
|
-
# @raise [RuntimeError] If the file does not end in .ipa.
|
30
|
-
def initialize(path_to_ipa)
|
31
|
-
unless File.exist? path_to_ipa
|
32
|
-
raise "Expected an ipa at '#{path_to_ipa}'"
|
33
|
-
end
|
34
|
-
|
35
|
-
unless path_to_ipa.end_with?('.ipa')
|
36
|
-
raise "Expected '#{path_to_ipa}' to be an ipa"
|
37
|
-
end
|
38
|
-
@path = path_to_ipa
|
39
|
-
end
|
40
|
-
|
41
|
-
# @!visibility private
|
42
|
-
def to_s
|
43
|
-
"#<Ipa: #{bundle_identifier}: '#{path}'>"
|
44
|
-
end
|
45
|
-
|
46
|
-
# The bundle identifier of this ipa.
|
47
|
-
# @return [String] A string representation of this ipa's CFBundleIdentifier
|
48
|
-
# @raise [RuntimeError] If ipa does not expand into a Payload/<app name>.app
|
49
|
-
# directory.
|
50
|
-
# @raise [RuntimeError] If an Info.plist does exist in the .app.
|
51
|
-
def bundle_identifier
|
52
|
-
unless File.exist?(bundle_dir)
|
53
|
-
raise "Expected a '#{File.basename(path).split('.').first}.app'\nat path '#{payload_dir}'"
|
54
|
-
end
|
55
|
-
|
56
|
-
@bundle_identifier ||= lambda {
|
57
|
-
info_plist_path = File.join(bundle_dir, 'Info.plist')
|
58
|
-
unless File.exist? info_plist_path
|
59
|
-
raise "Expected an 'Info.plist' at '#{bundle_dir}'"
|
60
|
-
end
|
61
|
-
pbuddy = RunLoop::PlistBuddy.new
|
62
|
-
pbuddy.plist_read('CFBundleIdentifier', info_plist_path)
|
63
|
-
}.call
|
64
|
-
end
|
65
|
-
|
66
|
-
private
|
67
|
-
|
68
|
-
def tmpdir
|
69
|
-
@tmpdir ||= Dir.mktmpdir
|
70
|
-
end
|
71
|
-
|
72
|
-
def payload_dir
|
73
|
-
@payload_dir ||= lambda {
|
74
|
-
FileUtils.cp(path, tmpdir)
|
75
|
-
zip_path = File.join(tmpdir, File.basename(path))
|
76
|
-
Dir.chdir(tmpdir) do
|
77
|
-
system('unzip', *['-q', zip_path])
|
78
|
-
end
|
79
|
-
File.join(tmpdir, 'Payload')
|
80
|
-
}.call
|
81
|
-
end
|
82
|
-
|
83
|
-
def bundle_dir
|
84
|
-
@bundle_dir ||= lambda {
|
85
|
-
Dir.glob(File.join(payload_dir, '*')).detect {|f| File.directory?(f) && f.end_with?('.app')}
|
86
|
-
}.call
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|