UiAutomatorRunner

public class UiAutomatorRunner
extends Object implements IRemoteAndroidTestRunner

java.lang.Object
   ↳ com.android.tradefed.testtype.UiAutomatorRunner


デバイスで UI Automator テストを実行し、結果を報告します。UI Automator テストは、UI Automator フレームワークを使用する UI 自動化テストを実行するための専用のテストランナーです。デバイス上のテストランナーは、インストルメンテーション テストの出力形式をエミュレートするため、ddmlib と TF の既存の解析コードを再利用できます。基本的に、これは次のコマンドのラッパーです。adb shell uiautomator runtest(jar ファイル)-e class(テストクラス)...

概要

パブリック コンストラクタ

UiAutomatorRunner(IDevice remoteDevice, String[] jarPaths, String runnerPath)

UI 自動化テストを実行する UiAutomatorRunner を作成する

パブリック メソッド

void addBooleanArg(String name, boolean value)

void addInstrumentationArg(String name, String value)

void cancel()

IRemoteAndroidTestRunner.CoverageOutput getCoverageOutputType()
String getPackageName()

最後に追加された Java クラスのパッケージ名を返します。

String getRunnerName()

デフォルトの UiAutomatorTestRunner クラス名を返します。

void removeInstrumentationArg(String name)

void run(ITestRunListener... listeners)

void run( listeners)

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)

uiautomator で SIGHUP を無視するようにオプションを設定します。

void setLogOnly(boolean logOnly)

void setMaxTimeToOutputResponse(long timeout, TimeUnit unit)

void setMaxTimeout(long maxTimeout, TimeUnit unit)
void setMaxtimeToOutputResponse(int maxTimeToOutputResponse)

このメソッドは非推奨です。 代わりに setMaxTimeToOutputResponse(long, TimeUnit) を使用してください。

void setMethodName(String className, String testName)

void setRunName(String runName)

void setTestCollection(boolean b)
void setTestPackageName(String packageName)

void setTestSize(IRemoteAndroidTestRunner.TestSize size)

保護されたメソッド

String getRunCommand()
String getRunnerPath()

パブリック コンストラクタ

UiAutomatorRunner

public UiAutomatorRunner (IDevice remoteDevice, 
                String[] jarPaths, 
                String runnerPath)

UI 自動化テストを実行する UiAutomatorRunner を作成する

パラメータ
remoteDevice IDevice: 操作するリモート デバイス(テストの実行、結果の収集など)

jarPaths String: UI Automator テストケースが存在する jar ファイルのパス。パスは絶対パスまたはデバイス上の /data/local/tmp/ からの相対パスにする必要があります。

runnerPath String: 使用する代替の uiautomator ランナー。null にすることもできます。この場合、デフォルトが使用されます。

パブリック メソッド

addBooleanArg

public void addBooleanArg (String name, 
                boolean value)

パラメータ
name String

value boolean

addInstrumentationArg

public void addInstrumentationArg (String name, 
                String value)

パラメータ
name String

value String

キャンセル

public void cancel ()

getCoverageOutputType

public IRemoteAndroidTestRunner.CoverageOutput getCoverageOutputType ()

戻り値
IRemoteAndroidTestRunner.CoverageOutput

getPackageName

public String getPackageName ()

最後に追加された Java クラスのパッケージ名を返します。

戻り値
String

getRunnerName

public String getRunnerName ()

デフォルトの UiAutomatorTestRunner クラス名を返します。

戻り値
String

removeInstrumentationArg

public void removeInstrumentationArg (String name)

パラメータ
name String

ホームラン

public void run (ITestRunListener... listeners)

パラメータ
listeners ITestRunListener

例外
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

ホームラン

public void run ( listeners)

パラメータ
listeners

例外
AdbCommandRejectedException
ShellCommandUnresponsiveException
TimeoutException

setAdditionalTestOutputLocation

public void setAdditionalTestOutputLocation (String additionalTestDataPath)

パラメータ
additionalTestDataPath String

setClassName

public void setClassName (String className)

パラメータ
className String

setClassNames

public void setClassNames (String[] classNames)

パラメータ
classNames String

setCoverage

public void setCoverage (boolean coverage)

パラメータ
coverage boolean

setCoverageReportLocation

public void setCoverageReportLocation (String arg0)

パラメータ
arg0 String

setDebug

public void setDebug (boolean debug)

パラメータ
debug boolean

setIgnoreSighup

public void setIgnoreSighup (boolean value)

uiautomator で SIGHUP を無視するようにオプションを設定します。

パラメータ
value boolean: true に設定すると、シグナルを無視します

setLogOnly

public void setLogOnly (boolean logOnly)

パラメータ
logOnly boolean

setMaxTimeToOutputResponse

public void setMaxTimeToOutputResponse (long timeout, 
                TimeUnit unit)

パラメータ
timeout long

unit TimeUnit

setMaxTimeout

public void setMaxTimeout (long maxTimeout, 
                TimeUnit unit)

パラメータ
maxTimeout long

unit TimeUnit

setMaxtimeToOutputResponse

public void setMaxtimeToOutputResponse (int maxTimeToOutputResponse)

このメソッドは非推奨です。
代わりに setMaxTimeToOutputResponse(long, TimeUnit) を使用してください。

パラメータ
maxTimeToOutputResponse int

setMethodName

public void setMethodName (String className, 
                String testName)

パラメータ
className String

testName String

setRunName

public void setRunName (String runName)

パラメータ
runName String

setTestCollection

public void setTestCollection (boolean b)

パラメータ
b boolean

setTestPackageName

public void setTestPackageName (String packageName)

パラメータ
packageName String

setTestSize

public void setTestSize (IRemoteAndroidTestRunner.TestSize size)

パラメータ
size IRemoteAndroidTestRunner.TestSize

保護されたメソッド

getRunCommand

protected String getRunCommand ()

戻り値
String

getRunnerPath

protected String getRunnerPath ()

戻り値
String