Class: Fastlane::Actions::BluepillAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/bluepill/actions/bluepill_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



25
26
27
# File 'lib/fastlane/plugin/bluepill/actions/bluepill_action.rb', line 25

def self.authors
  ["tbrand"]
end

.available_optionsObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/fastlane/plugin/bluepill/actions/bluepill_action.rb', line 36

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :scheme,
                                 env_name: "BLUEPILL_SCHEME_PATH",
                                 description: "scheme path (.xcscheme)",
                                 optional: false,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :output_dir,
                                 env_name: "BLUEPILL_OUTPUT_DIR",
                                 description: "output directory for bluepill logs and reports",
                                 optional: false,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :app,
                                 env_name: "BLUEPILL_APP_PATH",
                                 description: "app path (.app)",
                                 optional: false,
                                 is_string: true),
    FastlaneCore::ConfigItem.new(key: :device,
                                 env_name: "BLUEPILL_DEVICE",
                                 description: "device for using in the test",
                                 is_string: true,
                                 optional: false,
                                 default_value: "iPhone 6"),
    FastlaneCore::ConfigItem.new(key: :headless,
                                 env_name: "BLUEPILL_HEADLESS",
                                 description: "run in headless mode (no GUI)",
                                 is_string: false,
                                 optional: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :number_of_simulators,
                                 env_name: "BLUEPILL_NUMBER_OF_SIMLATORS",
                                 description: "number of simulators to run in parallel. (bluepill only)",
                                 is_string: false,
                                 optional: false,
                                 default_value: 4),
    FastlaneCore::ConfigItem.new(key: :reuse_simulator,
                                 env_name: "BLUEPILL_REUSE_SIMULATOR",
                                 description: "reuse simulator or not",
                                 is_string: false,
                                 optional: true,
                                 default_value: false)
  ]
end

.bin_bluepillObject



17
18
19
# File 'lib/fastlane/plugin/bluepill/actions/bluepill_action.rb', line 17

def self.bin_bluepill
  File.expand_path('../../../../../../bin/bluepill', __FILE__)
end

.descriptionObject



21
22
23
# File 'lib/fastlane/plugin/bluepill/actions/bluepill_action.rb', line 21

def self.description
  "Plugin to use bluepill in fastlane"
end

.detailsObject



32
33
34
# File 'lib/fastlane/plugin/bluepill/actions/bluepill_action.rb', line 32

def self.details
  "Bluepill is powered by LinkedIn: https://github.com/linkedin/bluepill"
end

.example_codeObject



84
85
86
87
88
89
90
91
92
# File 'lib/fastlane/plugin/bluepill/actions/bluepill_action.rb', line 84

def self.example_code
  [
    'bluepill(
          scheme: "path/to/SomeApp.xcscheme",
          output_dir: "path/to/output_dir", # Bluepill\'s output dir such as log file
          app: "path/to/SomeApp.app",
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/fastlane/plugin/bluepill/actions/bluepill_action.rb', line 80

def self.is_supported?(platform)
  platform == :ios
end

.return_valueObject

Nothing to return



30
# File 'lib/fastlane/plugin/bluepill/actions/bluepill_action.rb', line 30

def self.return_value; end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/fastlane/plugin/bluepill/actions/bluepill_action.rb', line 4

def self.run(params)
  UI.message("Start test by using Bluepill: https://github.com/linkedin/bluepill")
  cmd =  bin_bluepill.to_s
  cmd << " -a #{params[:app]}"
  cmd << " -o #{params[:output_dir]}"
  cmd << " -s #{params[:scheme]}"
  cmd << " -d \"#{params[:device]}\""
  cmd << " -n #{params[:number_of_simulators]}"
  cmd << " -H" if params[:headless]
  cmd << " --reuse-simulator" if params[:reuse_simulator]
  sh cmd
end