本文整理汇总了Java中android.support.test.uiautomator.Configurator.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Configurator.getInstance方法的具体用法?Java Configurator.getInstance怎么用?Java Configurator.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.test.uiautomator.Configurator
的用法示例。
在下文中一共展示了Configurator.getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: beforeClass
import android.support.test.uiautomator.Configurator; //导入方法依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
Log.v(TAG, new Exception().getStackTrace()[0].getMethodName() + "()");
// Get command line parameters
getArguments();
// Create screenshot folder
File path = Environment.getExternalStorageDirectory();
Config.sOutputDir = new File(String.format("%s/AppCrawler/%s", path.getAbsolutePath(), Config.sTargetPackage));
deleteRecursive(Config.sOutputDir);
if (!Config.sOutputDir.exists()) {
if (!Config.sOutputDir.mkdirs()) {
Log.d(TAG, "Failed to create screenshot folder: " + Config.sOutputDir.getPath());
}
}
// Init File log
Config.sFileLog = Config.sOutputDir + "/" + Config.TAG + ".log";
FileLog.i(TAG_MAIN, "Version: " + Config.VERSION);
// Init Performance log
Config.sPerformanceLog = Config.sOutputDir + "/Performance.csv";
PerformanceMonitor.init();
// Set timeout longer so we can see the ANR dialog?
Configurator conf = Configurator.getInstance();
conf.setActionAcknowledgmentTimeout(200L); // Generally, this timeout should not be modified, default 3000
conf.setScrollAcknowledgmentTimeout(100L); // Generally, this timeout should not be modified, default 200
conf.setWaitForIdleTimeout(0L);
conf.setWaitForSelectorTimeout(0L);
//conf.setKeyInjectionDelay(0L);
logConfiguration();
// Register UiWatchers: ANR, CRASH, ....
UiHelper.registerAnrAndCrashWatchers();
// Good practice to start from the home screen (launcher)
UiHelper.launchHome();
}
示例2: logConfiguration
import android.support.test.uiautomator.Configurator; //导入方法依赖的package包/类
public static void logConfiguration() {
Configurator conf = Configurator.getInstance();
String log = String.format("ActionAcknowledgmentTimeout:%d," +
" KeyInjectionDelay:%d, " +
"ScrollAcknowledgmentTimeout:%d," +
" WaitForIdleTimeout:%d," +
" WaitForSelectorTimeout:%d",
conf.getActionAcknowledgmentTimeout(),
conf.getKeyInjectionDelay(),
conf.getScrollAcknowledgmentTimeout(),
conf.getWaitForIdleTimeout(),
conf.getWaitForSelectorTimeout());
FileLog.i(TAG_MAIN, log);
FileLog.i(TAG_MAIN, "TargetPackage: " + Config.sTargetPackage +
", Debug: " + Config.sDebug +
", MaxSteps: " + Config.sMaxSteps +
", MaxDepth: " + Config.sMaxDepth +
", MaxRuntime: " + Config.sMaxRuntime +
", MaxScreenshot: " + Config.sMaxScreenshot +
", MaxScreenLoop: " + Config.sMaxScreenLoop +
", ScreenSignatueLength: " + Config.sScreenSignatueLength +
", RandomText: " + Config.sRandomText +
", CaptureSteps: " + Config.sCaptureSteps +
", LaunchTimeout: " + Config.sLaunchTimeout +
", WaitIdleTimeout: " + Config.sWaitIdleTimeout);
}
示例3: ConfiguratorInfo
import android.support.test.uiautomator.Configurator; //导入方法依赖的package包/类
public ConfiguratorInfo() {
Configurator config = Configurator.getInstance();
this._actionAcknowledgmentTimeout = config.getActionAcknowledgmentTimeout();
this._keyInjectionDelay = config.getKeyInjectionDelay();
this._scrollAcknowledgmentTimeout = config.getScrollAcknowledgmentTimeout();
this._waitForIdleTimeout = config.getWaitForIdleTimeout();
this._waitForSelectorTimeout = config.getWaitForSelectorTimeout();
}
示例4: setConfigurator
import android.support.test.uiautomator.Configurator; //导入方法依赖的package包/类
public static void setConfigurator(ConfiguratorInfo info) {
Configurator config = Configurator.getInstance();
config.setActionAcknowledgmentTimeout(info.getActionAcknowledgmentTimeout());
config.setKeyInjectionDelay(info.getKeyInjectionDelay());
config.setScrollAcknowledgmentTimeout(info.getScrollAcknowledgmentTimeout());
config.setWaitForIdleTimeout(info.getWaitForIdleTimeout());
config.setWaitForSelectorTimeout(info.getWaitForSelectorTimeout());
}
示例5: setText
import android.support.test.uiautomator.Configurator; //导入方法依赖的package包/类
public void setText(String text) throws UiObjectNotFoundException {
Configurator config = Configurator.getInstance();
config.setKeyInjectionDelay(20);
element.setText(text);
config.setKeyInjectionDelay(0);
}