Module: Yolo::Tools::Ios::Calabash

Defined in:
lib/yolo/tools/ios/calabash.rb

Overview

Runs calabash tests and outputs reports

Author:

  • Alex Fish

Class Method Summary collapse

Class Method Details

.run(format = :junit, output_dir = "test-reports/cucumber", device = "iphone") ⇒ type

Runs cucumber calabash tests and outputs reports to a defined location

Parameters:

  • format (defaults to: :junit)

    :junit [Symbol] The test output type, defaults to junit for Jenkins, see the cucumber docs for more options

  • output_dir (defaults to: "test-reports/cucumber")

    “test-reports/cucumber” [String] Folder destination to output the test reports to

Returns:

  • (type)
    description


18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/yolo/tools/ios/calabash.rb', line 18

def self.run(format = :junit, output_dir = "test-reports/cucumber", device = "iphone")
  IO.popen("cucumber --format #{format.to_s} --out #{output_dir} DEVICE=#{device}") do |io|
    begin
      while line = io.readline
        puts line
      end
    rescue EOFError
      Yolo::Formatters::ProgressFormatter.new.tests_generated(output_dir)
    end
  end
  $?.exitstatus if $?
end