I want to keep the app in the foreground while executing feature files using CucumberAndroidJUnitRunner , Right now after executing below command from application, app is going background , but i want app to be in foreground and show result of each test scenario .
Process process = Runtime.getRuntime().exec(command);
command is below ..
/system/bin/am instrument -w -e debug false -e class com.sample.auto.androidBDD.MyAppCucumberAndroidJUnitRunner -e features /features/Release/ExecuteCommand_method.feature com.sample.auto.androidBDD.test/com.sample.auto.androidBDD.MyAppCucumberAndroidJUnitRunner
I can see feature file execution happening properly from logs and i can see results generated in html format once after execution. I want to see results in the android app screen while executing the feature file .
sample below ..
Asset folder we have .feature file
Step Implementation class is a feature file implementation
TestRunner class update in gradle file testInstrumentationRunner "com.sample.auto.androidBDD.TestRunner (MyAppCucumberAndroidJUnitRunner)"
@CucumberOptions( //features = {"features/bodyaccess/login.feature"}, glue = "com.sample.auto.androidBDD", plugin = { "pretty" "json:/data/user/10/com.sample.auto.androidBDD/cache/cucumber-reports/report.json"}, monochrome = true ) public class MyAppCucumberAndroidJUnitRunner extends CucumberAndroidJUnitRunner { @Override public void onCreate(Bundle arguments) { super.onCreate(arguments); }
}From Terminal :: adb shell am instrument -w -e debug false -e class com.sample.auto.androidBDD.MyAppCucumberAndroidJUnitRunner -e features /features/Release/ExecuteCommand_method.feature com.sample.auto.androidBDD.test/com.sample.auto.androidBDD.MyAppCucumberAndroidJUnitRunner
From code :: Process process = Runtime.getRuntime().exec(command);
command is below ..
/system/bin/am instrument -w -e debug false -e class com.sample.auto.androidBDD.MyAppCucumberAndroidJUnitRunner -e features /features/Release/ExecuteCommand_method.feature com.sample.auto.androidBDD.test/com.sample.auto.androidBDD.MyAppCucumberAndroidJUnitRunner
- Dependencies :: androidTestImplementation 'io.cucumber:cucumber-android:7.14.0' androidTestImplementation 'io.cucumber:cucumber-junit:7.14.1'