Class: Google::Apis::TestingV1::AndroidInstrumentationTest

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/testing_v1/classes.rb,
generated/google/apis/testing_v1/representations.rb,
generated/google/apis/testing_v1/representations.rb

Overview

A test of an Android application that can control an Android component independently of its normal lifecycle. Android instrumentation tests run an application APK and test APK inside the same process on a virtual or physical AndroidDevice. They also specify a test runner class, such as com.google.GoogleTestRunner, which can vary on the specific instrumentation framework chosen. See http://developer.android.com/tools/testing/testing_android.html for more information on types of Android tests.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ AndroidInstrumentationTest

Returns a new instance of AndroidInstrumentationTest



214
215
216
# File 'generated/google/apis/testing_v1/classes.rb', line 214

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#app_apkGoogle::Apis::TestingV1::FileReference

A reference to a file, used for user inputs. Corresponds to the JSON property appApk



162
163
164
# File 'generated/google/apis/testing_v1/classes.rb', line 162

def app_apk
  @app_apk
end

#app_package_idString

The java package for the application under test. Optional, default is determined by examining the application's manifest. Corresponds to the JSON property appPackageId

Returns:

  • (String)


168
169
170
# File 'generated/google/apis/testing_v1/classes.rb', line 168

def app_package_id
  @app_package_id
end

#orchestrator_optionString

The option of whether running each test within its own invocation of instrumentation with Android Test Orchestrator or not. ** Orchestrator is only compatible with AndroidJUnitRunner version 1.0 or higher! ** Orchestrator offers the following benefits:

  • No shared state
  • Crashes are isolated
  • Logs are scoped per test See for more information about Android Test Orchestrator. Optional, if empty, test will be run without orchestrator. Corresponds to the JSON property orchestratorOption

Returns:

  • (String)


185
186
187
# File 'generated/google/apis/testing_v1/classes.rb', line 185

def orchestrator_option
  @orchestrator_option
end

#test_apkGoogle::Apis::TestingV1::FileReference

A reference to a file, used for user inputs. Corresponds to the JSON property testApk



190
191
192
# File 'generated/google/apis/testing_v1/classes.rb', line 190

def test_apk
  @test_apk
end

#test_package_idString

The java package for the test to be executed. Optional, default is determined by examining the application's manifest. Corresponds to the JSON property testPackageId

Returns:

  • (String)


196
197
198
# File 'generated/google/apis/testing_v1/classes.rb', line 196

def test_package_id
  @test_package_id
end

#test_runner_classString

The InstrumentationTestRunner class. Optional, default is determined by examining the application's manifest. Corresponds to the JSON property testRunnerClass

Returns:

  • (String)


202
203
204
# File 'generated/google/apis/testing_v1/classes.rb', line 202

def test_runner_class
  @test_runner_class
end

#test_targetsArray<String>

Each target must be fully qualified with the package name or class name, in one of these formats:

  • "package package_name"
  • "class package_name.class_name"
  • "class package_name.class_name#method_name" Optional, if empty, all targets in the module will be run. Corresponds to the JSON property testTargets

Returns:

  • (Array<String>)


212
213
214
# File 'generated/google/apis/testing_v1/classes.rb', line 212

def test_targets
  @test_targets
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



219
220
221
222
223
224
225
226
227
# File 'generated/google/apis/testing_v1/classes.rb', line 219

def update!(**args)
  @app_apk = args[:app_apk] if args.key?(:app_apk)
  @app_package_id = args[:app_package_id] if args.key?(:app_package_id)
  @orchestrator_option = args[:orchestrator_option] if args.key?(:orchestrator_option)
  @test_apk = args[:test_apk] if args.key?(:test_apk)
  @test_package_id = args[:test_package_id] if args.key?(:test_package_id)
  @test_runner_class = args[:test_runner_class] if args.key?(:test_runner_class)
  @test_targets = args[:test_targets] if args.key?(:test_targets)
end