Search in sources :

Example 61 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.

the class EnvironmentVariableWizardPage method removeEnvironmentVariable.

/**
 * Removes environment.
 *
 * @param envVar environment variable to remove
 * @return true if variable was removed successfully, false otherwise
 */
public boolean removeEnvironmentVariable(EnvVar envVar) {
    DefaultTable table = new DefaultTable();
    table.select(envVar.getName());
    new PushButton(OpenShiftLabel.Button.REMOVE_BASIC).click();
    new DefaultShell(OpenShiftLabel.Shell.REMOVE_ENV_VAR);
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_ENV_VAR));
    return !(table.containsItem(envVar.getName(), 0) && table.containsItem(envVar.getValue(), 1));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 62 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project linuxtools by eclipse.

the class RunDockerImageLaunchConfiguration method editPort.

public void editPort(String oldContainerPort, String newContainerPort, String newHostAddress, String newHostPort) {
    selectTab(PORTS_TAB_LABEL);
    setPublishAllExposedPortsToRandomPorts(false);
    if (selectItemInTable(oldContainerPort)) {
        new PushButton("Edit...");
        new WaitUntil(new ShellIsAvailable("Exposing a Container Port"));
        new LabeledText("Container port:").setText(newContainerPort);
        new LabeledText("Host address:").setText(newHostAddress);
        new LabeledText("Host port:").setText(newHostPort);
        new OkButton().click();
    } else {
        throw new EclipseLayerException("There is no " + oldContainerPort + " in table on tab " + PORTS_TAB_LABEL);
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) EclipseLayerException(org.eclipse.reddeer.eclipse.exception.EclipseLayerException) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 63 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project linuxtools by eclipse.

the class RunDockerImageLaunchConfiguration method addPort.

public void addPort(String containerPort, String hostAddress, String hostPort) {
    selectTab(PORTS_TAB_LABEL);
    setPublishAllExposedPortsToRandomPorts(false);
    new PushButton("Add...").click();
    new WaitUntil(new ShellIsAvailable("Exposing a Container Port"));
    new LabeledText("Container port:").setText(containerPort);
    new LabeledText("Host address:").setText(hostAddress);
    new LabeledText("Host port:").setText(hostPort);
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 64 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project linuxtools by eclipse.

the class RunDockerImageLaunchConfiguration method addLink.

// links tab
public void addLink(String containerName, String alias) {
    selectTab(LINKS_TAB_LABEL);
    new PushButton("Add...").click();
    new WaitWhile(new ShellIsAvailable("Container Linking"));
    new LabeledText("Container:").setText(containerName);
    new LabeledText("Value:").setText(alias);
    new OkButton().click();
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton)

Example 65 with ShellIsAvailable

use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project linuxtools by eclipse.

the class RunDockerImageLaunchConfiguration method deleteRunConfiguration.

public void deleteRunConfiguration(String configuratioName) {
    selectConfiguration(configuratioName);
    new DefaultToolItem(DELETE_LAUNCH_CONFIGURATION_LABEL).click();
    Shell deleteShell = new DefaultShell("Confirm Launch Configuration Deletion");
    WidgetIsFound deleteButton = new WidgetIsFound(org.eclipse.swt.widgets.Button.class, deleteShell.getSWTWidget(), new WithMnemonicTextMatcher("Delete"));
    Button button;
    if (deleteButton.test()) {
        // photon changed button text
        button = new PushButton(deleteShell, "Delete");
    } else {
        button = new YesButton(deleteShell);
    }
    button.click();
    new WaitWhile(new ShellIsAvailable(deleteShell));
    new WaitUntil(new ShellIsAvailable("Run Configurations"));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) DefaultToolItem(org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) Shell(org.eclipse.reddeer.swt.api.Shell) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) WithMnemonicTextMatcher(org.eclipse.reddeer.core.matcher.WithMnemonicTextMatcher) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) RadioButton(org.eclipse.reddeer.swt.impl.button.RadioButton) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Button(org.eclipse.reddeer.swt.api.Button) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)128 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)97 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)84 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)73 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)52 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)47 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)44 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)33 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)32 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)25 Test (org.junit.Test)21 CancelButton (org.eclipse.reddeer.swt.impl.button.CancelButton)19 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)18 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)18 Shell (org.eclipse.reddeer.swt.api.Shell)17 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)14 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)13 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)13 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)10