Search in sources :

Example 51 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class PortForwardingTest method testPortForwardingButtonsAccessibility.

@Test
public void testPortForwardingButtonsAccessibility() {
    openPortForwardingDialog();
    PushButton startAllButton = new PushButton(OpenShiftLabel.Button.START_ALL);
    PushButton stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
    OkButton okButton = new OkButton();
    assertTrue("Button Start All should be enabled at this point.", startAllButton.isEnabled());
    assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
    startAllButton.click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitUntil(new ControlIsEnabled(okButton));
    try {
        new WaitWhile(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
    } catch (WaitTimeoutExpiredException ex) {
        fail("Button Start All should be disabled at this point.");
    }
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new WaitWhile(new ControlIsEnabled(okButton), false);
    stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
    assertTrue("Button Stop All should be enabled at this point.", stopAllButton.isEnabled());
    stopAllButton.click();
    new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
    new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING);
    new WaitUntil(new ControlIsEnabled(okButton));
    try {
        new WaitUntil(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
    } catch (WaitTimeoutExpiredException ex) {
        fail("Button Start All should be enabled at this point.");
    }
    assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) WaitTimeoutExpiredException(org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException) JobIsRunning(org.eclipse.reddeer.workbench.core.condition.JobIsRunning) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) AbstractTest(org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest) Test(org.junit.Test)

Example 52 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell 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 53 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class ScalingTest method scaleTo.

private void scaleTo(int amountOfPods) {
    new ContextMenuItem(OpenShiftLabel.ContextMenu.SCALE_TO).select();
    new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.SCALE_DEPLOYMENTS));
    new DefaultShell(OpenShiftLabel.Shell.SCALE_DEPLOYMENTS).setFocus();
    new WaitWhile(new ControlIsEnabled(new OkButton()));
    new DefaultSpinner().setValue(amountOfPods);
    new WaitUntil(new ControlIsEnabled(new OkButton()));
    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) ContextMenuItem(org.eclipse.reddeer.swt.impl.menu.ContextMenuItem) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultSpinner(org.eclipse.reddeer.swt.impl.spinner.DefaultSpinner) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 54 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class ResourceLabelsWizardPage method editLabel.

/**
 * Changes resource label to have a new name and value.
 * @param name current name of resource label
 * @param newName new name of resource label
 * @param newValue new value of resource label
 * @return true if resource label was successfully modified, false otherwise
 */
public boolean editLabel(String name, String newName, String newValue) {
    new DefaultTable().select(name);
    new PushButton(OpenShiftLabel.Button.EDIT).click();
    new DefaultShell(OpenShiftLabel.Shell.RESOURCE_LABEL);
    new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText(newName);
    new LabeledText(OpenShiftLabel.TextLabels.VALUE).setText(newValue);
    new WaitUntil(new ControlIsEnabled(new OkButton()));
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESOURCE_LABEL));
    return new DefaultTable().containsItem(newName, 0) && new DefaultTable().containsItem(newValue, 1);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Example 55 with DefaultShell

use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.

the class ResourceLabelsWizardPage method createLabel.

/**
 * Creates a new resource label with specified name and value.
 *
 * @param name name of label
 * @param value value of label
 * @return true if label was created successfully, false otherwise
 */
public boolean createLabel(String name, String value) {
    new PushButton(OpenShiftLabel.Button.ADD).click();
    new DefaultShell(OpenShiftLabel.Shell.RESOURCE_LABEL);
    new LabeledText(OpenShiftLabel.TextLabels.LABEL).setText(name);
    new LabeledText(OpenShiftLabel.TextLabels.VALUE).setText(value);
    new WaitUntil(new ControlIsEnabled(new OkButton()));
    new OkButton().click();
    new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.RESOURCE_LABEL));
    return new DefaultTable().containsItem(name, 0) && new DefaultTable().containsItem(value, 1);
}
Also used : OkButton(org.eclipse.reddeer.swt.impl.button.OkButton) ShellIsAvailable(org.eclipse.reddeer.swt.condition.ShellIsAvailable) WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) DefaultShell(org.eclipse.reddeer.swt.impl.shell.DefaultShell) LabeledText(org.eclipse.reddeer.swt.impl.text.LabeledText) ControlIsEnabled(org.eclipse.reddeer.swt.condition.ControlIsEnabled) DefaultTable(org.eclipse.reddeer.swt.impl.table.DefaultTable) PushButton(org.eclipse.reddeer.swt.impl.button.PushButton) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil)

Aggregations

DefaultShell (org.eclipse.reddeer.swt.impl.shell.DefaultShell)129 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)84 ShellIsAvailable (org.eclipse.reddeer.swt.condition.ShellIsAvailable)83 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)57 OkButton (org.eclipse.reddeer.swt.impl.button.OkButton)49 JobIsRunning (org.eclipse.reddeer.workbench.core.condition.JobIsRunning)46 PushButton (org.eclipse.reddeer.swt.impl.button.PushButton)41 ContextMenuItem (org.eclipse.reddeer.swt.impl.menu.ContextMenuItem)36 LabeledText (org.eclipse.reddeer.swt.impl.text.LabeledText)30 FinishButton (org.eclipse.reddeer.swt.impl.button.FinishButton)28 Test (org.junit.Test)27 ControlIsEnabled (org.eclipse.reddeer.swt.condition.ControlIsEnabled)25 AbstractTest (org.jboss.tools.openshift.ui.bot.test.application.v3.basic.AbstractTest)18 Shell (org.eclipse.reddeer.swt.api.Shell)17 DefaultTreeItem (org.eclipse.reddeer.swt.impl.tree.DefaultTreeItem)17 OpenShiftExplorerView (org.jboss.tools.openshift.reddeer.view.OpenShiftExplorerView)17 WaitTimeoutExpiredException (org.eclipse.reddeer.common.exception.WaitTimeoutExpiredException)16 CoreLayerException (org.eclipse.reddeer.core.exception.CoreLayerException)16 YesButton (org.eclipse.reddeer.swt.impl.button.YesButton)16 DefaultTable (org.eclipse.reddeer.swt.impl.table.DefaultTable)16