use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class ImportApplicationTest method testImportOpenShiftApplicationViaShellMenu.
@Test
public void testImportOpenShiftApplicationViaShellMenu() {
new ShellMenuItem("File", "Import...").select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.IMPORT);
new DefaultTreeItem("OpenShift", "Existing OpenShift Application").select();
new NextButton().click();
new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
TestUtils.acceptSSLCertificate();
new NextButton().click();
TestUtils.acceptSSLCertificate();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new ButtonWithTextIsAvailable("Refresh"), TimePeriod.VERY_LONG);
new WaitUntil(new TreeHasChildren(new DefaultTree()), TimePeriod.DEFAULT);
new DefaultTreeItem(projectReq.getProjectName() + " " + projectReq.getProjectName()).getItems().get(0).select();
new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.DEFAULT);
new NextButton().click();
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.VERY_LONG);
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
ProjectExplorer projectExplorer = new ProjectExplorer();
projectExplorer.open();
assertTrue("There should be imported " + PROJECT_NAME + "project, but there is not", projectExplorer.containsProject(PROJECT_NAME));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class EditResourceLimitsTest method incrementLimits.
private void incrementLimits(int index, String defaultSuffix) {
new ContextMenuItem(OpenShiftLabel.ContextMenu.EDIT_RESOURCE_LIMITS).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.EDIT_RESOURCE_LIMITS));
new DefaultShell(OpenShiftLabel.Shell.EDIT_RESOURCE_LIMITS).setFocus();
Text text = new DefaultText(index);
String value = text.getText();
long val = 0L;
try {
val = Long.parseLong(value);
} catch (NumberFormatException e) {
}
text.setText(Long.toString(++val));
Combo combo = new DefaultCombo(index);
value = combo.getSelection();
if (StringUtils.isEmpty(value)) {
combo.setSelection(defaultSuffix);
}
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 OSExplorerResourceTest method testDeploymentConfigVisibleAfterServiceDeletion.
/**
* Test if deployment config is visible in OS Explorer, when there is no service.
*/
@Test(expected = OpenshiftTestInFailureException.class)
public void testDeploymentConfigVisibleAfterServiceDeletion() {
this.project.expand();
Service service = this.project.getService(OpenShiftResources.EAP_SERVICE);
assertTrue("Service does not exist!", service != null);
service.select();
new ContextMenuItem("Delete").select();
new DefaultShell("Delete OpenShift Resource");
new OkButton().click();
// assert service is deleted
List<OpenShiftResource> resources = this.project.getOpenShiftResources(Resource.SERVICE);
assertTrue("Service not deleted!", resources.isEmpty());
try {
this.project.getTreeItem().getItem("eap-app selector: deploymentConfig=eap-app");
} catch (CoreLayerException e) {
// TODO: do not throw after JBIDE-24217 is fixed
throw new OpenshiftTestInFailureException("JBIDE-24217");
// TODO: uncomment after JBIDE-24217 is fixed
// fail("Deployment config not visible!");
}
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class EditResourcesTest method testIncorrectResourceContent.
@Test
public void testIncorrectResourceContent() {
TextEditor editor = getBuildConfigTextEditor();
String text = editor.getText();
if (buildConfig == null) {
buildConfig = text;
}
editor.setText(text.replace("\"namespace\" : \"" + DatastoreOS3.PROJECT1 + "\"", "\"namespace\" : \"" + DatastoreOS3.PROJECT1 + "\"wtf"));
try {
editor.save();
} catch (CoreLayerException ex) {
// ok
}
new WaitWhile(new JobIsRunning(), TimePeriod.DEFAULT, false);
assertTrue("Editor should be dirty, it should not be able to save incorrect content", editor.isDirty());
try {
new DefaultShell("Problem Occurred");
new OkButton().click();
} catch (RedDeerException ex) {
// sometimes it occures, sometimes not
}
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class PortForwardingTest method openPortForwardingDialog.
private void openPortForwardingDialog() {
OpenShift3Connection openShift3Connection = new OpenShiftExplorerView().getOpenShift3Connection(connectionReq.getConnection());
ApplicationPodIsRunning applicationPodIsRunning = new ApplicationPodIsRunning(openShift3Connection.getProject(projectReq.getProjectName()));
new WaitUntil(applicationPodIsRunning, TimePeriod.LONG);
openShift3Connection.getProject(projectReq.getProjectName()).getOpenShiftResource(Resource.POD, applicationPodIsRunning.getApplicationPodName()).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.PORT_FORWARD).select();
new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING);
}
Aggregations