Test Automatu Ui
public class UiAutomatorTest
extends Object
implements IRemoteTest , IDeviceTest , ITestFilterReceiver
java.lang.Object | |
com.android.tradefed.testtype.UiAutomatorTest |
Streszczenie
Klasy zagnieżdżone | |
---|---|
enum | UiAutomatorTest.LoggingOption |
enum | UiAutomatorTest.TestFailureAction
|
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, którego testy należy wykluczyć. |
void | addIncludeFilter (String filter) Dodaje filtr, którego 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 śledzone obecnie filtry wykluczania. |
void | clearIncludeFilters () Usuń wszystkie aktualnie śledzone filtry uwzględniania. |
getClassNames () Pobiera listę nazw klas testowych, które uprząż jest skonfigurowana do uruchomienia | |
ITestDevice | getDevice () Pobierz testowane 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 raportuje wyniki słuchaczowi. |
void | setCaptureLogs (boolean captureLogs) Ta metoda jest przestarzała. zamiast tego użyj |
void | setDevice ( ITestDevice device) Wstrzyknąć 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
ml słuchacze
protectedmListeners
Konstruktorzy publiczni
Test Automatu Ui
public UiAutomatorTest ()
Metody publiczne
addAllExcludeFilters
public void addAllExcludeFilters (filters)
Dodaje ERROR(/Set)
filtrów, których testy należy wykluczyć.
Parametry | |
---|---|
filters |
addAllIncludeFilters
public void addAllIncludeFilters (filters)
Dodaje ERROR(/Set)
filtrów, które mają być uwzględnione w testach.
Parametry | |
---|---|
filters |
addNazwaKlasy
public void addClassName (String className)
Dodaj nazwę klasy testowej do uruchomienia.
Parametry | |
---|---|
className | String |
addClassNames
public void addClassNames (classNames)
Dodaj kolekcję nazw klas testowych do uruchomienia.
Parametry | |
---|---|
classNames |
addExcludeFilter
public void addExcludeFilter (String filter)
Dodaje filtr, którego testy należy wykluczyć.
Parametry | |
---|---|
filter | String |
addIncludeFilter
public void addIncludeFilter (String filter)
Dodaje filtr, którego testy należy uwzględnić.
Parametry | |
---|---|
filter | String |
addRunArg
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 śledzone obecnie filtry wykluczania.
clearIncludeFilters
public void clearIncludeFilters ()
Usuń wszystkie aktualnie śledzone filtry uwzględniania.
getClassNames
publicgetClassNames ()
Pobiera listę nazw klas testowych, które uprząż jest skonfigurowana do uruchomienia
Zwroty | |
---|---|
lista nazw klas testowych |
pobierzUrządzenie
public ITestDevice getDevice ()
Pobierz testowane urządzenie.
Zwroty | |
---|---|
ITestDevice | ITestDevice |
getExcludeFilters
publicgetExcludeFilters ()
Zwraca bieżący ERROR(/Set)
filtrów wykluczających.
Zwroty | |
---|---|
getSyncTime
public long getSyncTime ()
Zwroty | |
---|---|
long | czas przeznaczony na synchronizację testów. |
getTestJarPaths
publicgetTestJarPaths ()
Zwroty | |
---|---|
ścieżka słoika testowego. |
getTestRunArgMap
publicgetTestRunArgMap ()
Zwroty | |
---|---|
mapowanie argumentów do przekazania do UiAutomatorRunner. |
pobierzTestRunner
public IRemoteAndroidTestRunner getTestRunner ()
Zwroty | |
---|---|
IRemoteAndroidTestRunner | biegacz testowy. |
isTest oprzyrządowania
public boolean isInstrumentationTest ()
Zwroty | |
---|---|
boolean |
biegać
public void run (TestInformation testInfo, ITestInvocationListener listener)
Uruchamia testy i raportuje wyniki słuchaczowi.
Parametry | |
---|---|
testInfo | TestInformation : obiekt TestInformation zawierający przydatne informacje do uruchamiania testów. |
listener | ITestInvocationListener : ITestInvocationListener wyników testów |
Rzuty | |
---|---|
DeviceNotAvailableException |
setCaptureLogs
public void setCaptureLogs (boolean captureLogs)
Ta metoda jest przestarzała.
zamiast tego użyj setLoggingOption(com.android.tradefed.testtype.UiAutomatorTest.LoggingOption)
.
Parametry | |
---|---|
captureLogs | boolean |
setDevice
public void setDevice (ITestDevice device)
Wstrzyknąć testowane urządzenie.
Parametry | |
---|---|
device | ITestDevice : ITestDevice do użycia |
setLoggingOption
public void setLoggingOption (UiAutomatorTest.LoggingOption loggingOption)
Parametry | |
---|---|
loggingOption | UiAutomatorTest.LoggingOption |
setRunName
public void setRunName (String runName)
Parametry | |
---|---|
runName | String |
setRunnerName
public void setRunnerName (String runnerName)
Parametry | |
---|---|
runnerName | String |
setSyncTime
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 |
Rzuty | |
---|---|
DeviceNotAvailableException |
onScreenshot And Bugreport
protected void onScreenshotAndBugreport (ITestDevice device, ITestInvocationListener listener, String prefix, UiAutomatorTest.TestFailureAction overrideAction)
Parametry | |
---|---|
device | ITestDevice |
listener | ITestInvocationListener |
prefix | String |
overrideAction | UiAutomatorTest.TestFailureAction |
onScreenshot And Bugreport
protected void onScreenshotAndBugreport (ITestDevice device, ITestInvocationListener listener, String prefix)
Parametry | |
---|---|
device | ITestDevice |
listener | ITestInvocationListener |
prefix | String |
Konfiguracja wstępna
protected void preTestSetup ()
Sprawdza, czy komponenty UI Automator są obecne na urządzeniu
Rzuty | |
---|---|
DeviceNotAvailableException |
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2022-08-15 UTC.