[android] #4845 - disable robotium
This commit is contained in:
@@ -6,37 +6,41 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMapUtils;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.PolygonActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.annotation.PolylineActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.activity.infowindow.InfoWindowActivity;
|
||||
import com.robotium.solo.Solo;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public abstract class BaseMainActivityTest extends ActivityInstrumentationTestCase2<PolylineActivity> {
|
||||
|
||||
protected Solo solo;
|
||||
protected MapView mapView;
|
||||
protected MapboxMap mapboxMap;
|
||||
|
||||
public BaseMainActivityTest() {
|
||||
super(PolylineActivity.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
solo = new Solo(getInstrumentation(), getActivity());
|
||||
mapView = (MapView) solo.getView(R.id.mapView);
|
||||
mapboxMap = MapboxMapUtils.getMapboxMap(mapView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
solo.finishOpenedActivities();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSanity() throws Exception {
|
||||
assertNotNull("Should be non null", solo);
|
||||
assertNotNull("Should be non null", mapView);
|
||||
assertNotNull("Should be non null", mapboxMap);
|
||||
}
|
||||
public abstract class BaseMainActivityTest{
|
||||
//
|
||||
//} extends ActivityInstrumentationTestCase2<InfoWindowActivity> {
|
||||
//
|
||||
// protected Solo solo;
|
||||
// protected MapView mapView;
|
||||
// protected MapboxMap mapboxMap;
|
||||
//
|
||||
// public BaseMainActivityTest() {
|
||||
// super(InfoWindowActivity.class);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setUp() throws Exception {
|
||||
// solo = new Solo(getInstrumentation(), getActivity());
|
||||
// mapView = (MapView) solo.getView(R.id.mapView);
|
||||
// mapboxMap = MapboxMapUtils.getMapboxMap(mapView);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void tearDown() throws Exception {
|
||||
// solo.finishOpenedActivities();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testSanity() throws Exception {
|
||||
// assertNotNull("Should be non null", solo);
|
||||
// assertNotNull("Should be non null", mapView);
|
||||
// assertNotNull("Should be non null", mapboxMap);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -8,39 +8,41 @@ import com.mapbox.mapboxsdk.testapp.robotium.utils.ViewAssertion;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class CompassViewTest extends BaseMainActivityTest {
|
||||
|
||||
private CompassView compassView;
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
compassView = (CompassView) solo.getView(R.id.compassView);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompass() {
|
||||
setCameraDirection(0);
|
||||
solo.sleep(200);
|
||||
ViewAssertion.isInvisible(compassView);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompassClick() throws Exception {
|
||||
setCameraDirection(20);
|
||||
solo.sleep(200);
|
||||
ViewAssertion.isVisible(compassView);
|
||||
solo.clickOnView(compassView);
|
||||
solo.sleep(200);
|
||||
ViewAssertion.isVisible(compassView);
|
||||
}
|
||||
|
||||
private void setCameraDirection(float bearing) {
|
||||
mapboxMap.setCameraPosition(new CameraPosition.Builder()
|
||||
.target(new LatLng(0, 0))
|
||||
.tilt(0)
|
||||
.zoom(15)
|
||||
.bearing(bearing)
|
||||
.build());
|
||||
}
|
||||
public class CompassViewTest {
|
||||
// extends
|
||||
//} BaseMainActivityTest {
|
||||
//
|
||||
// private CompassView compassView;
|
||||
//
|
||||
// @Override
|
||||
// public void setUp() throws Exception {
|
||||
// super.setUp();
|
||||
// compassView = (CompassView) solo.getView(R.id.compassView);
|
||||
// }
|
||||
//
|
||||
//// @Test
|
||||
//// public void testCompass() {
|
||||
//// setCameraDirection(0);
|
||||
//// solo.sleep(200);
|
||||
//// ViewAssertion.isInvisible(compassView);
|
||||
//// }
|
||||
//
|
||||
// @Test
|
||||
// public void testCompassClick() throws Exception {
|
||||
// setCameraDirection(20);
|
||||
// solo.sleep(200);
|
||||
// ViewAssertion.isVisible(compassView);
|
||||
// solo.clickOnView(compassView);
|
||||
// solo.sleep(200);
|
||||
// ViewAssertion.isVisible(compassView);
|
||||
// }
|
||||
//
|
||||
// private void setCameraDirection(float bearing) {
|
||||
// mapboxMap.setCameraPosition(new CameraPosition.Builder()
|
||||
// .target(new LatLng(0, 0))
|
||||
// .tilt(0)
|
||||
// .zoom(15)
|
||||
// .bearing(bearing)
|
||||
// .build());
|
||||
// }
|
||||
}
|
||||
@@ -6,22 +6,24 @@ import com.mapbox.mapboxsdk.maps.MapboxMapUtils;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class SimpleRotateTest extends BaseMainActivityTest {
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRotate() {
|
||||
mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(47.376271, 8.539116), 15));
|
||||
double rotation = 0;
|
||||
for (int i = 0; i < 180; i++) {
|
||||
rotation += 1;
|
||||
MapboxMapUtils.setDirection(mapView, rotation);
|
||||
solo.sleep(100);
|
||||
}
|
||||
}
|
||||
public class SimpleRotateTest {
|
||||
// extends
|
||||
//} BaseMainActivityTest {
|
||||
//
|
||||
// @Override
|
||||
// public void setUp() throws Exception {
|
||||
// super.setUp();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testRotate() {
|
||||
// mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(47.376271, 8.539116), 15));
|
||||
// double rotation = 0;
|
||||
// for (int i = 0; i < 180; i++) {
|
||||
// rotation += 1;
|
||||
// MapboxMapUtils.setDirection(mapView, rotation);
|
||||
// solo.sleep(100);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -6,21 +6,23 @@ import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class SimpleZoomTest extends BaseMainActivityTest {
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testZoomIn() {
|
||||
float currentZoomlevel = MapboxConstants.MINIMUM_ZOOM;
|
||||
while (currentZoomlevel < MapboxConstants.MAXIMUM_ZOOM - 5) {
|
||||
mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(47.376271, 8.539116),currentZoomlevel));
|
||||
currentZoomlevel++;
|
||||
solo.sleep(1400);
|
||||
}
|
||||
}
|
||||
public class SimpleZoomTest {
|
||||
// extends
|
||||
//} BaseMainActivityTest {
|
||||
//
|
||||
// @Override
|
||||
// public void setUp() throws Exception {
|
||||
// super.setUp();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testZoomIn() {
|
||||
// float currentZoomlevel = MapboxConstants.MINIMUM_ZOOM;
|
||||
// while (currentZoomlevel < MapboxConstants.MAXIMUM_ZOOM - 5) {
|
||||
// mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(47.376271, 8.539116),currentZoomlevel));
|
||||
// currentZoomlevel++;
|
||||
// solo.sleep(1400);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user