use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-openshift by jbosstools.
the class Service method createServerAdapter.
/**
* Creates server adapter for this service with default values.
*/
public void createServerAdapter() {
select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS));
new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-openshift by jbosstools.
the class AbstractOpenShiftConnection method remove.
/**
* Removes connection from OpenShift explorer view.
*/
public void remove() {
item.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_CONNECTION).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_CONNECTION));
new DefaultShell(OpenShiftLabel.Shell.REMOVE_CONNECTION);
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_CONNECTION));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-openshift by jbosstools.
the class PortForwardingTest method closePortForwardingShell.
@After
public void closePortForwardingShell() {
PushButton stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
if (stopAllButton.isEnabled()) {
stopAllButton.click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
}
new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING).close();
}
use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning in project jbosstools-openshift by jbosstools.
the class PortForwardingTest method testFreePortsForPortForwarding.
@Test
public void testFreePortsForPortForwarding() {
openPortForwardingDialog();
CheckBox checkBox = new CheckBox(OpenShiftLabel.TextLabels.FIND_FREE_PORTS);
Table table = new DefaultTable();
assertTrue("Default port should be used for ping on first opening of Port forwarding dialog.", table.getItem("ping").getText(1).equals("8888"));
assertTrue("Default port should be used for http on first opening of Port forwarding dialog.", table.getItem("http").getText(1).equals("8080"));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
checkBox.click();
assertFalse("Free port port should be used for ping at this point.", table.getItem("ping").getText(1).equals("8888"));
assertFalse("Free port should be used for http at this point.", table.getItem("http").getText(1).equals("8080"));
checkBox.click();
assertTrue("Default port should be used for ping at this point.", table.getItem("ping").getText(1).equals("8888"));
assertTrue("Default port should be used for http at this point.", table.getItem("http").getText(1).equals("8080"));
}
use of org.eclipse.reddeer.workbench.core.condition.JobIsRunning 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());
}
Aggregations