calabash-cucumber 0.9.22 → 0.9.23
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/calabash-ios +4 -0
- data/bin/calabash-ios-helpers.rb +4 -3
- data/bin/calabash-ios-setup.rb +118 -75
- data/doc/calabash-ios-help.txt +30 -12
- data/features-skeleton/support/launch.rb +1 -1
- data/lib/calabash-cucumber/operations.rb +23 -3
- data/lib/calabash-cucumber/version.rb +2 -1
- metadata +16 -16
data/bin/calabash-ios
CHANGED
data/bin/calabash-ios-helpers.rb
CHANGED
@@ -13,9 +13,11 @@ def print_usage
|
|
13
13
|
prints more detailed help information.
|
14
14
|
gen
|
15
15
|
generate a features folder structure.
|
16
|
-
setup (EXPERIMENTAL)
|
16
|
+
setup (EXPERIMENTAL) [opt path]?
|
17
17
|
setup your XCode project for calabash-ios)
|
18
|
-
|
18
|
+
download [opt path]?
|
19
|
+
downloads latest compatible version of calabash.framework
|
20
|
+
check (EXPERIMENTAL) [opt path to .ipa/.app]?
|
19
21
|
check whether an app or ipa is linked with calabash.framework
|
20
22
|
sim locale [lang] [regional]?
|
21
23
|
change locale and regional settings in all iOS Simulators
|
@@ -48,7 +50,6 @@ def ensure_correct_path(args)
|
|
48
50
|
project_files = Dir.foreach(dir_to_search).find_all { |x| /\.xcodeproj$/.match(x) }
|
49
51
|
if project_files.empty?
|
50
52
|
puts "Found no *.xcodeproj files in dir #{dir_to_search}."
|
51
|
-
puts "Please run calabash-ios setup <project path>"
|
52
53
|
exit 1
|
53
54
|
end
|
54
55
|
if project_files.count > 1
|
data/bin/calabash-ios-setup.rb
CHANGED
@@ -1,15 +1,21 @@
|
|
1
1
|
require "calabash-cucumber/version"
|
2
2
|
|
3
3
|
|
4
|
-
def dup_scheme(project_name, pbx_dir)
|
4
|
+
def dup_scheme(project_name, pbx_dir, target)
|
5
5
|
|
6
6
|
userdata_dirs = Dir.foreach("#{pbx_dir}/xcuserdata").find_all { |x|
|
7
7
|
/\.xcuserdatad$/.match(x)
|
8
8
|
}
|
9
9
|
|
10
|
+
target_name = target.name.value
|
11
|
+
|
12
|
+
if target_name.start_with?'"' and target_name.end_with?'"'
|
13
|
+
target_name = target_name[1..target_name.length-2]
|
14
|
+
end
|
15
|
+
|
10
16
|
userdata_dirs.each do |userdata_dir|
|
11
|
-
scheme_to_find = Regexp.new(Regexp.escape("#{
|
12
|
-
cal_scheme_to_find = Regexp.new(Regexp.escape("#{
|
17
|
+
scheme_to_find = Regexp.new(Regexp.escape("#{target_name}.xcscheme"))
|
18
|
+
cal_scheme_to_find = Regexp.new(Regexp.escape("#{target_name}-cal.xcscheme"))
|
13
19
|
schemes = Dir.foreach("#{pbx_dir}/xcuserdata/#{userdata_dir}/xcschemes")
|
14
20
|
scheme = schemes.find do |scheme|
|
15
21
|
scheme_to_find.match(scheme)
|
@@ -20,19 +26,19 @@ def dup_scheme(project_name, pbx_dir)
|
|
20
26
|
|
21
27
|
if scheme.nil?
|
22
28
|
puts "-"*10 + "Warning" + "-"*10
|
23
|
-
puts "Unable to find scheme: #{
|
29
|
+
puts "Unable to find scheme: #{target_name}.xcscheme."
|
24
30
|
puts "You must manually create a scheme."
|
25
31
|
puts "Make sure your scheme uses the Calabash build configuration."
|
26
32
|
puts "-"*10 + "-------" + "-"*10
|
27
33
|
else
|
28
34
|
if not cal_scheme.nil?
|
29
35
|
msg("Warning") do
|
30
|
-
puts "Scheme: #{
|
36
|
+
puts "Scheme: #{target_name}-cal.xcscheme already exists."
|
31
37
|
puts "Will not try to duplicate #{project_name}.xcscheme."
|
32
38
|
end
|
33
39
|
else
|
34
40
|
msg("Action") do
|
35
|
-
puts "Duplicating scheme #{
|
41
|
+
puts "Duplicating scheme #{target_name}.xcscheme as #{target_name}-cal.xcscheme"
|
36
42
|
|
37
43
|
doc = REXML::Document.new(File.new("#{pbx_dir}/xcuserdata/#{userdata_dir}/xcschemes/#{scheme}"))
|
38
44
|
|
@@ -48,12 +54,13 @@ def dup_scheme(project_name, pbx_dir)
|
|
48
54
|
doc.elements.each("Scheme/ProfileAction") do |la|
|
49
55
|
la.attributes["buildConfiguration"] = "Calabash"
|
50
56
|
end
|
51
|
-
doc.write(File.open("#{pbx_dir}/xcuserdata/#{userdata_dir}/xcschemes/#{
|
57
|
+
doc.write(File.open("#{pbx_dir}/xcuserdata/#{userdata_dir}/xcschemes/#{target_name}-cal.xcscheme", "w"))
|
52
58
|
end
|
53
59
|
end
|
54
60
|
end
|
55
61
|
|
56
62
|
end
|
63
|
+
"#{target_name}-cal"
|
57
64
|
end
|
58
65
|
|
59
66
|
|
@@ -63,11 +70,11 @@ def calabash_setup(args)
|
|
63
70
|
if res==""
|
64
71
|
puts "Xcode not running."
|
65
72
|
project_name, project_path, xpath = find_project_files(args)
|
66
|
-
setup_project(project_name, project_path, xpath)
|
67
|
-
dup_scheme(project_name, xpath)
|
73
|
+
target = setup_project(project_name, project_path, xpath)
|
74
|
+
scheme = dup_scheme(project_name, xpath, target)
|
68
75
|
msg("Setup done") do
|
69
76
|
|
70
|
-
puts "Please validate by running the #{
|
77
|
+
puts "Please validate by running the #{scheme} scheme"
|
71
78
|
puts "from Xcode."
|
72
79
|
puts "When starting the iOS Simulator using the"
|
73
80
|
puts "new scheme: #{project_name}-cal, you should see:\n\n"
|
@@ -123,6 +130,72 @@ def find_project_files(args)
|
|
123
130
|
return project_name, dir_to_search, File.expand_path("#{dir_to_search}/#{xc_project_file}")
|
124
131
|
end
|
125
132
|
|
133
|
+
def calabash_download(args)
|
134
|
+
project_name, project_path, xpath = find_project_files(args)
|
135
|
+
download_calabash(project_path)
|
136
|
+
end
|
137
|
+
|
138
|
+
def download_calabash(project_path)
|
139
|
+
file = 'calabash.framework'
|
140
|
+
##Download calabash.framework
|
141
|
+
if not Dir.exists?(File.join(project_path, file))
|
142
|
+
msg("Info") do
|
143
|
+
zip_file = "calabash.framework-#{ENV['FRAMEWORK_VERSION']||Calabash::Cucumber::FRAMEWORK_VERSION}.zip"
|
144
|
+
puts "Did not find calabash.framework. I'll download it...'"
|
145
|
+
puts "http://cloud.github.com/downloads/calabash/calabash-ios/#{zip_file}"
|
146
|
+
require 'uri'
|
147
|
+
|
148
|
+
uri = URI.parse "http://cloud.github.com/downloads/calabash/calabash-ios/#{zip_file}"
|
149
|
+
success = false
|
150
|
+
Net::HTTP.start(uri.host, uri.port) do |http|
|
151
|
+
request = Net::HTTP::Get.new uri.request_uri
|
152
|
+
|
153
|
+
http.request request do |response|
|
154
|
+
if response.code == '200'
|
155
|
+
open zip_file, 'wb' do |io|
|
156
|
+
response.read_body do |chunk|
|
157
|
+
print "."
|
158
|
+
io.write chunk
|
159
|
+
end
|
160
|
+
end
|
161
|
+
success = true
|
162
|
+
else
|
163
|
+
puts "Got bad response code #{response.code}."
|
164
|
+
puts "Aborting..."
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
if success
|
169
|
+
puts "\nDownload done: #{file}. Unzipping..."
|
170
|
+
if not system("unzip -C -K -o -q -d #{project_path} #{zip_file}")
|
171
|
+
msg("Error") do
|
172
|
+
puts "Unable to unzip file: #{zip_file}"
|
173
|
+
puts "You must install manually."
|
174
|
+
end
|
175
|
+
exit 1
|
176
|
+
end
|
177
|
+
FileUtils.rm(zip_file)
|
178
|
+
else
|
179
|
+
exit 0
|
180
|
+
end
|
181
|
+
end
|
182
|
+
else
|
183
|
+
msg("Info") do
|
184
|
+
puts "Found calabash.framework in #{File.expand_path(project_path)}."
|
185
|
+
puts "Shall I delete it and download the latest matching version?"
|
186
|
+
puts "Please answer yes (y) or no (n)"
|
187
|
+
answer = STDIN.gets.chomp
|
188
|
+
if (answer == 'yes' or answer == 'y')
|
189
|
+
FileUtils.rm_r File.join(project_path, file)
|
190
|
+
return download_calabash(project_path)
|
191
|
+
else
|
192
|
+
puts "Not downloading..."
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
file
|
197
|
+
end
|
198
|
+
|
126
199
|
def setup_project(project_name, project_path, path)
|
127
200
|
##Ensure exists and parse
|
128
201
|
proj_file = "#{path}/project.pbxproj"
|
@@ -139,7 +212,7 @@ def setup_project(project_name, project_path, path)
|
|
139
212
|
FileUtils.cd project_path
|
140
213
|
##Backup
|
141
214
|
msg("Info") do
|
142
|
-
puts "Making backup of project file: #{proj_file}
|
215
|
+
puts "Making backup of project file: #{proj_file}"
|
143
216
|
if File.exists? "#{proj_file}.bak"
|
144
217
|
msg("Error") do
|
145
218
|
puts "Backup file already exists. #{proj_file}.bak"
|
@@ -151,43 +224,7 @@ def setup_project(project_name, project_path, path)
|
|
151
224
|
end
|
152
225
|
FileUtils.cp(proj_file, "#{proj_file}.bak")
|
153
226
|
end
|
154
|
-
file =
|
155
|
-
##Download calabash.framework
|
156
|
-
if not Dir.exists?(File.join(project_path, file))
|
157
|
-
msg("Info") do
|
158
|
-
zip_file = "calabash.framework-#{ENV['CALABASH_VERSION']||Calabash::Cucumber::VERSION}.zip"
|
159
|
-
puts "Did not find calabash.framework. I'll download it...'"
|
160
|
-
puts "http://cloud.github.com/downloads/calabash/calabash-ios/#{zip_file}"
|
161
|
-
require 'uri'
|
162
|
-
|
163
|
-
uri = URI.parse "http://cloud.github.com/downloads/calabash/calabash-ios/#{zip_file}"
|
164
|
-
|
165
|
-
Net::HTTP.start(uri.host, uri.port) do |http|
|
166
|
-
request = Net::HTTP::Get.new uri.request_uri
|
167
|
-
|
168
|
-
http.request request do |response|
|
169
|
-
open zip_file, 'wb' do |io|
|
170
|
-
response.read_body do |chunk|
|
171
|
-
print "."
|
172
|
-
io.write chunk
|
173
|
-
end
|
174
|
-
end
|
175
|
-
end
|
176
|
-
end
|
177
|
-
puts "\nDownload done: #{file}. Unzipping..."
|
178
|
-
if not system("unzip -C -K -o -q -d #{project_path} #{zip_file}")
|
179
|
-
msg("Error") do
|
180
|
-
puts "Unable to unzip file: #{zip_file}"
|
181
|
-
puts "You must install manually."
|
182
|
-
end
|
183
|
-
exit 1
|
184
|
-
end
|
185
|
-
FileUtils.rm(zip_file)
|
186
|
-
end
|
187
|
-
|
188
|
-
else
|
189
|
-
puts "Found calabash.framework. Will not download."
|
190
|
-
end
|
227
|
+
file = download_calabash(project_path)
|
191
228
|
|
192
229
|
|
193
230
|
file_ref = pbx.sections['PBXFileReference'].find do |fr|
|
@@ -253,7 +290,15 @@ def setup_project(project_name, project_path, path)
|
|
253
290
|
preferred_target = targets.find { |t| t.name.value == project_name }
|
254
291
|
msg("Question") do
|
255
292
|
puts "You have several targets..."
|
256
|
-
|
293
|
+
target_names = targets.map do |t|
|
294
|
+
n = t.name.value
|
295
|
+
if n.length>2 and n.end_with?'"' and n.start_with?'"'
|
296
|
+
n = n[1..n.length-2]
|
297
|
+
end
|
298
|
+
n
|
299
|
+
end
|
300
|
+
|
301
|
+
puts target_names.join("\n")
|
257
302
|
|
258
303
|
found = nil
|
259
304
|
until found do
|
@@ -265,13 +310,28 @@ def setup_project(project_name, project_path, path)
|
|
265
310
|
target = preferred_target
|
266
311
|
found = true
|
267
312
|
else
|
268
|
-
target = found = targets.find { |t| t.name.value == answer }
|
313
|
+
target = found = targets.find { |t| t.name.value == answer || t.name.value=="\"#{answer}\""}
|
269
314
|
end
|
270
315
|
end
|
271
316
|
end
|
272
317
|
end
|
273
318
|
|
319
|
+
##project level build conf
|
320
|
+
project_bc_id = pbx.sections['PBXProject'][0].buildConfigurationList.value
|
321
|
+
project_bc_list = pbx.find_item :guid => project_bc_id, :type => PBXProject::PBXTypes::XCConfigurationList
|
322
|
+
project_bc_ref = project_bc_list.buildConfigurations.find { |bc| bc.comment =="Debug" }
|
323
|
+
project_bc_id = project_bc_ref.value
|
324
|
+
project_bc = pbx.find_item :guid => project_bc_id, :type => PBXProject::PBXTypes::XCBuildConfiguration
|
325
|
+
project_cal_build_settings = project_bc.buildSettings.clone
|
326
|
+
project_bc.buildSettings.each do |k, v|
|
327
|
+
project_cal_build_settings[k] = v.clone
|
328
|
+
end
|
329
|
+
|
330
|
+
project_cal_bc = PBXProject::PBXTypes::XCBuildConfiguration.new(:name => "Calabash")
|
331
|
+
project_cal_bc.buildSettings = project_cal_build_settings
|
332
|
+
project_cal_bc.comment = "Calabash"
|
274
333
|
|
334
|
+
##target level build conf
|
275
335
|
bc_list_id = target.buildConfigurationList.value
|
276
336
|
bc_list = pbx.find_item :guid => bc_list_id, :type => PBXProject::PBXTypes::XCConfigurationList
|
277
337
|
bc_ref = bc_list.buildConfigurations.find { |bc| bc.comment =="Debug" }
|
@@ -279,30 +339,17 @@ def setup_project(project_name, project_path, path)
|
|
279
339
|
bc = pbx.find_item :guid => bc_id, :type => PBXProject::PBXTypes::XCBuildConfiguration
|
280
340
|
cal_build_settings = bc.buildSettings.clone
|
281
341
|
|
282
|
-
|
283
342
|
bc.buildSettings.each do |k, v|
|
284
343
|
cal_build_settings[k] = v.clone
|
285
344
|
end
|
286
345
|
|
287
|
-
project_bc_id = pbx.sections['PBXProject'][0].buildConfigurationList.value
|
288
|
-
project_bc_list = pbx.find_item :guid => project_bc_id, :type => PBXProject::PBXTypes::XCConfigurationList
|
289
|
-
project_bc_ref = project_bc_list.buildConfigurations.find { |bc| bc.comment =="Debug" }
|
290
|
-
project_bc_id = project_bc_ref.value
|
291
|
-
project_bc = pbx.find_item :guid => project_bc_id, :type => PBXProject::PBXTypes::XCBuildConfiguration
|
292
|
-
project_cal_build_settings = project_bc.buildSettings.clone
|
293
|
-
project_bc.buildSettings.each do |k, v|
|
294
|
-
project_cal_build_settings[k] = v.clone
|
295
|
-
end
|
296
|
-
|
297
|
-
|
298
346
|
ld_flags = cal_build_settings['OTHER_LDFLAGS'] || []
|
299
|
-
|
300
347
|
if not ld_flags.is_a?Array
|
301
348
|
ld_flags = [ld_flags]
|
302
349
|
end
|
303
350
|
danger = ld_flags.find_all {|f| /-ObjC/i.match(f.value) || /-all_load/i.match(f.value)}
|
304
351
|
|
305
|
-
|
352
|
+
unless danger.empty?
|
306
353
|
msg("Error") do
|
307
354
|
puts "Detected Other Linker Flag: #{(danger.map {|d| d.value}).join(", ")}"
|
308
355
|
puts "calabash-ios setup does not yet support this scenario"
|
@@ -313,9 +360,6 @@ def setup_project(project_name, project_path, path)
|
|
313
360
|
exit 1
|
314
361
|
end
|
315
362
|
|
316
|
-
|
317
|
-
|
318
|
-
|
319
363
|
ld_flags << PBXProject::PBXTypes::BasicValue.new(:value => '"-force_load"')
|
320
364
|
ld_flags << PBXProject::PBXTypes::BasicValue.new(:value => '"$(SRCROOT)/calabash.framework/calabash"')
|
321
365
|
ld_flags << PBXProject::PBXTypes::BasicValue.new(:value => '"-lstdc++"')
|
@@ -327,14 +371,13 @@ def setup_project(project_name, project_path, path)
|
|
327
371
|
cal_bc.buildSettings = cal_build_settings
|
328
372
|
cal_bc.comment = "Calabash"
|
329
373
|
|
330
|
-
|
331
|
-
|
332
|
-
|
374
|
+
targets.each do |target|
|
375
|
+
bc_list_id = target.buildConfigurationList.value
|
376
|
+
bc_list = pbx.find_item :guid => bc_list_id, :type => PBXProject::PBXTypes::XCConfigurationList
|
377
|
+
bc_list.buildConfigurations << PBXProject::PBXTypes::BasicValue.new(:value => cal_bc.guid, :comment => "Calabash")
|
378
|
+
end
|
333
379
|
|
334
|
-
bc_list.buildConfigurations << PBXProject::PBXTypes::BasicValue.new(:value => cal_bc.guid, :comment => "Calabash")
|
335
380
|
project_bc_list.buildConfigurations << PBXProject::PBXTypes::BasicValue.new(:value => project_cal_bc.guid, :comment => "Calabash")
|
336
|
-
FileUtils.cd pwd
|
337
|
-
|
338
381
|
|
339
382
|
pbx.sections['XCBuildConfiguration']<<project_cal_bc
|
340
383
|
pbx.sections['XCBuildConfiguration']<<cal_bc
|
@@ -350,9 +393,9 @@ def setup_project(project_name, project_path, path)
|
|
350
393
|
sp << PBXProject::PBXTypes::BasicValue.new(:value => "\"$(SRCROOT)\"") unless srcroot
|
351
394
|
bc.buildSettings["FRAMEWORK_SEARCH_PATHS"] = sp
|
352
395
|
end
|
353
|
-
|
396
|
+
FileUtils.cd pwd
|
354
397
|
pbx.write_to :file => proj_file
|
355
|
-
|
398
|
+
return target
|
356
399
|
end
|
357
400
|
|
358
401
|
|
data/doc/calabash-ios-help.txt
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
Usage: calabash-ios <command-name> [parameters]
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
<command-name> can be one of
|
3
|
+
help
|
4
|
+
gen
|
5
|
+
setup (EXPERIMENTAL) [opt path]?
|
6
|
+
download [opt path]?
|
7
|
+
check (EXPERIMENTAL) [opt path to .ipa/.app]?
|
8
|
+
sim locale [lang] [regional]?
|
9
|
+
sim reset
|
10
|
+
sim acc
|
11
|
+
sim device [iPad, iPhone, iPhone_Retina]
|
10
12
|
|
11
13
|
Commands:
|
12
14
|
gen creates a skeleton features dir. This is usually used once when
|
@@ -14,9 +16,12 @@ Usage: calabash-ios <command-name> [parameters]
|
|
14
16
|
the right step definitions and environment to run with cucumber.
|
15
17
|
|
16
18
|
setup [path]? (EXPERIMENTAL) Automates setting up your iOS Xcode project
|
17
|
-
with calabash-
|
18
|
-
|
19
|
-
|
19
|
+
with calabash-ios-server. It is your responsibility to ensure
|
20
|
+
that your production build does not link with calabash.framework.
|
21
|
+
setup will try to ensure this, but you should check manually.
|
22
|
+
|
23
|
+
setup will download calabash.framework and modify you Xcode project
|
24
|
+
file. The parameter [path] is optional (default is the current dir).
|
20
25
|
If specified [path] should be the path to your iOS Xcode project
|
21
26
|
(i.e., the folder which contains projectname.xcodeproj).
|
22
27
|
|
@@ -24,15 +29,28 @@ Usage: calabash-ios <command-name> [parameters]
|
|
24
29
|
- add the calabash.framework to your Frameworks folder
|
25
30
|
- add $(SRCROOT) to framework search path
|
26
31
|
- link with calabash.framework (target can be chosen)
|
32
|
+
- link with Apple's CFNetwork.framework
|
27
33
|
- create a new Build configuration: Calabash
|
28
34
|
- ensure calabash.framework is loaded in Calabash configuration
|
29
|
-
- create a new scheme name project
|
35
|
+
- create a new scheme name <project>-cal
|
30
36
|
|
31
37
|
Your Xcode project file will be backed up as project.pbxproj.bak.
|
32
38
|
The backup is placed in the .xcodeproj folder for your project.
|
33
39
|
If something goes wrong. Close Xcode and copy project.pbxproj.bak
|
34
40
|
to project.pbxproj inside your .xcodeproj folder.
|
35
41
|
|
42
|
+
download [opt_path]?
|
43
|
+
downloads latest compatible version of calabash.framework.
|
44
|
+
It should be run from a directory containing an Xcode project,
|
45
|
+
or optionally opt_path should be supplied and pointing to a
|
46
|
+
directory containing an Xcode project.
|
47
|
+
Download will download the latest version that matches the
|
48
|
+
currently installed calabash-cucumber gem.
|
49
|
+
To update Calabash for your project run
|
50
|
+
|
51
|
+
gem update calabash-cucumber
|
52
|
+
calabash-ios download
|
53
|
+
|
36
54
|
check (EXPERIMENTAL) [.app or .ipa]?
|
37
55
|
check whether an app or ipa is linked with calabash.framework
|
38
56
|
if called without parameter [.app or .ipa] then pwd should be
|
@@ -33,7 +33,7 @@ require 'calabash-cucumber/launch/simulator_helper'
|
|
33
33
|
|
34
34
|
def relaunch
|
35
35
|
if ENV['NO_LAUNCH'].nil?
|
36
|
-
Calabash::Cucumber::SimulatorHelper.relaunch(app_path,ENV['SDK_VERSION'],ENV['DEVICE'])
|
36
|
+
Calabash::Cucumber::SimulatorHelper.relaunch(app_path,ENV['SDK_VERSION'],ENV['DEVICE'] || 'iphone')
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -185,7 +185,16 @@ module Operations
|
|
185
185
|
|
186
186
|
def load_playback_data(recording,options={})
|
187
187
|
os = options["OS"] || ENV["OS"]
|
188
|
-
|
188
|
+
if not os and ENV['SDK_VERSION']
|
189
|
+
sdk = ENV['SDK_VERSION']
|
190
|
+
if sdk[0] != '4' and sdk[0] != '5'
|
191
|
+
raise "SDK_VERSION should be 4.x or 5.x"
|
192
|
+
end
|
193
|
+
os = "ios#{sdk[0]}"
|
194
|
+
elsif os.nil? and ENV['SDK_VERSION'].nil?
|
195
|
+
raise "Either SDK_VERSION or OS environment vars must be set."
|
196
|
+
end
|
197
|
+
device = options["DEVICE"] || ENV["DEVICE"] || "iphone"
|
189
198
|
|
190
199
|
rec_dir = ENV['PLAYBACK_DIR'] || "#{Dir.pwd}/playback"
|
191
200
|
if !recording.end_with?".base64"
|
@@ -233,10 +242,21 @@ module Operations
|
|
233
242
|
File.open("_recording.plist",'wb') do |f|
|
234
243
|
f.write res
|
235
244
|
end
|
236
|
-
|
245
|
+
device = ENV['DEVICE'] || 'iphone'
|
246
|
+
os = ENV['OS']
|
247
|
+
if not os and ENV['SDK_VERSION']
|
248
|
+
sdk = ENV['SDK_VERSION']
|
249
|
+
if sdk[0] != '4' and sdk[0] != '5'
|
250
|
+
raise "SDK_VERSION should be 4.x or 5.x"
|
251
|
+
end
|
252
|
+
os = "ios#{sdk[0]}"
|
253
|
+
elsif os.nil? and ENV['SDK_VERSION'].nil?
|
254
|
+
raise "Either SDK_VERSION or OS environment vars must be set."
|
255
|
+
end
|
256
|
+
file_name = "#{file_name}_#{os}_#{device}.base64"
|
237
257
|
system("/usr/bin/plutil -convert binary1 -o _recording_binary.plist _recording.plist")
|
238
258
|
system("openssl base64 -in _recording_binary.plist -out #{file_name}")
|
239
|
-
system("rm _recording.plist _recording_binary.plist")
|
259
|
+
#system("rm _recording.plist _recording_binary.plist")
|
240
260
|
file_name
|
241
261
|
end
|
242
262
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calabash-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.23
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cucumber
|
16
|
-
requirement: &
|
16
|
+
requirement: &70321592588020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70321592588020
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &70321592587020 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70321592587020
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: CFPropertyList
|
38
|
-
requirement: &
|
38
|
+
requirement: &70321592585620 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70321592585620
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: sim_launcher
|
49
|
-
requirement: &
|
49
|
+
requirement: &70321592585040 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70321592585040
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: slowhandcuke
|
60
|
-
requirement: &
|
60
|
+
requirement: &70321592584620 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70321592584620
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: net-http-persistent
|
71
|
-
requirement: &
|
71
|
+
requirement: &70321592584120 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70321592584120
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: pbxproject
|
82
|
-
requirement: &
|
82
|
+
requirement: &70321592583460 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70321592583460
|
91
91
|
description: calabash-cucumber drives tests for native iOS apps. You must link your
|
92
92
|
app with calabash-ios-server framework to execute tests.
|
93
93
|
email:
|