-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from lifedemons/feature/2/android_orchestrator…
…_integration Introduced CucumberJUnitRunner - a bridge between Cucumber Features and Android Test Orchestrator
- Loading branch information
Showing
21 changed files
with
505 additions
and
1,521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
cucumber-android/src/main/java/cucumber/api/android/CucumberAndroidJUnitRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package cucumber.api.android; | ||
|
||
import android.os.Bundle; | ||
import androidx.test.runner.AndroidJUnitRunner; | ||
import cucumber.runtime.android.CucumberJUnitRunnerBuilder; | ||
|
||
/** | ||
* {@link AndroidJUnitRunner} for cucumber tests. It supports running tests from Android Tests Orchestrator | ||
*/ | ||
public class CucumberAndroidJUnitRunner extends AndroidJUnitRunner { | ||
|
||
public static final String CUCUMBER_ANDROID_TEST_CLASS = "cucumberAndroidTestClass"; | ||
private static final String ARGUMENT_ORCHESTRATOR_RUNNER_BUILDER = "runnerBuilder"; | ||
private static final String ARGUMENT_ORCHESTRATOR_CLASS = "class"; | ||
private Bundle arguments; | ||
|
||
@Override | ||
public void onCreate(final Bundle bundle) { | ||
bundle.putString(ARGUMENT_ORCHESTRATOR_RUNNER_BUILDER, CucumberJUnitRunnerBuilder.class.getName()); | ||
|
||
String testClass = bundle.getString(ARGUMENT_ORCHESTRATOR_CLASS); | ||
if (testClass != null && !testClass.isEmpty()){ | ||
//if this runner is executed for single class (e.g. from orchestrator or spoon), we set | ||
//special option to let CucumberJUnitRunner handle this | ||
bundle.putString(CUCUMBER_ANDROID_TEST_CLASS, testClass); | ||
} | ||
//there is no need to scan all classes - we can fake this execution to be for single class | ||
//because we delegate test execution to CucumberJUnitRunner | ||
bundle.putString(ARGUMENT_ORCHESTRATOR_CLASS, CucumberJUnitRunnerBuilder.class.getName()); | ||
|
||
arguments = bundle; | ||
|
||
super.onCreate(bundle); | ||
} | ||
|
||
public Bundle getArguments() { | ||
return arguments; | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
cucumber-android/src/main/java/cucumber/api/android/CucumberInstrumentation.java
This file was deleted.
Oops, something went wrong.
94 changes: 0 additions & 94 deletions
94
cucumber-android/src/main/java/cucumber/api/android/CucumberInstrumentationCore.java
This file was deleted.
Oops, something went wrong.
76 changes: 0 additions & 76 deletions
76
cucumber-android/src/main/java/cucumber/runtime/android/AndroidObjectFactory.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.