Hi guys,
import android.app.Application;
import android.app.KeyguardManager;
import android.os.PowerManager;
import cucumber.api.CucumberOptions;
import cucumber.api.android.CucumberInstrumentation;
import static android.content.Context.KEYGUARD_SERVICE;
import static android.content.Context.POWER_SERVICE;
import static android.os.PowerManager.ACQUIRE_CAUSES_WAKEUP;
import static android.os.PowerManager.FULL_WAKE_LOCK;
import static android.os.PowerManager.ON_AFTER_RELEASE;
//@CucumberOptions(features = {"features"}, tags = {"@debug"})
@CucumberOptions(features = {"features"}, plugin = {"pretty"}, tags ={"~@pending", "~@manual", "~@reboot"})
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();
}
}
Hi guys,
AndroidStudio just released a new version that supports cucumber plugin. Now, I am trying to config, but it seems that I am missing something. Someone can help me please ?