UiAutomatorTest
public
class
UiAutomatorTest
extends Object
implements
IRemoteTest,
IDeviceTest,
ITestFilterReceiver
java.lang.Object | |
↳ | com.android.tradefed.testtype.UiAutomatorTest |
Summary
Nested classes | |
---|---|
enum |
UiAutomatorTest.LoggingOption
|
enum |
UiAutomatorTest.TestFailureAction
|
Fields | |
---|---|
protected
Collection<ITestLifeCycleReceiver> |
mListeners
|
Public constructors | |
---|---|
UiAutomatorTest()
|
Public methods | |
---|---|
void
|
addAllExcludeFilters(Set<String> filters)
Adds the |
void
|
addAllIncludeFilters(Set<String> filters)
Adds the |
void
|
addClassName(String className)
Add a test class name to run. |
void
|
addClassNames(Collection<String> classNames)
Add a test class name collection to run. |
void
|
addExcludeFilter(String filter)
Adds a filter of which tests to exclude. |
void
|
addIncludeFilter(String filter)
Adds a filter of which tests to include. |
void
|
addRunArg(String key, String value)
Add an argument to provide when running the UI Automator tests |
List<String>
|
getClassNames()
Gets the list of test class names that the harness is configured to run |
ITestDevice
|
getDevice()
Get the device under test. |
long
|
getSyncTime()
|
List<String>
|
getTestJarPaths()
|
Map<String, String>
|
getTestRunArgMap()
|
IRemoteAndroidTestRunner
|
getTestRunner()
|
boolean
|
isInstrumentationTest()
|
void
|
run(ITestInvocationListener listener)
Runs the tests, and reports result to the listener. |
void
|
setCaptureLogs(boolean captureLogs)
This method is deprecated.
use |
void
|
setDevice(ITestDevice device)
Inject the device under test. |
void
|
setLoggingOption(UiAutomatorTest.LoggingOption loggingOption)
|
void
|
setRunName(String runName)
|
void
|
setRunnerName(String runnerName)
|
void
|
setSyncTime(long syncTime)
|
void
|
setTestJarPaths(List<String> jarPaths)
|
void
|
setTestRunArgMap(Map<String, String> runArgMap)
|
Protected methods | |
---|---|
IRemoteAndroidTestRunner
|
createTestRunner()
|
IRunUtil
|
getRunUtil()
|
void
|
onScreenshotAndBugreport(ITestDevice device, ITestInvocationListener listener, String prefix, UiAutomatorTest.TestFailureAction overrideAction)
|
void
|
onScreenshotAndBugreport(ITestDevice device, ITestInvocationListener listener, String prefix)
|
void
|
preTestSetup()
Checks if the UI Automator components are present on device |
Fields
Public constructors
UiAutomatorTest
public UiAutomatorTest ()
Public methods
addAllExcludeFilters
public void addAllExcludeFilters (Set<String> filters)
Adds the Set
of filters of which tests to exclude.
Parameters | |
---|---|
filters |
Set |
addAllIncludeFilters
public void addAllIncludeFilters (Set<String> filters)
Adds the Set
of filters of which tests to include.
Parameters | |
---|---|
filters |
Set |
addClassName
public void addClassName (String className)
Add a test class name to run.
Parameters | |
---|---|
className |
String |
addClassNames
public void addClassNames (Collection<String> classNames)
Add a test class name collection to run.
Parameters | |
---|---|
classNames |
Collection |
addExcludeFilter
public void addExcludeFilter (String filter)
Adds a filter of which tests to exclude.
Parameters | |
---|---|
filter |
String |
addIncludeFilter
public void addIncludeFilter (String filter)
Adds a filter of which tests to include.
Parameters | |
---|---|
filter |
String |
addRunArg
public void addRunArg (String key, String value)
Add an argument to provide when running the UI Automator tests
Parameters | |
---|---|
key |
String : the argument name |
value |
String : the argument value
|
getClassNames
public List<String> getClassNames ()
Gets the list of test class names that the harness is configured to run
Returns | |
---|---|
List<String> |
list of test class names |
getDevice
public ITestDevice getDevice ()
Get the device under test.
Returns | |
---|---|
ITestDevice |
the ITestDevice
|
getSyncTime
public long getSyncTime ()
Returns | |
---|---|
long |
the time allocated for the tests to sync. |
getTestJarPaths
public List<String> getTestJarPaths ()
Returns | |
---|---|
List<String> |
the test jar path. |
getTestRunArgMap
public Map<String, String> getTestRunArgMap ()
Returns | |
---|---|
Map<String, String> |
the arguments map to pass to the UiAutomatorRunner. |
getTestRunner
public IRemoteAndroidTestRunner getTestRunner ()
Returns | |
---|---|
IRemoteAndroidTestRunner |
the test runner. |
isInstrumentationTest
public boolean isInstrumentationTest ()
Returns | |
---|---|
boolean |
run
public void run (ITestInvocationListener listener)
Runs the tests, and reports result to the listener.
Parameters | |
---|---|
listener |
ITestInvocationListener : the ITestInvocationListener of test results |
Throws | |
---|---|
DeviceNotAvailableException |
setCaptureLogs
public void setCaptureLogs (boolean captureLogs)
This method is deprecated.
use setLoggingOption(LoggingOption)
instead.
Parameters | |
---|---|
captureLogs |
boolean |
setDevice
public void setDevice (ITestDevice device)
Inject the device under test.
Parameters | |
---|---|
device |
ITestDevice : the ITestDevice to use
|
setLoggingOption
public void setLoggingOption (UiAutomatorTest.LoggingOption loggingOption)
Parameters | |
---|---|
loggingOption |
UiAutomatorTest.LoggingOption |
setRunName
public void setRunName (String runName)
Parameters | |
---|---|
runName |
String |
setRunnerName
public void setRunnerName (String runnerName)
Parameters | |
---|---|
runnerName |
String |
setSyncTime
public void setSyncTime (long syncTime)
Parameters | |
---|---|
syncTime |
long : the time for the tests files to sync.
|
setTestJarPaths
public void setTestJarPaths (List<String> jarPaths)
Parameters | |
---|---|
jarPaths |
List : the locations of the test jars.
|
setTestRunArgMap
public void setTestRunArgMap (Map<String, String> runArgMap)
Parameters | |
---|---|
runArgMap |
Map : the arguments to pass to the UiAutomatorRunner.
|
Protected methods
createTestRunner
protected IRemoteAndroidTestRunner createTestRunner ()
Returns | |
---|---|
IRemoteAndroidTestRunner |
onScreenshotAndBugreport
protected void onScreenshotAndBugreport (ITestDevice device, ITestInvocationListener listener, String prefix, UiAutomatorTest.TestFailureAction overrideAction)
Parameters | |
---|---|
device |
ITestDevice |
listener |
ITestInvocationListener |
prefix |
String |
overrideAction |
UiAutomatorTest.TestFailureAction |
onScreenshotAndBugreport
protected void onScreenshotAndBugreport (ITestDevice device, ITestInvocationListener listener, String prefix)
Parameters | |
---|---|
device |
ITestDevice |
listener |
ITestInvocationListener |
prefix |
String |
preTestSetup
protected void preTestSetup ()
Checks if the UI Automator components are present on device
Throws | |
---|---|
DeviceNotAvailableException |
Interfaces
- CodeCoverageReportFormat
- IAbi
- IAbiReceiver
- IBuildReceiver
- IDeviceTest
- IInvocationContextReceiver
- IMultiDeviceTest
- INativeDeviceTest
- IRemoteTest
- IResumableTest
- IRetriableTest
- IRuntimeHintProvider
- ISetOptionReceiver
- IShardableTest
- IStrictShardableTest
- ITestAnnotationFilterReceiver
- ITestCollector
- ITestFileFilterReceiver
- ITestFilterReceiver
Classes
- Abi
- AndroidJUnitTest
- CodeCoverageListener
- CodeCoverageTest
- CodeCoverageTestBase
- CodeCoverageTestBase.CoverageCollectingListener
- CompanionAwareTest
- DeviceBatteryLevelChecker
- DeviceJUnit4ClassRunner
- DeviceJUnit4ClassRunner.LogAnnotation
- DeviceJUnit4ClassRunner.MetricAnnotation
- DeviceJUnit4ClassRunner.TestLogData
- DeviceJUnit4ClassRunner.TestMetrics
- DeviceSuite
- DeviceTestCase
- DeviceTestResult
- DeviceTestSuite
- FakeTest
- GoogleBenchmarkResultParser
- GoogleBenchmarkTest
- GTest
- GTestListTestParser
- GTestResultParser
- GTestXmlResultParser
- HostTest
- InstalledInstrumentationsTest
- InstrumentationFileTest
- InstrumentationSerialTest
- InstrumentationTest
- InstrumentationTest.FailedTestLogcatGenerator
- InstrumentationTest.FailedTestScreenshotGenerator
- JacocoCodeCoverageTest
- JUnitRunUtil
- MetricTestCase
- MetricTestCase.LogHolder
- NativeBenchmarkTest
- NativeBenchmarkTestParser
- NativeStressTest
- NativeStressTestParser
- NoisyDryRunTest
- PythonUnitTestResultParser
- PythonUnitTestRunner
- StubTest
- SubprocessTfLauncher
- TfTestLauncher
- UiAutomatorRunner
- UiAutomatorTest
- VersionedTfLauncher
Enums
Exceptions
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.