Search in sources :

Example 1 with DefaultTree

use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-hibernate by jbosstools.

the class KnownConfigurationsView method selectConsole.

/**
 * Selects console
 * @param name given console name
 */
public void selectConsole(String name) {
    open();
    new DefaultTreeItem(new DefaultTree(this), name).select();
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)

Example 2 with DefaultTree

use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-hibernate by jbosstools.

the class KnownConfigurationsView method getConsoleConfigurations.

public List<TreeItem> getConsoleConfigurations() {
    Tree tree = null;
    try {
        tree = new DefaultTree(this);
    } catch (RedDeerException e) {
        return null;
    }
    new WaitUntil(new ConfigrationsAreLoaded(tree));
    return tree.getItems();
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) Tree(org.eclipse.reddeer.swt.api.Tree) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) ConfigrationsAreLoaded(org.jboss.tools.hibernate.reddeer.condition.ConfigrationsAreLoaded) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 3 with DefaultTree

use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.

the class CreateResourcesTest method createResource.

private void createResource(String pathToResource) {
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(testProject).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_RESOURCE).select();
    new DefaultShell(OpenShiftLabel.Shell.NEW_RESOURCE);
    assertTrue("Selected project has not been selected for new resource creation.", new LabeledCombo(OpenShiftLabel.TextLabels.PROJECT).getSelection().equals(testProject));
    new LabeledText(OpenShiftLabel.TextLabels.RESOURCE_LOCATION).setText(pathToResource);
    new FinishButton().click();
    new DefaultShell(OpenShiftLabel.Shell.CREATE_RESOURCE_SUMMARY);
    assertTrue("Resource is not listed in created resources summary", new DefaultTree().getAllItems().size() == 1);
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_RESOURCE));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) LabeledCombo(org.eclipse.reddeer.swt.impl.combo.LabeledCombo) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning)

Example 4 with DefaultTree

use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.

the class NodeJSAppDebugTest method getVariable.

/**
 * getVariable from Variables view.
 *
 * @param variable
 *            name
 * @return TreeItem
 */
protected TreeItem getVariable(String name) {
    WorkbenchView variables = new WorkbenchView("Variables");
    variables.activate();
    DefaultTree variablesTree = new DefaultTree();
    TreeItem var = null;
    try {
        new WaitUntil(new TreeContainsItem(variablesTree, new WithTextMatcher(name), false));
    } catch (WaitTimeoutExpiredException e) {
        // not found
        return null;
    }
    List<TreeItem> vars = variablesTree.getItems();
    for (TreeItem i : vars) {
        if (i.getText().equals(name)) {
            var = i;
        }
    }
    return var;
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) WorkbenchView(org.eclipse.reddeer.workbench.impl.view.WorkbenchView) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 5 with DefaultTree

use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.

the class NewApplicationWizardHandlingTest method testFilteringServerTemplates.

@Test
public void testFilteringServerTemplates() {
    DefaultText searchBar = new DefaultText(1);
    searchBar.setText("eap70-basic-s2i");
    assertTrue("There should be precisely one tree item in a tree.", new DefaultTree().getItems().size() == 1);
    String templateLabel = new DefaultTree().getItems().get(0).getText();
    assertTrue("There should be item representing basic EAP template in a tree but it is not there.", templateLabel.equals(OpenShiftLabel.Others.EAP_TEMPLATE) || templateLabel.equals(OpenShiftLabel.Others.EAP_TEMPLATE_OLD));
    searchBar.setText("");
    assertTrue("There should be more templates if search bar does not contain any search query", new DefaultTree().getItems().size() > 2);
}
Also used : DefaultText(org.eclipse.reddeer.swt.impl.text.DefaultText) DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) Test(org.junit.Test)

Aggregations

DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)22 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)9 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)9 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)8 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)7 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)7 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)7 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)6 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)5 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)5 Test (org.junit.Test)5 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)3 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)3 WithTextMatcher (org.eclipse.reddeer.core.matcher.WithTextMatcher)3 TreeHasChildren (org.eclipse.reddeer.swt.condition.TreeHasChildren)3 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)3 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)3 DefaultTabItem (org.eclipse.reddeer.swt.impl.tab.DefaultTabItem)3 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)2 Shell (org.eclipse.reddeer.swt.api.Shell)2