Search in sources :

Example 11 with YesButton

use of org.eclipse.reddeer.swt.impl.button.YesButton in project jbosstools-openshift by jbosstools.

the class EnvironmentVariableWizardPage method resetAllVariables.

/**
 * Resets all edited environment variables and check whether default variables passed as argument are
 * displayed in the table.
 *
 * @param envVars environment variables to verify that were changed to default state
 * @return true if variables were reset successfully, false otherwise
 */
public boolean resetAllVariables(EnvVar... envVars) {
    DefaultTable table = new DefaultTable();
    new PushButton(OpenShiftLabel.Button.RESET_ALL).click();
    new DefaultShell(OpenShiftLabel.Shell.RESET_ENV_VAR);
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESET_ENV_VAR));
    // If any of environment variables passed as argument were not reset, return false
    if (envVars != null && envVars.length > 0) {
        for (EnvVar envVar : envVars) {
            if (!(table.containsItem(envVar.getName(), 0) && (table.containsItem(envVar.getValue(), 1)))) {
                return false;
            }
        }
    }
    return true;
}
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 12 with YesButton

use of org.eclipse.reddeer.swt.impl.button.YesButton in project jbosstools-openshift by jbosstools.

the class ResourceLabelsWizardPage method deleteLabel.

/**
 * Removes resource label
 * @param name name of label to remove
 * @return true if label has been removed successfully, false otherwise
 */
public boolean deleteLabel(String name) {
    new DefaultTable().select(name);
    new PushButton(OpenShiftLabel.Button.REMOVE).click();
    new DefaultShell(OpenShiftLabel.Shell.REMOVE_LABEL);
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_LABEL));
    return new DefaultTable().containsItem(name);
}
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 13 with YesButton

use of org.eclipse.reddeer.swt.impl.button.YesButton in project jbosstools-openshift by jbosstools.

the class BuilderImageApplicationWizardHandlingTest method testPorts.

@Test
public void testPorts() {
    String defaultName = "8443-tcp";
    String defaultServicePort = "8443";
    String defaultPodPort = "8443";
    String newName = "1234-tcp";
    String newServicePort = "1234";
    String newPodPort = "4321";
    nextToBuildConfigurationWizardPage();
    next();
    next();
    // Test edit of an existing pod
    new DefaultTable().select(defaultName);
    new PushButton(OpenShiftLabel.Button.EDIT).click();
    new DefaultShell(OpenShiftLabel.Shell.SERVICE_PORTS);
    new LabeledText(OpenShiftLabel.TextLabels.POD_PORT).setText(newPodPort);
    new DefaultSpinner(OpenShiftLabel.TextLabels.SERVICE_PORT).setValue(Integer.valueOf(newServicePort));
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.SERVICE_PORTS));
    assertTrue("There should port mapping with name " + newName + ", but there is not.", new WidgetIsFound(org.eclipse.swt.widgets.TableItem.class, new WithTextMatcher(newName)).test());
    TableItem portMapping = new DefaultTable().getItem(newName);
    assertTrue("Modified pod mapping has incorrect mapped ports.", portMapping.getText(1).equals(newServicePort) && portMapping.getText(2).equals(newPodPort));
    // Test reset of pods
    new PushButton(OpenShiftLabel.Button.RESET).click();
    new DefaultShell(OpenShiftLabel.Shell.RESET_PORTS);
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESET_PORTS));
    new WaitWhile(new JobIsRunning());
    assertTrue("There should port mapping with name " + defaultName + ", but there is not.", new WidgetIsFound(org.eclipse.swt.widgets.TableItem.class, new WithTextMatcher(defaultName)).test());
    portMapping = new DefaultTable().getItem(defaultName);
    String resetServicePort = portMapping.getText(1);
    String resetPodPort = portMapping.getText(2);
    assertTrue("There should default values for port named " + defaultName + "\n" + "Service port should be " + defaultServicePort + ", but it is " + resetServicePort + " and pod port should be " + defaultPodPort + ", but it is " + resetPodPort, resetServicePort.equals(defaultServicePort) && resetPodPort.equals(defaultPodPort));
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) TableItem(org.eclipse.reddeer.swt.api.TableItem) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WidgetIsFound(org.eclipse.reddeer.core.condition.WidgetIsFound) WithTextMatcher(org.eclipse.reddeer.core.matcher.WithTextMatcher) DefaultSpinner(org.eclipse.reddeer.swt.impl.spinner.DefaultSpinner) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) Test(org.junit.Test)

Example 14 with YesButton

use of org.eclipse.reddeer.swt.impl.button.YesButton in project jbosstools-openshift by jbosstools.

the class AbstractOpenShiftApplicationWizard method processUntrustedSSLCertificate.

private void processUntrustedSSLCertificate() {
    try {
        new DefaultShell("Untrusted SSL Certificate");
        new YesButton().click();
    } catch (CoreLayerException ex) {
    // do nothing SSL Certificate shell did not appear.
    }
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) CoreLayerException(org.eclipse.reddeer.core.exception.CoreLayerException)

Example 15 with YesButton

use of org.eclipse.reddeer.swt.impl.button.YesButton in project jbosstools-openshift by jbosstools.

the class ImportApplicationWizard method finishAndOverrideExisting.

public void finishAndOverrideExisting() {
    new FinishButton().click();
    new DefaultShell("Overwrite project(s) ?");
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.LONG);
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) FinishButton(org.eclipse.reddeer.swt.impl.button.FinishButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Aggregations

YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)16 DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)16 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)14 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)14 Shell (org.eclipse.reddeer.swt.api.Shell)7 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)7 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)6 DataSourceExplorerView (org.eclipse.reddeer.eclipse.datatools.connectivity.ui.dse.views.DataSourceExplorerView)3 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)3 DefaultToolItem (org.eclipse.reddeer.swt.impl.toolbar.DefaultToolItem)3 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)3 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)3 RedDeerException (org.eclipse.reddeer.common.exception.RedDeerException)2 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)2 WidgetIsFound (org.eclipse.reddeer.core.condition.WidgetIsFound)2 TableItem (org.eclipse.reddeer.swt.api.TableItem)2 TreeItem (org.eclipse.reddeer.swt.api.TreeItem)2 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)2 Test (org.junit.Test)2 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)1