我正在使用带有机器人和黄瓜的spoon gradle,我可以截屏并查看报告,但日志完全是空的。我是不是漏掉了什么?
我的Build.gradle:
classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.3') {
exclude module: 'guava'
}
classpath 'com.squareup.spoon:spoon-runner:1.2.0'我的应用-build.gradle:
dependencies{
androidTestCompile 'com.squareup.spoon:spoon-client:1.2.0'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.5.1'
}
spoon {
debug = true
if (project.hasProperty('spoonFailNoConnectedDevice')) {
failIfNoDeviceConnected = true
}
if (project.hasProperty('cucumberOptions')) {
instrumentationArgs = ["cucumberOptions=" + "'${project.cucumberOptions}'"]
}
}我正在运行命令行,命令是:
gradle spoon -PspoonFailNoConnectedDevice -PcucumberOptions='--tags @smoke'我的工具运行器:
public class Instrumentation extends CucumberInstrumentation {
@Override
public void onStart() {
runOnMainSync(new Runnable() {
@Override
public void run() {
Application app = (Application) getTargetContext().getApplicationContext();
String simpleName = Instrumentation.class.getSimpleName();
// Unlock the device so that the tests can input keystrokes.
((KeyguardManager) app.getSystemService(KEYGUARD_SERVICE)) //
.newKeyguardLock(simpleName) //
.disableKeyguard();
// Wake up the screen.
((PowerManager) app.getSystemService(POWER_SERVICE)) //
.newWakeLock(FULL_WAKE_LOCK | ACQUIRE_CAUSES_WAKEUP | ON_AFTER_RELEASE, simpleName) //
.acquire();
}
});
super.onStart();
}
}只有日志是空的,那会是什么呢?有人有主意了吗?
谢谢!
发布于 2016-07-13 13:28:05
您好,我已经创建了一个样例项目here,它修复了空日志问题。基本上,您需要编写一个自定义Reporter来触发Spoon日志记录。
https://stackoverflow.com/questions/32970443
复制相似问题