Search in sources :

Example 16 with DefaultTreeItem

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

the class CreateServerAdapterTest method setAdapterDetailsAndCreateAdapterAndVerifyExistence.

private void setAdapterDetailsAndCreateAdapterAndVerifyExistence() {
    new LabeledText("Eclipse Project: ").setText(PROJECT_NAME);
    new DefaultTreeItem(projectReq.getProjectName()).getItems().get(0).select();
    next();
    finishNewServerAdapterWizardAndVerifyExistence();
}
Also used : LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)

Example 17 with DefaultTreeItem

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

the class CreateServerAdapterTest method testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView.

@Test
public void testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView() {
    OpenShiftExplorerView explorer = new OpenShiftExplorerView();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).refresh();
    explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getServicesWithName("eap-app").get(0).select();
    new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
    new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
    assertTrue("Service should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(projectReq.getProjectName(), "eap-app deploymentConfig=eap-app").isSelected());
    assertTrue("Eclipse project should be preselected automatically for new server adapter", new LabeledText("Eclipse Project: ").getText().equals(PROJECT_NAME));
    new FinishButton().click();
    new WaitWhile(new ShellIsAvailable(""));
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
    assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, "eap-app", "Service").test());
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ServerAdapterExists(org.jboss.tools.openshift.reddeer.condition.ServerAdapterExists) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) OpenShiftExplorerView(org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 18 with DefaultTreeItem

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

the class DebuggingEAPAppTest method setNewVariableValue.

// TODO this should be replaced once
// https://github.com/jboss-reddeer/reddeer/issues/1668 is fixed.
private void setNewVariableValue(String newValue, final String... variablePath) {
    new WaitWhile(new JobIsRunning());
    LaunchView debugView = new LaunchView();
    debugView.open();
    ensureCorrectFrameIsSelected(debugView);
    VariablesView variablesView = new VariablesView();
    variablesView.open();
    new WaitUntil(new AbstractWaitCondition() {

        @Override
        public boolean test() {
            try {
                TreeItem variable = new DefaultTreeItem(variablePath);
                variable.select();
                return variable.isSelected();
            } catch (Exception e) {
                return false;
            }
        }

        @Override
        public String description() {
            return "Variable is not selected";
        }
    }, TimePeriod.LONG);
    try {
        new ContextMenuItem("Change Value...").select();
    } catch (CoreLayerException e) {
        throw e;
    }
    new DefaultShell("Change Object Value");
    new DefaultStyledText().setText(newValue);
    new OkButton().click();
    new WaitWhile(new JobIsRunning());
}
Also used : ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) TreeItem(org.eclipse.reddeer.swt.api.TreeItem) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) CaptureScreenshotException(org.eclipse.reddeer.junit.screenshot.CaptureScreenshotException) IOException(java.io.IOException) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultStyledText(org.eclipse.reddeer.swt.impl.styledtext.DefaultStyledText) LaunchView(org.eclipse.reddeer.eclipse.debug.ui.views.launch.LaunchView) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractWaitCondition(org.eclipse.reddeer.common.condition.AbstractWaitCondition) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException) VariablesView(org.eclipse.reddeer.eclipse.debug.ui.views.variables.VariablesView)

Example 19 with DefaultTreeItem

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

the class TemplatesCreator method selectServerTemplate.

private void selectServerTemplate(String templateName) {
    new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
    new WaitUntil(new TreeIsAvailable());
    new DefaultTree().selectItems(new DefaultTreeItem(templateName));
}
Also used : DefaultTree(org.eclipse.reddeer.swt.impl.tree.DefaultTree) TreeIsAvailable(org.jboss.tools.openshift.reddeer.condition.TreeIsAvailable) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem) DefaultTabItem(org.eclipse.reddeer.swt.impl.tab.DefaultTabItem) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 20 with DefaultTreeItem

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

the class BuilderImageApplicationWizardHandlingTest method selectBuilderImageAndAssertButtonsAvailability.

private void selectBuilderImageAndAssertButtonsAvailability() {
    new DefaultTreeItem(BUILDER_IMAGE).select();
    assertTrue("Next button should be enabled if EAP builder image is selected.", new NextButton().isEnabled());
    assertFalse("Finish button should be disabled on first wizard page for builder images.", new FinishButton().isEnabled());
}
Also used : NextButton(org.eclipse.reddeer.swt.impl.button.NextButton) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) DefaultTreeItem(org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)

Aggregations

DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)28 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)16 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)15 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)12 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)11 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)9 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)8 DefaultTree (org.eclipse.reddeer.swt.impl.tree.DefaultTree)8 NextButton (org.eclipse.reddeer.swt.impl.button.NextButton)7 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)6 Test (org.junit.Test)6 Shell (org.eclipse.reddeer.swt.api.Shell)5 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)5 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)5 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)5 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)5 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)5 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)4 DataSourceExplorerView (org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dse.views.DataSourceExplorerView)3 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)3