class Fastlane::Actions::BluepillarxAction

Constants

BLUEPILL_PATH
BP_PATH

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/bluepillarx/actions/bluepillarx_action.rb, line 50
def self.authors
  ["Shashikant86", "jterhorst"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/bluepillarx/actions/bluepillarx_action.rb, line 62
def self.available_options
  [
     FastlaneCore::ConfigItem.new(key: :app,
                                 env_name: "BLUEPILLAR_APP_PATH",
                                 description: "Path to the main app to be build for the bluepill in the Derived Data",
                                 is_string: true,
                                 optional: true),

     FastlaneCore::ConfigItem.new(key: :runner_app_path,
                                env_name: "BLUEPILLAR_RUNNER_APP_PATH",
                                description: "Path to the test runner app in the Derived Data",
                                is_string: true,
                                optional: true),

     FastlaneCore::ConfigItem.new(key: :scheme_path,
                               env_name: "BLUEPILLAR_XCTEST_SCHEME_PATH",
                               description: "Path to the scheme to be build for the bluepill in the .xcodeproj",
                               is_string: true,
                               optional: true),

     FastlaneCore::ConfigItem.new(key: :output_dir,
                              env_name: "BLUEPILLAR_REPORT_PATH",
                              description: "Path to store simulator logs and test reports",
                              is_string: true,
                              optional: true),

     FastlaneCore::ConfigItem.new(key: :num_sims,
                              env_name: "BLUEPILLAR_SUMULATORS",
                              description: "Number of sumulators to be launched",
                              is_string: true,
                              optional: true),

     FastlaneCore::ConfigItem.new(key: :runtime,
                             env_name: "BLUEPILLAR_IOS_VERSION",
                             description: "The iOS version to be used for testing",
                             is_string: true,
                             optional: true),

     FastlaneCore::ConfigItem.new(key: :device,
                             env_name: "BLUEPILLAR_IOS_DEVICE",
                             description: "The iOS device to be used for testing",
                             is_string: true,
                             optional: true),

     FastlaneCore::ConfigItem.new(key: :config_path,
                             env_name: "BLUEPILLAR_CONFIG_PATH",
                             description: "Path for Bluepill config file",
                             is_string: true,
                             optional: true),
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/bluepillarx/actions/bluepillarx_action.rb, line 46
def self.description
  "Run XCUITests in Parallel using Bluepill"
end
details() click to toggle source
# File lib/fastlane/plugin/bluepillarx/actions/bluepillarx_action.rb, line 58
def self.details
  "This plugin will allow you to run XCUITests in Parallel using LinkedIn's Bluepil"
end
example_code() click to toggle source
# File lib/fastlane/plugin/bluepillarx/actions/bluepillarx_action.rb, line 114
  def self.example_code
       ['   bluepillarx(
                app: "bluepill/Build/Products/Debug-iphonesimulator/Bluepillar.app",
                runner_app_path: "bluepill/Build/Products/Debug-iphonesimulator/BluepillarUITests-Runner.app",
                scheme_path: "Bluepillar.xcodeproj/xcshareddata/xcschemes/Bluepillar.xcscheme",
                output_dir: "bluepill_output/",
                num_sims: "3",
                runtime: '"iOS 10.3"',
            )
      ']
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/bluepillarx/actions/bluepillarx_action.rb, line 126
def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
  true
end
return_value() click to toggle source
# File lib/fastlane/plugin/bluepillarx/actions/bluepillarx_action.rb, line 54
def self.return_value

end
run(params) click to toggle source
# File lib/fastlane/plugin/bluepillarx/actions/bluepillarx_action.rb, line 6
def self.run(params)
  UI.message("Starting XCTests using the bluepillarx fastlane plugin!")
  unless File.exist?(BLUEPILL_PATH)
    UI.user_error!("You must download bluepill binary from Github and put it in /usr/local/bin/bluepill to carry on execution")
  end

  unless File.exist?(BP_PATH)
    UI.user_error!("You must download bp binary from Github and put it in /usr/local/bin/bp to carry on execution")
  end

  bluepill_app_path = params[:app]
  bluepill_runner_app_path = params[:runner_app_path]
  bluepill_scheme_path = params[:scheme_path]
  bluepill_num_sims = params[:num_sims]
  bluepill_output_dir = params[:output_dir]
  bluepill_runtime = params[:runtime]
  bluepill_device = params[:device]
  
  bluepill_config_path = params[:config_path]


  command = [
    'bluepill' 
  ]

  command.concat ['-a', bluepill_app_path] if bluepill_app_path
  command.concat ['-s', bluepill_scheme_path] if bluepill_scheme_path
  command.concat ['-o', bluepill_output_dir] if bluepill_output_dir
  command.concat ['-r', bluepill_runtime] if bluepill_runtime
  command.concat ['-n', bluepill_num_sims] if bluepill_num_sims
  if bluepill_device
    processed_device = bluepill_device.gsub(/ /, '\ ')
    command.concat ['-d', processed_device] if processed_device
  end
  command.concat ['-c', bluepill_config_path] if bluepill_config_path
  command.concat ['-u', bluepill_runner_app_path] if bluepill_runner_app_path

  Actions.sh(command.join(' '))
end