use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class CDKWrongCredentialsTest method closeAllErrorDialogs.
private void closeAllErrorDialogs() {
try {
new DefaultShell("Problem Occurred");
new OkButton().click();
} catch (CoreLayerException exc) {
log.info("Problem Occurred dialog was not present");
}
try {
new DefaultShell("Multiple problems have occurred");
new OkButton().click();
} catch (CoreLayerException exc) {
log.info("Multiple problems have occurred dialog was not present");
}
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class CDKImageRegistryUrlDiscoveryFailureTest method testRegistryUrlNotFoundDialog.
/**
* Covers JBIDE-25049
*/
@Test
public void testRegistryUrlNotFoundDialog() {
String shellTitle = OpenShiftLabel.Shell.REGISTRY_URL_NOT_FOUND;
wizard.getImageRegistryUrl().setText("");
wizard.finish();
stopServerAdapter();
wizard = connection.editConnection();
switchOffPasswordSaving();
try {
wizard.discover();
fail("Expected OpenshiftToolsException was not thrown, possibly no dialog is shown.");
} catch (OpenShiftToolsException osExc) {
// os exception was thrown with specific message
assertTrue("Registry URL not found dialog did not appear.", osExc.getMessage().contains(shellTitle));
// error dialog is still there
new WaitUntil(new ShellIsAvailable(shellTitle), TimePeriod.SHORT);
new DefaultShell(shellTitle);
new OkButton().click();
}
wizard.cancel();
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method testOpenshiftConnection.
/**
* Tests Openshift 3 connection and try to refresh it
*
* @param connection
*/
public void testOpenshiftConnection(String server, String username) {
OpenShift3Connection connection = null;
try {
connection = findOpenShiftConnection(server, username);
} catch (OpenShiftToolsException toolsExc) {
fail(toolsExc.getMessage());
}
// usually, when server adapter is not started, openshift connection after refresh should cause
// problem occurred dialog
connection.refresh();
try {
// $NON-NLS-1$
new WaitUntil(new ShellIsAvailable("Problem occurred"), TimePeriod.getCustom(30));
CDKUtils.captureScreenshot("CDKServerAdapterAbstractTest#testOpenshiftConnection");
new DefaultShell("Problem occurred").close();
// $NON-NLS-1$
fail("Problem dialog occured when refreshing OpenShift connection");
} catch (WaitTimeoutExpiredException ex) {
// no dialog appeared, which is ok
// $NON-NLS-1$
log.info("Expected WaitTimeoutExpiredException occured");
}
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class NewApplicationWizardHandlingTest method verifyDefinedResourcesForTemplate.
private void verifyDefinedResourcesForTemplate() {
try {
new WaitUntil(new ControlIsEnabled(new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES)), TimePeriod.DEFAULT);
} catch (WaitTimeoutExpiredException ex) {
fail("Defined Resources button is not enabled");
} catch (CoreLayerException ex) {
// Defined resources button was not found
throw new OpenshiftTestInFailureException("Defined resources button was not found. Probable cause: JBIDE-24492", ex);
}
new PushButton(OpenShiftLabel.Button.DEFINED_RESOURCES).click();
new DefaultShell(OpenShiftLabel.Shell.TEMPLATE_DETAILS);
List<TreeItem> items = new DefaultTree().getItems();
assertTrue("There should be build config item in tree describing resources", items.get(0).getText().contains("BuildConfig"));
assertTrue("There should be deployment config item in tree describing resources", items.get(1).getText().contains("DeploymentConfig"));
assertTrue("There should be image stream item in tree describing resources", items.get(2).getText().contains("ImageStream"));
assertTrue("There should be route item in tree describing resources", items.get(3).getText().contains("Route"));
assertTrue("There should be service item in tree describing resources", items.get(4).getText().contains("Service"));
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.TEMPLATE_DETAILS), TimePeriod.DEFAULT);
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell 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));
}
Aggregations