UiAutomatorRunner
public
class
UiAutomatorRunner
extends Object
implements
IRemoteAndroidTestRunner
java.lang.Object | |
↳ | com.android.tradefed.testtype.UiAutomatorRunner |
Uruchamia test UI Automator na urządzeniu i zgłasza wyniki. Test UI Automator to dedykowany testujący do uruchamiania testów automatyzacji interfejsu użytkownika, który korzysta z ramy UI Automator. Test Runner na urządzeniu emuluje format wyjściowy testów instrumentacji, dzięki czemu można ponownie użyć istniejącego kodu analizowania w bibliotece ddmlib i TF. Jest to w podstawie zewnętrzna warstwa tego polecenia: adb shell uiautomator runtest (jar files) -e class (test classes) ...
Podsumowanie
Konstruktory publiczne | |
---|---|
UiAutomatorRunner(IDevice remoteDevice, String[] jarPaths, String runnerPath)
Tworzenie klasy UiAutomatorRunner na potrzeby uruchamiania testów automatyzacji interfejsu użytkownika |
Metody publiczne | |
---|---|
void
|
addBooleanArg(String name, boolean value)
|
void
|
addInstrumentationArg(String name, String value)
|
void
|
cancel()
|
IRemoteAndroidTestRunner.CoverageOutput
|
getCoverageOutputType()
|
String
|
getPackageName()
Zwraca nazwę pakietu ostatniej dodanej klasy Java. |
String
|
getRunnerName()
Zwraca domyślną nazwę klasy UiAutomatorTestRunner. |
void
|
removeInstrumentationArg(String name)
|
void
|
run(ITestRunListener... listeners)
|
void
|
run(
|
void
|
setAdditionalTestOutputLocation(String additionalTestDataPath)
|
void
|
setClassName(String className)
|
void
|
setClassNames(String[] classNames)
|
void
|
setCoverage(boolean coverage)
|
void
|
setCoverageReportLocation(String arg0)
|
void
|
setDebug(boolean debug)
|
void
|
setIgnoreSighup(boolean value)
Ustawia w uiautomatorze opcję ignorowania sygnału SIGHUP. |
void
|
setLogOnly(boolean logOnly)
|
void
|
setMaxTimeToOutputResponse(long timeout, TimeUnit unit)
|
void
|
setMaxTimeout(long maxTimeout, TimeUnit unit)
|
void
|
setMaxtimeToOutputResponse(int maxTimeToOutputResponse)
Ta metoda została wycofana.
użyj w zastępstwie tego |
void
|
setMethodName(String className, String testName)
|
void
|
setRunName(String runName)
|
void
|
setTestCollection(boolean b)
|
void
|
setTestPackageName(String packageName)
|
void
|
setTestSize(IRemoteAndroidTestRunner.TestSize size)
|
Chronione metody | |
---|---|
String
|
getRunCommand()
|
String
|
getRunnerPath()
|
Konstruktory publiczne
UiAutomatorRunner
public UiAutomatorRunner (IDevice remoteDevice, String[] jarPaths, String runnerPath)
Tworzenie klasy UiAutomatorRunner na potrzeby uruchamiania testów automatyzacji interfejsu użytkownika
Parametry | |
---|---|
remoteDevice |
IDevice : urządzenie zdalne, z którym chcesz wchodzić w interakcje: uruchamiać testy, zbierać wyniki itp. |
jarPaths |
String : ścieżki do plików jar, w których znajdują się przypadki testowe UI Automator; ścieżki muszą być bezwzględne lub względne względem katalogu /data/local/tmp/ na urządzeniu |
runnerPath |
String : alternatywny program uiautomator do użycia, może to być null . W tym przypadku zostanie użyty domyślny program |
Metody publiczne
addBooleanArg
public void addBooleanArg (String name, boolean value)
Parametry | |
---|---|
name |
String |
value |
boolean |
addInstrumentationArg
public void addInstrumentationArg (String name, String value)
Parametry | |
---|---|
name |
String |
value |
String |
anuluj
public void cancel ()
getCoverageOutputType
public IRemoteAndroidTestRunner.CoverageOutput getCoverageOutputType ()
Zwroty | |
---|---|
IRemoteAndroidTestRunner.CoverageOutput |
getPackageName
public String getPackageName ()
Zwraca nazwę pakietu ostatniej dodanej klasy Java.
Zwroty | |
---|---|
String |
getRunnerName
public String getRunnerName ()
Zwraca domyślną nazwę klasy UiAutomatorTestRunner.
Zwroty | |
---|---|
String |
removeInstrumentationArg
public void removeInstrumentationArg (String name)
Parametry | |
---|---|
name |
String |
home run
public void run (ITestRunListener... listeners)
Parametry | |
---|---|
listeners |
ITestRunListener |
Rzuty | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
home run
public void run (listeners)
Parametry | |
---|---|
listeners |
|
Rzuty | |
---|---|
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
setAdditionalTestOutputLocation
public void setAdditionalTestOutputLocation (String additionalTestDataPath)
Parametry | |
---|---|
additionalTestDataPath |
String |
setClassName
public void setClassName (String className)
Parametry | |
---|---|
className |
String |
setClassNames
public void setClassNames (String[] classNames)
Parametry | |
---|---|
classNames |
String |
setCoverage
public void setCoverage (boolean coverage)
Parametry | |
---|---|
coverage |
boolean |
setCoverageReportLocation
public void setCoverageReportLocation (String arg0)
Parametry | |
---|---|
arg0 |
String |
setDebug
public void setDebug (boolean debug)
Parametry | |
---|---|
debug |
boolean |
setIgnoreSighup
public void setIgnoreSighup (boolean value)
Ustawia w uiautomatorze opcję ignorowania sygnału SIGHUP.
Parametry | |
---|---|
value |
boolean : ignorowanie sygnału, jeśli ustawiono wartość „true” |
setLogOnly
public void setLogOnly (boolean logOnly)
Parametry | |
---|---|
logOnly |
boolean |
setMaxTimeToOutputResponse
public void setMaxTimeToOutputResponse (long timeout, TimeUnit unit)
Parametry | |
---|---|
timeout |
long |
unit |
TimeUnit |
setMaxTimeout
public void setMaxTimeout (long maxTimeout, TimeUnit unit)
Parametry | |
---|---|
maxTimeout |
long |
unit |
TimeUnit |
setMaxtimeToOutputResponse
public void setMaxtimeToOutputResponse (int maxTimeToOutputResponse)
Ta metoda została wycofana.
Zamiast niej użyj interfejsu setMaxTimeToOutputResponse(long, TimeUnit)
.
Parametry | |
---|---|
maxTimeToOutputResponse |
int |
setMethodName
public void setMethodName (String className, String testName)
Parametry | |
---|---|
className |
String |
testName |
String |
setRunName
public void setRunName (String runName)
Parametry | |
---|---|
runName |
String |
setTestCollection
public void setTestCollection (boolean b)
Parametry | |
---|---|
b |
boolean |
setTestPackageName
public void setTestPackageName (String packageName)
Parametry | |
---|---|
packageName |
String |
setTestSize
public void setTestSize (IRemoteAndroidTestRunner.TestSize size)
Parametry | |
---|---|
size |
IRemoteAndroidTestRunner.TestSize |
Chronione metody
getRunCommand
protected String getRunCommand ()
Zwroty | |
---|---|
String |
getRunnerPath
protected String getRunnerPath ()
Zwroty | |
---|---|
String |