class Cuesmash::Command

The main point of entry for all commands, Command parses command line arguments and decides what to do about them.

@author [alexfish]

Public Class Methods

create_appium_txt(platform_name: 'iOS', device_name:, platform_version:, app:, timeout:, udid: nil) click to toggle source

Update appium.txt file with the directory of the build product

@param platform_name [String] default 'iOS' name of platform to test on (Android or iOS) @param device_name [String] deviceName = “iPhone Simulator” @param platform_version [String] platformVersion = “7.1” @param app [String] path to built .app file @param timeout [String] time in seconds to set the newCommandTimeout to.

# File lib/cuesmash/command.rb, line 88
def self.create_appium_txt(platform_name: 'iOS', device_name:, platform_version:, app:, timeout:, udid: nil)
  appium = AppiumText.new(platform_name: platform_name,
                          device_name: device_name,
                          platform_version: platform_version,
                          app: app,
                          new_command_timeout: timeout,
                          udid: udid)
  appium.execute
end
execute(device:, os:, scheme:, tags:, debug: false, format: nil, output: nil, app:, profile:, quiet: false, timeout:, ios_udid: nil) click to toggle source

Execute a command with some arguments then figure out what we're supposed to be doing with the arguments

@param device [String] @param os [String] @param tags [Array] @param debug [Boolean] @param format [String] @param output [String] @param app [IosApp Object] @param profile [String] @param quiet [String] @param timeout [String] newCommandTimeout for appium in seconds

@return [type] [description]

# File lib/cuesmash/command.rb, line 29
def self.execute(device:,
                 os:,
                 scheme:,
                 tags:,
                 debug: false,
                 format: nil,
                 output: nil,
                 app:,
                 profile:,
                 quiet: false,
                 timeout:,
                 ios_udid: nil)
  if debug
    Logger.level = ::Logger::DEBUG
    Logger.formatter = proc do |serverity, time, _progname, msg|
      "\n#{time}\t#{serverity}\t#{msg.rstrip}"
    end
  end

  # Update the appium.txt file
  create_appium_txt(app: app.app_path, device_name: device, platform_version: os, timeout: timeout, udid: ios_udid)

  # start the appium server
  app_server = AppiumServer.new
  app_server.start_server

  # Run the tests
  run_tests(tags: tags, profile: profile, format: format, output: output, quiet: quiet)

  # Stop the Appium server
  # app_server.stop_server
end
run_tests(tags:, profile:, format: nil, output: nil, quiet: false) click to toggle source

Run the cucumber tests, that's why we're here afterall

@param ios [String] The iOS version to test with @param tags [Array] The cucumber tags to test with @param profile [String] cucumber profile to use @param format [String] The output format for the cucumber tests, Optional @param output [String] The path to the output directory to output test reports to, Optional @param quiet [Boolean] quiet flag for cucumber

# File lib/cuesmash/command.rb, line 72
def self.run_tests(tags:, profile:, format: nil, output: nil, quiet: false)
  cucumber = Cuesmash::Cucumber.new(tags, profile, quiet)
  cucumber.format = format if format
  cucumber.output = output if output
  cucumber.test
end