src/androidTest/java/de/blau/android/filter/PresetFilterTest.java
/**
     * Set preset filter to place or Worship group and create a church
     */
Set preset filter to place or Worship group and create a church
Set preset filter to place or Worship group and create a church
@Test
    public void presetFilterCreateGroup() {
        TestUtils.zoomToLevel(device, main, 21);
        TestUtils.unlock(device);
        TestUtils.clickOverflowButton(device);
        TestUtils.clickText(device, false, main.getString(R.string.menu_enable_presetfilter), true, false);
        TestUtils.clickResource(device, false, device.getCurrentPackageName() + ":id/tagFilterButton", true);
        Activity presetFilterActivity = instrumentation.waitForMonitorWithTimeout(monitor, 30000);
        instrumentation.removeMonitor(monitor);
        assertTrue(presetFilterActivity instanceof PresetFilterActivity);
        assertTrue(TestUtils.clickText(device, false, "Facilities", true));
        assertTrue(TestUtils.longClickText(device, "Place of Worship"));
        TestUtils.sleep(2000);
        TestUtils.clickSimpleButton(device);
        assertTrue(TestUtils.clickText(device, false, context.getString(R.string.menu_add_node_tags), true, false));
        assertTrue(TestUtils.findText(device, false, context.getString(R.string.simple_add_node)));
        TestUtils.clickAtCoordinates(device, map, 8.3893454, 47.3901898, true);
        monitor = instrumentation.addMonitor(PropertyEditor.class.getName(), null, false);
        Activity propertyEditor = instrumentation.waitForMonitorWithTimeout(monitor, 30000);
        assertTrue(propertyEditor instanceof PropertyEditor);
        assertTrue(TestUtils.findText(device, false, main.getString(R.string.tag_menu_preset), 5000));
        assertTrue(TestUtils.findText(device, false, "Mosque", 5000));
        assertTrue(TestUtils.clickText(device, false, "Church", false, false));
        assertTrue(TestUtils.findText(device, false, main.getString(R.string.menu_tags), 5000));
        assertTrue(TestUtils.findText(device, false, "Church", 5000));
        TestUtils.clickHome(device, true);
        assertTrue(TestUtils.findText(device, false, context.getString(R.string.actionmode_nodeselect)));
        device.waitForIdle();
        Node n = App.getLogic().getSelectedNode();
        assertNotNull(n);
        assertTrue(n.hasTag(Tags.KEY_AMENITY, "place_of_worship"));
        TestUtils.clickUp(device);
        TestUtils.clickOverflowButton(device);
        TestUtils.clickText(device, false, main.getString(R.string.menu_enable_presetfilter), true, false);
    }
@ Test public void presetFilterCreateGroup ( ) { TestUtils . zoomToLevel ( device , main , 21 ) ; TestUtils . unlock ( device ) ; TestUtils . clickOverflowButton ( device ) ; TestUtils . clickText ( device , false , main . getString ( R . string . menu_enable_presetfilter ) , true , false ) ; TestUtils . clickResource ( device , false , device . getCurrentPackageName ( ) + ":id/tagFilterButton" , true ) ; Activity presetFilterActivity = instrumentation . waitForMonitorWithTimeout ( monitor , 30000 ) ; instrumentation . removeMonitor ( monitor ) ; assertTrue ( presetFilterActivity instanceof PresetFilterActivity ) ; assertTrue ( TestUtils . clickText ( device , false , "Facilities" , true ) ) ; assertTrue ( TestUtils . longClickText ( device , "Place of Worship" ) ) ; TestUtils . sleep ( 2000 ) ; TestUtils . clickSimpleButton ( device ) ; assertTrue ( TestUtils . clickText ( device , false , context . getString ( R . string . menu_add_node_tags ) , true , false ) ) ; assertTrue ( TestUtils . findText ( device , false , context . getString ( R . string . simple_add_node ) ) ) ; TestUtils . clickAtCoordinates ( device , map , 8.3893454 , 47.3901898 , true ) ; monitor = instrumentation . addMonitor ( PropertyEditor . class . getName ( ) , null , false ) ; Activity propertyEditor = instrumentation . waitForMonitorWithTimeout ( monitor , 30000 ) ; assertTrue ( propertyEditor instanceof PropertyEditor ) ; assertTrue ( TestUtils . findText ( device , false , main . getString ( R . string . tag_menu_preset ) , 5000 ) ) ; assertTrue ( TestUtils . findText ( device , false , "Mosque" , 5000 ) ) ; assertTrue ( TestUtils . clickText ( device , false , "Church" , false , false ) ) ; assertTrue ( TestUtils . findText ( device , false , main . getString ( R . string . menu_tags ) , 5000 ) ) ; assertTrue ( TestUtils . findText ( device , false , "Church" , 5000 ) ) ; TestUtils . clickHome ( device , true ) ; assertTrue ( TestUtils . findText ( device , false , context . getString ( R . string . actionmode_nodeselect ) ) ) ; device . waitForIdle ( ) ; Node n = App . getLogic ( ) . getSelectedNode ( ) ; assertNotNull ( n ) ; assertTrue ( n . hasTag ( Tags . KEY_AMENITY , "place_of_worship" ) ) ; TestUtils . clickUp ( device ) ; TestUtils . clickOverflowButton ( device ) ; TestUtils . clickText ( device , false , main . getString ( R . string . menu_enable_presetfilter ) , true , false ) ; }
Set preset filter to place or Worship group and create a church
Set preset filter to place or Worship group and create a church