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());
}
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);
}
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();
}
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);
}
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);
}
Aggregations