Test UiAutomatora
public class UiAutomatorTest
extends Object
implements IRemoteTest , IDeviceTest , ITestFilterReceiver
Obiekt Java.lang.Object | |
↳ | com.android.tradefed.testtype.UiAutomatorTest |
Streszczenie
Pola | |
---|---|
protected | mListeners
|
Konstruktorzy publiczni | |
---|---|
UiAutomatorTest () |
Metody publiczne | |
---|---|
void | addAllExcludeFilters ( filters) addAllExcludeFilters ( filters) Dodaje |
void | addAllIncludeFilters ( filters) addAllIncludeFilters ( filters) Dodaje |
void | addClassName (String className) Dodaj nazwę klasy testowej do uruchomienia. |
void | addClassNames ( classNames) addClassNames ( classNames) Dodaj kolekcję nazw klas testowych do uruchomienia. |
void | addExcludeFilter (String filter) Dodaje filtr określający, które testy należy wykluczyć. |
void | addIncludeFilter (String filter) Dodaje filtr określający, które testy należy uwzględnić. |
void | addRunArg (String key, String value) Dodaj argument do podania podczas uruchamiania testów UI Automator |
void | clearExcludeFilters () Usuń wszystkie aktualnie śledzone filtry wykluczeń. |
void | clearIncludeFilters () Usuń wszystkie aktualnie śledzone filtry uwzględniania. |
getClassNames () Pobiera listę nazw klas testowych, do uruchamiania których skonfigurowano wiązkę przewodów | |
ITestDevice | getDevice () Oddaj urządzenie do testu. |
getExcludeFilters () Zwraca bieżący | |
getIncludeFilters () Zwraca bieżący | |
long | getSyncTime () |
getTestJarPaths () | |
getTestRunArgMap () | |
IRemoteAndroidTestRunner | getTestRunner () |
boolean | isInstrumentationTest () |
void | run ( TestInformation testInfo, ITestInvocationListener listener) Uruchamia testy i raportuje wyniki słuchaczowi. |
void | setCaptureLogs (boolean captureLogs) Ta metoda jest przestarzała. zamiast tego użyj |
void | setDevice ( ITestDevice device) Wstrzyknij testowane urządzenie. |
void | setLoggingOption ( UiAutomatorTest.LoggingOption loggingOption) |
void | setRunName (String runName) |
void | setRunnerName (String runnerName) |
void | setSyncTime (long syncTime) |
void | setTestJarPaths ( jarPaths) setTestJarPaths ( jarPaths) |
void | setTestRunArgMap ( runArgMap) setTestRunArgMap ( runArgMap) |
Metody chronione | |
---|---|
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 () Sprawdza, czy na urządzeniu znajdują się komponenty UI Automator |
Pola
mlsłuchacze
protectedmListeners
Konstruktorzy publiczni
Test UiAutomatora
public UiAutomatorTest ()
Metody publiczne
addAllExcludeFilters
public void addAllExcludeFilters (filters)
Dodaje ERROR(/Set)
filtrów, z których testy mają zostać wykluczone.
Parametry | |
---|---|
filters |
dodajAllIncludeFilters
public void addAllIncludeFilters (filters)
Dodaje ERROR(/Set)
filtrów, które należy uwzględnić w testach.
Parametry | |
---|---|
filters |
dodajNazwęKlasy
public void addClassName (String className)
Dodaj nazwę klasy testowej do uruchomienia.
Parametry | |
---|---|
className | String |
dodajNazwyKlasy
public void addClassNames (classNames)
Dodaj kolekcję nazw klas testowych do uruchomienia.
Parametry | |
---|---|
classNames |
dodajWykluczFiltr
public void addExcludeFilter (String filter)
Dodaje filtr określający, które testy należy wykluczyć.
Parametry | |
---|---|
filter | String |
dodajIncludeFilter
public void addIncludeFilter (String filter)
Dodaje filtr określający, które testy należy uwzględnić.
Parametry | |
---|---|
filter | String |
dodajRunArg
public void addRunArg (String key, String value)
Dodaj argument do podania podczas uruchamiania testów UI Automator
Parametry | |
---|---|
key | String : nazwa argumentu |
value | String : wartość argumentu |
wyczyśćWykluczFiltry
public void clearExcludeFilters ()
Usuń wszystkie aktualnie śledzone filtry wykluczeń.
wyczyśćIncludeFilters
public void clearIncludeFilters ()
Usuń wszystkie aktualnie śledzone filtry uwzględniania.
pobierzNazwyKlasy
publicgetClassNames ()
Pobiera listę nazw klas testowych, do uruchamiania których skonfigurowano wiązkę przewodów
Zwroty | |
---|---|
lista nazw klas testowych |
pobierz urządzenie
public ITestDevice getDevice ()
Oddaj urządzenie do testu.
Zwroty | |
---|---|
ITestDevice | ITestDevice |
pobierzIncludeFilters
publicgetIncludeFilters ()
Zwraca bieżący ERROR(/Set)
filtrów dołączanych.
Zwroty | |
---|---|
pobierzSyncTime
public long getSyncTime ()
Zwroty | |
---|---|
long | czas przeznaczony na synchronizację testów. |
pobierzTestJarPaths
publicgetTestJarPaths ()
Zwroty | |
---|---|
ścieżka słoika testowego. |
getTestRunArgMap
publicgetTestRunArgMap ()
Zwroty | |
---|---|
mapa argumentów do przekazania do UiAutomatorRunner. |
pobierzTestRunner
public IRemoteAndroidTestRunner getTestRunner ()
Zwroty | |
---|---|
IRemoteAndroidTestRunner | biegacz testowy. |
isInstrumentationTest
public boolean isInstrumentationTest ()
Zwroty | |
---|---|
boolean |
uruchomić
public void run (TestInformation testInfo, ITestInvocationListener listener)
Uruchamia testy i raportuje wyniki słuchaczowi.
Parametry | |
---|---|
testInfo | TestInformation : Obiekt TestInformation zawierający informacje przydatne do uruchamiania testów. |
listener | ITestInvocationListener : ITestInvocationListener wyników testów |
Rzuca | |
---|---|
DeviceNotAvailableException |
ustaw dzienniki przechwytywania
public void setCaptureLogs (boolean captureLogs)
Ta metoda jest przestarzała.
zamiast tego użyj setLoggingOption(com.android.tradefed.testtype.UiAutomatorTest.LoggingOption)
.
Parametry | |
---|---|
captureLogs | boolean |
ustaw urządzenie
public void setDevice (ITestDevice device)
Wstrzyknij testowane urządzenie.
Parametry | |
---|---|
device | ITestDevice : ITestDevice do użycia |
ustaw opcję logowania
public void setLoggingOption (UiAutomatorTest.LoggingOption loggingOption)
Parametry | |
---|---|
loggingOption | UiAutomatorTest.LoggingOption |
ustawNazwęRun
public void setRunName (String runName)
Parametry | |
---|---|
runName | String |
setRunnerName
public void setRunnerName (String runnerName)
Parametry | |
---|---|
runnerName | String |
ustaw czas synchronizacji
public void setSyncTime (long syncTime)
Parametry | |
---|---|
syncTime | long : czas synchronizacji plików testowych. |
setTestJarPaths
public void setTestJarPaths (jarPaths)
Parametry | |
---|---|
jarPaths |
setTestRunArgMap
public void setTestRunArgMap (runArgMap)
Parametry | |
---|---|
runArgMap |
Metody chronione
utwórzTestRunner
protected IRemoteAndroidTestRunner createTestRunner ()
Zwroty | |
---|---|
IRemoteAndroidTestRunner |
Rzuca | |
---|---|
DeviceNotAvailableException |
na ScreenshotAndBugreport
protected void onScreenshotAndBugreport (ITestDevice device, ITestInvocationListener listener, String prefix, UiAutomatorTest.TestFailureAction overrideAction)
Parametry | |
---|---|
device | ITestDevice |
listener | ITestInvocationListener |
prefix | String |
overrideAction | UiAutomatorTest.TestFailureAction |
na ScreenshotAndBugreport
protected void onScreenshotAndBugreport (ITestDevice device, ITestInvocationListener listener, String prefix)
Parametry | |
---|---|
device | ITestDevice |
listener | ITestInvocationListener |
prefix | String |
Konfiguracja wstępna
protected void preTestSetup ()
Sprawdza, czy na urządzeniu znajdują się komponenty UI Automator
Rzuca | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |