use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class ImportApplicationTest method testImportOpenShiftApplicationViaOpenShiftExplorer.
@Test
public void testImportOpenShiftApplicationViaOpenShiftExplorer() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.open();
new WaitUntil(new OpenShiftResourceExists(Resource.BUILD_CONFIG, (Matcher<String>) null, ResourceState.UNSPECIFIED, projectReq.getProjectName(), connectionReq.getConnection()), TimePeriod.LONG);
explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getOpenShiftResources(Resource.BUILD_CONFIG).get(0).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.IMPORT_APPLICATION).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.IMPORT_APPLICATION), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.IMPORT_APPLICATION);
new CheckBox("Use default clone destination").toggle(false);
File gitRepo = new File(GIT_REPO_DIRECTORY);
new LabeledText("Git Clone Location:").setText(gitRepo.getAbsolutePath());
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 kitchen sink project, but there is not", projectExplorer.containsProject(PROJECT_NAME));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable 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.condition.ShellIsAvailable 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.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class CreateServerAdapterTest method testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView.
@Test
public void testCreateOpenShift3ServerAdapterViaOpenShiftExplorerView() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.getOpenShift3Connection(connectionReq.getConnection()).refresh();
explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(projectReq.getProjectName()).getServicesWithName("eap-app").get(0).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
assertTrue("Service should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(projectReq.getProjectName(), "eap-app deploymentConfig=eap-app").isSelected());
assertTrue("Eclipse project should be preselected automatically for new server adapter", new LabeledText("Eclipse Project: ").getText().equals(PROJECT_NAME));
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(""));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG, false);
assertTrue("OpenShift 3 server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, "eap-app", "Service").test());
}
use of org.eclipse.reddeer.swt.condition.ShellIsAvailable in project jbosstools-openshift by jbosstools.
the class TemplateParametersTest method closeNewApplicationWizard.
@After
public void closeNewApplicationWizard() {
new CancelButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_APP_WIZARD), TimePeriod.LONG);
new WaitWhile(new JobIsRunning());
}
Aggregations