src/androidTest/java/de/blau/android/layer/LayerDialogTest.java
/**
     * Show dialog, zoom to extent, hide layer, try to select object, show layer
     */
Show dialog, zoom to extent, hide layer, try to select object, show layer
Show dialog zoom to extent hide layer try to select object show layer
@Test
    public void dataLayer() {
        TestUtils.zoomToLevel(device, main, 21);
        String dataLayerName = map.getDataLayer().getName();
        UiObject2 extentButton = TestUtils.getLayerButton(device, dataLayerName, EXTENT_BUTTON);
        extentButton.clickAndWait(Until.newWindow(), 2000);
        BoundingBox box = map.getViewBox();
        System.out.println("Viewbox extent " + box);
        System.out.println("Data layer extent " + map.getDataLayer().getExtent());
        assertEquals(8.3911514, box.getRight() / 1E7D, 0.003);
        assertEquals(8.3863771, box.getLeft() / 1E7D, 0.003);
        UiObject2 visibleButton = TestUtils.getLayerButton(device, dataLayerName, VISIBLE_BUTTON);
        visibleButton.click();
        TestUtils.clickText(device, true, main.getString(R.string.done), false, false);
        assertFalse(map.getDataLayer().isVisible());
        TestUtils.unlock(device);
        TestUtils.clickAtCoordinates(device, map, 8.38782, 47.390339, false);
        assertFalse(TestUtils.clickText(device, false, "Toilets", false, false));  nothing should happen
        visibleButton = TestUtils.getLayerButton(device, dataLayerName, VISIBLE_BUTTON);
        visibleButton.click();
        TestUtils.clickText(device, true, main.getString(R.string.done), false, false);
        assertTrue(map.getDataLayer().isVisible());
        UiObject2 infoButton = TestUtils.getLayerButton(device, dataLayerName, MENU_BUTTON);
        infoButton.clickAndWait(Until.newWindow(), 1000);
        assertTrue(TestUtils.clickText(device, false, main.getString(R.string.menu_information), true, false));
        assertTrue(TestUtils.findText(device, false, main.getString(R.string.data_in_memory), 5000));
        assertTrue(TestUtils.clickText(device, false, main.getString(R.string.done), true, false));
    }
@ Test public void dataLayer ( ) { TestUtils . zoomToLevel ( device , main , 21 ) ; String dataLayerName = map . getDataLayer ( ) . getName ( ) ; UiObject2 extentButton = TestUtils . getLayerButton ( device , dataLayerName , EXTENT_BUTTON ) ; extentButton . clickAndWait ( Until . newWindow ( ) , 2000 ) ; BoundingBox box = map . getViewBox ( ) ; System . out . println ( "Viewbox extent " + box ) ; System . out . println ( "Data layer extent " + map . getDataLayer ( ) . getExtent ( ) ) ; assertEquals ( 8.3911514 , box . getRight ( ) / 1E7D , 0.003 ) ; assertEquals ( 8.3863771 , box . getLeft ( ) / 1E7D , 0.003 ) ; UiObject2 visibleButton = TestUtils . getLayerButton ( device , dataLayerName , VISIBLE_BUTTON ) ; visibleButton . click ( ) ; TestUtils . clickText ( device , true , main . getString ( R . string . done ) , false , false ) ; assertFalse ( map . getDataLayer ( ) . isVisible ( ) ) ; TestUtils . unlock ( device ) ; TestUtils . clickAtCoordinates ( device , map , 8.38782 , 47.390339 , false ) ; assertFalse ( TestUtils . clickText ( device , false , "Toilets" , false , false ) ) ; visibleButton = TestUtils . getLayerButton ( device , dataLayerName , VISIBLE_BUTTON ) ; visibleButton . click ( ) ; TestUtils . clickText ( device , true , main . getString ( R . string . done ) , false , false ) ; assertTrue ( map . getDataLayer ( ) . isVisible ( ) ) ; UiObject2 infoButton = TestUtils . getLayerButton ( device , dataLayerName , MENU_BUTTON ) ; infoButton . clickAndWait ( Until . newWindow ( ) , 1000 ) ; assertTrue ( TestUtils . clickText ( device , false , main . getString ( R . string . menu_information ) , true , false ) ) ; assertTrue ( TestUtils . findText ( device , false , main . getString ( R . string . data_in_memory ) , 5000 ) ) ; assertTrue ( TestUtils . clickText ( device , false , main . getString ( R . string . done ) , true , false ) ) ; }
Show dialog, zoom to extent, hide layer, try to select object, show layer
Show dialog zoom to extent hide layer try to select object show layer
// <bounds minlat='47.3881338' minlon='8.3863771' maxlat='47.3908067' maxlon='8.3911514' origin='CGImap 0.6.0 // (6068 thorn-01.openstreetmap.org)' /> // // nothing should happen