Search in sources :

Example 6 with YesButton

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

the class TestUtils method acceptSSLCertificate.

public static void acceptSSLCertificate() {
    try {
        new DefaultShell(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE);
        new YesButton().click();
        new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.UNTRUSTED_SSL_CERTIFICATE));
    } catch (RedDeerException ex) {
    // no dialog was presented
    }
}
Also used : ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) RedDeerException(org.eclipse.reddeer.common.exception.RedDeerException) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton)

Example 7 with YesButton

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

the class ScalingTest method scaleTo0ShouldWarn.

@Test
public void scaleTo0ShouldWarn() {
    int pods = requiredService.getReplicationController().getCurrentReplicaCount();
    new WaitUntil(new PodsAreDeployed(project, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, pods), TimePeriod.LONG);
    OpenShiftResource replicationController = project.getOpenShiftResource(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER);
    replicationController.select();
    scaleTo(0);
    new DefaultShell(OpenShiftLabel.Shell.STOP_ALL_DEPLOYMENTS).setFocus();
    new YesButton().click();
    assertPodAmountDesiredEqualsCurrent(0, project);
}
Also used : DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) PodsAreDeployed(org.jboss.tools.openshift.reddeer.condition.PodsAreDeployed) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) YesButton(org.eclipse.reddeer.swt.impl.button.YesButton) OpenShiftResource(org.jboss.tools.openshift.reddeer.view.resources.OpenShiftResource) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 8 with YesButton

use of org.eclipse.reddeer.swt.impl.button.YesButton 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 9 with YesButton

use of org.eclipse.reddeer.swt.impl.button.YesButton 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)

Example 10 with YesButton

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

the class EnvironmentVariableWizardPage method resetEnvironmentVariable.

/**
 * Resets environment variable to its default state.
 *
 * @param changedVar
 * @param originalVar
 * @return true if variable was reset successfully, false otherwise
 */
public boolean resetEnvironmentVariable(EnvVar changedVar, EnvVar defaultVar) {
    DefaultTable table = new DefaultTable();
    table.getItem(changedVar.getName()).select();
    new PushButton(OpenShiftLabel.Button.RESET).click();
    new DefaultShell(OpenShiftLabel.Shell.RESET_ENV_VAR);
    new YesButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESET_ENV_VAR));
    return table.containsItem(defaultVar.getName(), 0) && table.containsItem(defaultVar.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)

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