src/androidTest/java/de/blau/android/propertyeditor/PropertyEditorTest.java
/**
     * Navigate to a specific preset item
     */
Navigate to a specific preset item
Navigate to a specific preset item
@Test
    public void presets() {
        final CountDownLatch signal = new CountDownLatch(1);
        mockServer.enqueue("capabilities1");
        mockServer.enqueue("download1");
        Logic logic = App.getLogic();
        logic.downloadBox(main, new BoundingBox(8.3879800D, 47.3892400D, 8.3844600D, 47.3911300D), false, new SignalHandler(signal));
        try {
            signal.await(30, TimeUnit.SECONDS);
        } catch (InterruptedException e) {
            fail(e.getMessage());
        }
        Way w = (Way) App.getDelegator().getOsmElement(Way.NAME, 27009604L);
        assertNotNull(w);
        main.performTagEdit(w, null, false, false);
        Activity propertyEditor = instrumentation.waitForMonitorWithTimeout(monitor, 30000);
        assertTrue(propertyEditor instanceof PropertyEditor);
        if (!((PropertyEditor) propertyEditor).paneLayout()) {
            assertTrue(TestUtils.clickText(device, true, main.getString(R.string.tag_menu_preset), false, false));
        }
        boolean found = TestUtils.clickText(device, true, getTranslatedPresetGroupName(main, "Highways"), true, false);
        assertTrue(found);
        found = TestUtils.clickText(device, true, getTranslatedPresetGroupName(main, "Streets"), true, false);
        assertTrue(found);
        found = TestUtils.clickText(device, true, getTranslatedPresetItemName(main, "Motorway"), true, false);
        assertTrue(found);
    }
@ Test public void presets ( ) { final CountDownLatch signal = new CountDownLatch ( 1 ) ; mockServer . enqueue ( "capabilities1" ) ; mockServer . enqueue ( "download1" ) ; Logic logic = App . getLogic ( ) ; logic . downloadBox ( main , new BoundingBox ( 8.3879800D , 47.3892400D , 8.3844600D , 47.3911300D ) , false , new SignalHandler ( signal ) ) ; try { signal . await ( 30 , TimeUnit . SECONDS ) ; } catch ( InterruptedException e ) { fail ( e . getMessage ( ) ) ; } Way w = ( Way ) App . getDelegator ( ) . getOsmElement ( Way . NAME , 27009604L ) ; assertNotNull ( w ) ; main . performTagEdit ( w , null , false , false ) ; Activity propertyEditor = instrumentation . waitForMonitorWithTimeout ( monitor , 30000 ) ; assertTrue ( propertyEditor instanceof PropertyEditor ) ; if ( ! ( ( PropertyEditor ) propertyEditor ) . paneLayout ( ) ) { assertTrue ( TestUtils . clickText ( device , true , main . getString ( R . string . tag_menu_preset ) , false , false ) ) ; } boolean found = TestUtils . clickText ( device , true , getTranslatedPresetGroupName ( main , "Highways" ) , true , false ) ; assertTrue ( found ) ; found = TestUtils . clickText ( device , true , getTranslatedPresetGroupName ( main , "Streets" ) , true , false ) ; assertTrue ( found ) ; found = TestUtils . clickText ( device , true , getTranslatedPresetItemName ( main , "Motorway" ) , true , false ) ; assertTrue ( found ) ; }
Navigate to a specific preset item
Navigate to a specific preset item