lib/snapshot/runner.rb in snapshot-0.3.3 vs lib/snapshot/runner.rb in snapshot-0.4.0
- old
+ new
@@ -2,14 +2,10 @@
module Snapshot
class Runner
TRACE_DIR = '/tmp/snapshot_traces'
- def initialize
- Snapshot::DependencyChecker.check_dependencies
- end
-
def work(clean: true)
SnapshotConfig.shared_instance.js_file # to verify the file can be found
Builder.new.build_app(clean: clean)
@app_path = Dir.glob("/tmp/snapshot/build/*.app").first
@@ -20,21 +16,16 @@
SnapshotConfig.shared_instance.devices.each do |device|
SnapshotConfig.shared_instance.blocks[:setup_for_device_change].call(device) # Callback
SnapshotConfig.shared_instance.languages.each do |language|
-
- # uninstall_app(device)
-
SnapshotConfig.shared_instance.blocks[:setup_for_language_change].call(language, device) # Callback
begin
errors.concat(run_tests(device, language))
counter += copy_screenshots(language)
- rescue SystemExit, Interrupt => ex
- raise ex # system interrupted exception (ctrl + C)
- rescue StandardError => ex
+ rescue => ex
Helper.log.error(ex)
end
SnapshotConfig.shared_instance.blocks[:teardown_language].call(language, device) # Callback
end
SnapshotConfig.shared_instance.blocks[:teardown_device].call(device) # Callback
@@ -99,35 +90,9 @@
errors = run_tests(device, language)
end
return errors
end
-
- # def uninstall_app(device)
- # def com(str)
- # puts str.yellow
- # puts `#{str}`
- # sleep 1.0
- # end
-
- # def find_simulator(name)
- # all = `instruments -s`.split("\n")
- # all.each do |current|
- # return current.match(/\[(.*)\]/)[1] if current.include?name
- # end
- # raise "Could not find simulator '#{name}' to install the app on."
- # end
-
- # udid = find_simulator(device)
- # com("killall 'iOS Simulator'")
- # com("xcrun simctl boot '#{udid}'")
- # com("xcrun simctl uninstall '#{udid}' 'net.sunapps.123'") # TODO: Dynamic
- # sleep 3
- # com("xcrun simctl install '#{udid}' '#{@app_path}'")
- # com("xcrun simctl shutdown '#{udid}'")
- # sleep 1
- # com("killall 'iOS Simulator'")
- # end
def parse_test_line(line)
if line =~ /.*Target failed to run.*/
return :retry
elsif line.include?"Screenshot captured"
\ No newline at end of file