Android 当使用勺子梯度与Robotium时,原木是空的
我正在使用spoon gradle和robotium和cucumber,我可以截图并查看报告,但日志完全是空的。我错过什么了吗 我的身材。格雷德尔:Android 当使用勺子梯度与Robotium时,原木是空的,android,cucumber-jvm,spoon,spoon-gradle-plugin,Android,Cucumber Jvm,Spoon,Spoon Gradle Plugin,我正在使用spoon gradle和robotium和cucumber,我可以截图并查看报告,但日志完全是空的。我错过什么了吗 我的身材。格雷德尔: classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.3') { exclude module: 'guava' } classpath 'com.squareup.spoon:spoon-runner:1.2.0' dependencies{ androidTestCompile
classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.3') {
exclude module: 'guava'
}
classpath 'com.squareup.spoon:spoon-runner:1.2.0'
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}'"]
}
}
我的app-build.gradle:
classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.3') {
exclude module: 'guava'
}
classpath 'com.squareup.spoon:spoon-runner:1.2.0'
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();
}
}
只是日志是空的,会是什么?有人有主意吗
谢谢大家! 您好,我创建了一个示例项目,修复了空日志问题。基本上,您需要编写一个自定义报告程序来触发勺子日志记录。您可以共享它吗?@Caipivara,您可以查看这里