[android] - add config file for excluding generated tests, refactor generation script output

This commit is contained in:
Tobrun
2017-11-02 09:51:07 -07:00
committed by Tobrun
parent 3efb740b42
commit cc67335499
4 changed files with 50 additions and 17 deletions

View File

@@ -49,8 +49,9 @@ public abstract class BaseActivityTest {
throw new RuntimeException("Could not start test for " + getActivityClass().getSimpleName() + ".\n"
+ "The ViewHierarchy doesn't contain a view with resource id = R.id.mapView or \n"
+ "the Activity doesn't contain an instance variable with a name equal to mapboxMap.\n"
+ "You can resolve this issue be implementing the requirements above or\n add "
+ getActivityClass().getSimpleName() + " to the excludeActivities array in `generate-test-code.js`.\n");
+ "You can resolve this issue by adding the requirements above or\n add "
+ getActivityClass().getSimpleName() + " to the platform/android/scripts/exclude-activity-gen.json to blacklist"
+ " the Activity from being generated.\n");
}
}
@@ -67,8 +68,7 @@ public abstract class BaseActivityTest {
protected abstract Class getActivityClass();
protected void checkViewIsDisplayed(int id) {
onView(withId(id))
.check(matches(isDisplayed()));
onView(withId(id)).check(matches(isDisplayed()));
}
protected void waitLoop() {

View File

@@ -13,10 +13,8 @@ public class OnMapReadyIdlingResource implements IdlingResource, OnMapReadyCallb
private MapboxMap mapboxMap;
private IdlingResource.ResourceCallback resourceCallback;
private Activity activity;
public OnMapReadyIdlingResource(Activity activity) {
this.activity = activity;
try {
Field field = activity.getClass().getDeclaredField("mapView");
field.setAccessible(true);
@@ -24,7 +22,6 @@ public class OnMapReadyIdlingResource implements IdlingResource, OnMapReadyCallb
} catch (Exception err) {
throw new RuntimeException(err);
}
}
@Override
@@ -53,4 +50,4 @@ public class OnMapReadyIdlingResource implements IdlingResource, OnMapReadyCallb
resourceCallback.onTransitionToIdle();
}
}
}
}