public boolean gotoPreferencPage(String position) { String window_title = Messages.getString("VisitAllPreferencePages.4"); // $NON-NLS-1$ if (waitForWindow("Could Not Accept Changes", 50)) { pressSpace(); pressEscape(); // return to main } Assert.assertTrue(waitForWindowClose(window_title)); Assert.assertTrue(waitForElexisMainWindow(Constants.ONE_SECOND)); openMenu(Messages.getString("VisitAllPreferencePages.7")); // $NON-NLS-1$ try { @SuppressWarnings("unchecked") ComponentIdentifier<Tree> tree = OM.Preferences_ItemChoice_tre; // $NON-NLS-1$ TreeComponent treeComp = org.eclipse.jubula.toolkit.concrete.ConcreteComponents.createTreeComponent(tree); clickComponent( tree); // This click is only necessary after visiting "Security Storage"! Took me 3h to // find it AUT_run.m_aut.execute( treeComp.selectNodeByIndexpath( SearchType.absolute, new Integer(0), position, new Integer(1), InteractionMode.primary, ValueSets.BinaryChoice.no), null); } catch (ActionException | ComponentNotFoundException e) { // Utils.dbg_msg("gotoPreferencPage e: " + position + " msg: " + e.getMessage()); // //$NON-NLS-1$ return false; } return true; }
public List<String> getAllPreferenceIndices() { Utils.dbg_msg("getAllPreferenceNames"); String position = "first_time"; // $NON-NLS-1$ //$NON-NLS-2$ List<String> indices = new ArrayList<>(); openMenu(Messages.getString("VisitAllPreferencePages.7")); // $NON-NLS-1$ waitForWindow(Messages.getString("VisitAllPreferencePages.4")); @SuppressWarnings({"unchecked"}) ComponentIdentifier<Tree> tree = OM.Preferences_ItemChoice_tre; // $NON-NLS-1$ int major = 0, minor = 0; Assert.assertNotNull("ShowView_ViewTree_grc may not be null", tree); TreeComponent treeComp = ConcreteComponents.createTreeComponent(tree); while (true) { major++; try { // clickComponent(tree); // This click is only necessary after visiting "Security Storage"! // Took me 3h to find it position = Integer.toString(major); AUT_run.m_aut.execute( treeComp.checkExistenceOfNodeByIndexpath( SearchType.absolute, new Integer(0), position, true), null); indices.add(position); } catch (CheckFailedException e) { Utils.dbg_msg( "getAllPreferenceNames finished at position " + position + " with " + indices.size() + " indices"); pressEscape(); // close window return indices; } minor = 1; while (true) { position = Integer.toString(major) + "/" + Integer.toString(minor); // $NON-NLS-1$ try { // clickComponent(tree); // This click is only necessary after visiting "Security // Storage"! Took me 3h to find it AUT_run.m_aut.execute( treeComp.checkExistenceOfNodeByIndexpath( SearchType.absolute, new Integer(0), position, true), null); indices.add(position); minor++; } catch (CheckFailedException e) { break; } } } }