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



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

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



155
156
157
# File 'generated/google/apis/testing_v1/classes.rb', line 155

def app_apk
  @app_apk
end

#app_bundleGoogle::Apis::TestingV1::AppBundle

An Android App Bundle file format, containing a BundleConfig.pb file, a base module directory, zero or more dynamic feature module directories.

See https://developer.android.com/guide/app-bundle/build for guidance on building App Bundles. Corresponds to the JSON property appBundle



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

def app_bundle
  @app_bundle
end

#app_package_idString

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

Returns:

  • (String)


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

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. If not set, the test will be run without the orchestrator. Corresponds to the JSON property orchestratorOption

Returns:

  • (String)


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

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



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

def test_apk
  @test_apk
end

#test_package_idString

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

Returns:

  • (String)


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

def test_package_id
  @test_package_id
end

#test_runner_classString

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

Returns:

  • (String)


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

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" If empty, all targets in the module will be run. Corresponds to the JSON property testTargets

Returns:

  • (Array<String>)


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

def test_targets
  @test_targets
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

def update!(**args)
  @app_apk = args[:app_apk] if args.key?(:app_apk)
  @app_bundle = args[:app_bundle] if args.key?(:app_bundle)
  @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