当前位置: 首页>>代码示例>>Java>>正文


Java Configurator.getInstance方法代码示例

本文整理汇总了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();
}
 
开发者ID:Eaway,项目名称:AppCrawler,代码行数:41,代码来源:TestMain.java

示例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);
}
 
开发者ID:Eaway,项目名称:AppCrawler,代码行数:30,代码来源:TestMain.java

示例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();
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:9,代码来源:ConfiguratorInfo.java

示例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());
}
 
开发者ID:xiaocong,项目名称:android-uiautomator-server,代码行数:9,代码来源:ConfiguratorInfo.java

示例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);
}
 
开发者ID:macacajs,项目名称:UIAutomatorWD,代码行数:7,代码来源:Element.java


注:本文中的android.support.test.uiautomator.Configurator.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。