testautoi 0.9.133 → 0.9.134
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/testautoi +22 -8
- data/lib/calabash-cucumber/version.rb +1 -1
- metadata +2 -2
data/bin/testautoi
CHANGED
@@ -25,13 +25,15 @@ def print_usage
|
|
25
25
|
Install the app
|
26
26
|
install tools
|
27
27
|
Download and install tools from Subversion.
|
28
|
+
uninstall
|
29
|
+
Uninstall the app
|
28
30
|
launch
|
29
31
|
Launch the app
|
30
32
|
getip
|
31
33
|
Get the device's IP address
|
32
34
|
gen
|
33
35
|
Generate the skeleton of features directory
|
34
|
-
sim
|
36
|
+
sim start
|
35
37
|
Start an iOS Simulator
|
36
38
|
sim quit
|
37
39
|
Quit the iOS Simulator
|
@@ -204,6 +206,12 @@ def smb_connect_mac(location,username,password)
|
|
204
206
|
location = location.tr('\\','/')
|
205
207
|
username = username.tr('\\',';').tr('/',';')
|
206
208
|
raise "The build drop location is incorrect" if not location.start_with?("//")
|
209
|
+
paths = location.split('/')
|
210
|
+
if paths.size > 4
|
211
|
+
location = paths.shift(4).join('/')
|
212
|
+
@settings["build_drop_branch_dir"] = [paths.join('/'), @settings["build_drop_branch_dir"]].join('/')
|
213
|
+
@settings["build_drop_trunk_dir"] = [paths.join('/'), @settings["build_drop_trunk_dir"]].join('/')
|
214
|
+
end
|
207
215
|
cmd = "mount -t smbfs //'#{username}':#{password}@#{location[2..-1]} #{mount_node}"
|
208
216
|
output=`#{cmd}` ; result=$?.success?
|
209
217
|
raise "the command '#{cmd}' failed" if result == false
|
@@ -234,16 +242,22 @@ def smb_disconnect(mount_node)
|
|
234
242
|
end
|
235
243
|
|
236
244
|
def unzip_file (file, destination)
|
245
|
+
filenames = []
|
237
246
|
Zip::ZipFile.open(file) { |zip_file|
|
238
247
|
zip_file.each { |f|
|
239
248
|
f_path=File.join(destination, f.name)
|
249
|
+
FileUtils.rm_rf(f_path) if File.exist?(f_path)
|
240
250
|
FileUtils.mkdir_p(File.dirname(f_path))
|
241
251
|
zip_file.extract(f, f_path){ true }
|
252
|
+
filenames << f_path
|
242
253
|
}
|
243
254
|
}
|
255
|
+
filenames
|
244
256
|
end
|
245
257
|
|
246
258
|
def get_build
|
259
|
+
raise "Please configure build drop location, username, and password first by running setup" if @settings["build_drop_location"].to_s.empty? or @settings["build_drop_username"].to_s.empty? or @settings["build_drop_password"].to_s.empty?
|
260
|
+
|
247
261
|
mount_node = smb_connect(@settings["build_drop_location"],
|
248
262
|
@settings["build_drop_username"],
|
249
263
|
@settings["build_drop_password"])
|
@@ -267,18 +281,18 @@ def get_build
|
|
267
281
|
# copy the version build
|
268
282
|
release_path = File.join(mount_node, @settings["build_drop_branch_dir"], "iPhone#{version}", "ConcurMobile", sim, "Release")
|
269
283
|
end
|
284
|
+
raise "No builds found in #{release_path}" unless File.directory?(release_path)
|
270
285
|
build_dir = Dir.entries(release_path).reject{|d|d.start_with?('.')}.sort_by{|c| File.stat(File.join(release_path,c)).ctime}.last
|
286
|
+
raise "No builds found in #{release_path}" if build_dir == nil
|
271
287
|
zip_file = build_dir + ".zip"
|
272
288
|
source = File.join(release_path, build_dir, zip_file)
|
273
289
|
raise "the file '#{source}' does not exist" if not File.exists?(source)
|
274
290
|
dest = File.join(FileUtils.pwd, zip_file)
|
275
291
|
FileUtils.copy(source, dest)
|
276
292
|
puts "Copy the build from #{source}"
|
277
|
-
|
278
|
-
unzip_file(dest, FileUtils.pwd)
|
293
|
+
filenames = unzip_file(dest, FileUtils.pwd)
|
279
294
|
FileUtils.rm_rf(File.join(FileUtils.pwd, app_bundle))
|
280
|
-
FileUtils.cp_r(File.
|
281
|
-
FileUtils.pwd)
|
295
|
+
FileUtils.cp_r(filenames.find{|e| File.basename(e) == app_bundle}, FileUtils.pwd)
|
282
296
|
end
|
283
297
|
|
284
298
|
smb_disconnect(mount_node)
|
@@ -299,8 +313,8 @@ def get_script
|
|
299
313
|
uri = URI.join(uri, feature)
|
300
314
|
puts `svn export --force #{uri} features --username #{username} --password #{password}`
|
301
315
|
|
302
|
-
|
303
|
-
|
316
|
+
uri = URI.join(@settings["svn_location"], "_support/", "support/")
|
317
|
+
puts `svn export --force #{uri} features/support --username #{username} --password #{password}`
|
304
318
|
uri = URI.join(svn_location, "_support/", "step_definition/")
|
305
319
|
puts `svn export --force #{uri} features/step_definitions --username #{username} --password #{password}`
|
306
320
|
end
|
@@ -369,7 +383,7 @@ end
|
|
369
383
|
def app_bundle_id(app_bundle)
|
370
384
|
plist = CFPropertyList::List.new(:file => File.join(app_bundle, "Info.plist"))
|
371
385
|
hash = CFPropertyList.native_types(plist.value)
|
372
|
-
hash[
|
386
|
+
hash["CFBundleIdentifier"]
|
373
387
|
end
|
374
388
|
|
375
389
|
def app_bundle_url_schemes(app_bundle)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testautoi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.134
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cucumber
|