Class: Yolo::Tasks::Ios::Calabash

Inherits:
BaseTask
  • Object
show all
Defined in:
lib/yolo/tasks/ios/calabash.rb

Overview

Executes all calabash related tasks

Author:

  • Alex Fish

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseTask

#name

Constructor Details

#initializeCalabash

Initializes the class with default settings



21
22
23
24
25
26
27
# File 'lib/yolo/tasks/ios/calabash.rb', line 21

def initialize
  self.sdk = "iphonesimulator" unless sdk
  self.format = :junit
  self.device = "iphone"
  self.output_dir = "test-reports/calabash"
  super
end

Instance Attribute Details

#deviceObject

The device to run the tests on



16
17
18
# File 'lib/yolo/tasks/ios/calabash.rb', line 16

def device
  @device
end

#formatObject

The test report output format



12
13
14
# File 'lib/yolo/tasks/ios/calabash.rb', line 12

def format
  @format
end

#output_dirObject

The directory to output the test reports



14
15
16
# File 'lib/yolo/tasks/ios/calabash.rb', line 14

def output_dir
  @output_dir
end

Instance Method Details

#defineObject

Defines rake tasks available to the Calabash class



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/yolo/tasks/ios/calabash.rb', line 47

def define
  super
  namespace :yolo do
    namespace :calabash do
      desc "Runs the specified scheme(s) calabash tests."
      task :test do
        xcodebuild :clean
        xcodebuild :build
        Yolo::Tools::Ios::Calabash.run(format, output_dir, device)
      end
    end
  end
end

#schemeString

Returns the calabash class’s scheme attribute, if no attribute is set then check for the scheme env var

Returns:

  • (String)

    The calabash class’s scheme attribute



34
35
36
37
38
39
40
41
42
# File 'lib/yolo/tasks/ios/calabash.rb', line 34

def scheme
  scheme = @scheme

  if !scheme
    scheme = ENV['YOLO_CALABASH_SCHEME']
  end

  return scheme
end