UiAutomatorTest
public class UiAutomatorTest
extends Object
implements IRemoteTest , IDeviceTest , ITestFilterReceiver
java.lang.Obiekt | |
↳ | com.android.tradefed.testtype.UiAutomatorTest |
Streszczenie
Pola | |
---|---|
protected | mListeners
|
Konstruktory publiczne | |
---|---|
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 testów do wykluczenia. |
void | addIncludeFilter (String filter) Dodaje filtr określający, które testy mają zostać uwzględnione. |
void | addRunArg (String key, String value) Dodaj argument, który ma zostać podany 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, które są skonfigurowane do uruchamiania wiązki | |
ITestDevice | getDevice () Przetestuj urządzenie. |
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 przekazuje 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 komponenty UI Automator są obecne na urządzeniu |
Pola
mSłuchacze
protectedmListeners
Konstruktory publiczne
UiAutomatorTest
public UiAutomatorTest ()
Metody publiczne
addAllExcludeFilters
public void addAllExcludeFilters (filters)
Dodaje ERROR(/Set)
filtrów, z których testy mają zostać wykluczone.
Parametry | |
---|---|
filters |
dodaj filtry AllInclude
public void addAllIncludeFilters (filters)
Dodaje ERROR(/Set)
filtrów, z których testy mają zostać uwzględnione.
Parametry | |
---|---|
filters |
dodajNazwęKlasy
public void addClassName (String className)
Dodaj nazwę klasy testowej do uruchomienia.
Parametry | |
---|---|
className | String |
dodajNazwyKlas
public void addClassNames (classNames)
Dodaj kolekcję nazw klas testowych do uruchomienia.
Parametry | |
---|---|
classNames |
dodaj filtr wykluczenia
public void addExcludeFilter (String filter)
Dodaje filtr testów do wykluczenia.
Parametry | |
---|---|
filter | String |
addIncludeFilter
public void addIncludeFilter (String filter)
Dodaje filtr określający, które testy mają zostać uwzględnione.
Parametry | |
---|---|
filter | String |
dodajRunArg
public void addRunArg (String key, String value)
Dodaj argument, który ma zostać podany podczas uruchamiania testów UI Automator
Parametry | |
---|---|
key | String : nazwa argumentu |
value | String : wartość argumentu |
wyczyść filtry wykluczające
public void clearExcludeFilters ()
Usuń wszystkie aktualnie śledzone filtry wykluczeń.
wyczyść filtry uwzględnienia
public void clearIncludeFilters ()
Usuń wszystkie aktualnie śledzone filtry uwzględniania.
pobierzNazwyKlasy
publicgetClassNames ()
Pobiera listę nazw klas testowych, które są skonfigurowane do uruchamiania wiązki
Zwroty | |
---|---|
lista nazw klas testowych |
pobierzUrządzenie
public ITestDevice getDevice ()
Przetestuj urządzenie.
Zwroty | |
---|---|
ITestDevice | ITestDevice |
pobierz czas synchronizacji
public long getSyncTime ()
Zwroty | |
---|---|
long | czas przeznaczony na synchronizację testów. |
getTestJarPaths
publicgetTestJarPaths ()
Zwroty | |
---|---|
ścieżka słoika testowego. |
getTestRunArgMap
publicgetTestRunArgMap ()
Zwroty | |
---|---|
mapa argumentów do przekazania do UiAutomatorRunner. |
getTestRunner
public IRemoteAndroidTestRunner getTestRunner ()
Zwroty | |
---|---|
IRemoteAndroidTestRunner | biegacz testowy. |
isInstrumentationTest
public boolean isInstrumentationTest ()
Zwroty | |
---|---|
boolean |
uruchomić
public void run (TestInformation testInfo, ITestInvocationListener listener)
Uruchamia testy i przekazuje wyniki słuchaczowi.
Parametry | |
---|---|
testInfo | TestInformation : Obiekt TestInformation zawierający informacje przydatne do uruchamiania testów. |
listener | ITestInvocationListener : ITestInvocationListener wyników testu |
Rzuty | |
---|---|
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 |
setLoggingOption
public void setLoggingOption (UiAutomatorTest.LoggingOption loggingOption)
Parametry | |
---|---|
loggingOption | UiAutomatorTest.LoggingOption |
setRunNazwa
public void setRunName (String runName)
Parametry | |
---|---|
runName | String |
ustawImię Biegacza
public void setRunnerName (String runnerName)
Parametry | |
---|---|
runnerName | String |
ustaw czas synchronizacji
public void setSyncTime (long syncTime)
Parametry | |
---|---|
syncTime | long : czas synchronizacji plików testów. |
ustawTestJarPaths
public void setTestJarPaths (jarPaths)
Parametry | |
---|---|
jarPaths |
setTestRunArgMap
public void setTestRunArgMap (runArgMap)
Parametry | |
---|---|
runArgMap |
Metody chronione
utwórzTestRunner
protected IRemoteAndroidTestRunner createTestRunner ()
Zwroty | |
---|---|
IRemoteAndroidTestRunner |
Rzuty | |
---|---|
DeviceNotAvailableException |
onScreenshotAndBugreport
protected void onScreenshotAndBugreport (ITestDevice device, ITestInvocationListener listener, String prefix, UiAutomatorTest.TestFailureAction overrideAction)
Parametry | |
---|---|
device | ITestDevice |
listener | ITestInvocationListener |
prefix | String |
overrideAction | UiAutomatorTest.TestFailureAction |
onScreenshotAndBugreport
protected void onScreenshotAndBugreport (ITestDevice device, ITestInvocationListener listener, String prefix)
Parametry | |
---|---|
device | ITestDevice |
listener | ITestInvocationListener |
prefix | String |
Wstępna konfiguracja testu
protected void preTestSetup ()
Sprawdza, czy komponenty UI Automator są obecne na urządzeniu
Rzuty | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |