use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class ServerAdapterWizardHandlingTest method closeShell.
@After
public void closeShell() {
Shell shell = ShellLookup.getInstance().getShell(OpenShiftLabel.Shell.ADAPTER);
if (shell != null) {
new DefaultShell(OpenShiftLabel.Shell.ADAPTER);
new CancelButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.ADAPTER));
}
new WaitWhile(new JobIsRunning());
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class ServerAdapterFromResourceTest method newAdapterFromResource.
private void newAdapterFromResource(Resource type, String name) {
project.refresh();
project.getOpenShiftResource(type, name).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
String resourceType = null;
String selectors = name + " name=" + name;
if (type.equals(Resource.DEPLOYMENT)) {
resourceType = "ReplicationController";
selectors = name + " deploymentconfig=" + serviceReq.getService().getName() + ", name=" + serviceReq.getService().getName() + ", deployment=" + name;
} else {
resourceType = type.toString().replaceFirst(".$", "").replaceAll(" ", "");
}
assertTrue("Resource should be preselected for new OpenShift 3 server adapter", new DefaultTreeItem(project.getName(), selectors).isSelected());
try {
new DefaultStyledText(resourceType);
} catch (RedDeerException e) {
fail("Resource type does not match");
}
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, name, resourceType).test());
adapter = new ServerAdapter(Version.OPENSHIFT3, name, resourceType);
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class CreateResourcesTest method createResource.
private void createResource(String pathToResource) {
explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject(testProject).select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_RESOURCE).select();
new DefaultShell(OpenShiftLabel.Shell.NEW_RESOURCE);
assertTrue("Selected project has not been selected for new resource creation.", new LabeledCombo(OpenShiftLabel.TextLabels.PROJECT).getSelection().equals(testProject));
new LabeledText(OpenShiftLabel.TextLabels.RESOURCE_LOCATION).setText(pathToResource);
new FinishButton().click();
new DefaultShell(OpenShiftLabel.Shell.CREATE_RESOURCE_SUMMARY);
assertTrue("Resource is not listed in created resources summary", new DefaultTree().getAllItems().size() == 1);
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.NEW_RESOURCE));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class OpenShiftUtils method handleCheatSheetCreateServerAdapter.
public static void handleCheatSheetCreateServerAdapter() {
try {
new WaitUntil(new ShellIsAvailable(new WithTextMatcher(new RegexMatcher(OpenShiftLabel.Shell.CHEATSHEET + "|" + OpenShiftLabel.Shell.CREATE_SERVER_ADAPTER))), TimePeriod.LONG);
new NoButton().click();
new DefaultShell("Create server adapter");
new NoButton().click();
} catch (CoreLayerException ex) {
// Swallow, shells are not opened
} catch (WaitTimeoutExpiredException e) {
// Also swallow, shells are not opened
}
}
use of org.eclipse.reddeer.swt.impl.shell.DefaultShell in project jbosstools-openshift by jbosstools.
the class OpenShiftUtils method updateMavenProject.
public static void updateMavenProject(String projectName) {
new ProjectExplorer().getProject(projectName);
new ContextMenuItem("Maven", "Update Project...").select();
new DefaultShell("Update Maven Project");
new PushButton("Select All").click();
new PushButton("OK").click();
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
Aggregations