use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.
the class NewApplicationWizardHandlingTest method testTemplatesRelatedWidgetAccess.
@Test
public void testTemplatesRelatedWidgetAccess() {
assertTrue("Server template selection should be chosen by default.", new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).isSelected());
new DefaultTabItem(OpenShiftLabel.TextLabels.CUSTOM_TEMPLATE).activate();
try {
new DefaultTree();
fail("Tree with server templates should not be visible if local template " + "tab item is selected.");
} catch (RedDeerException ex) {
// pass
}
assertTrue("Browse button should be visible and enabled while local template " + "tab item is selected.", new PushButton(OpenShiftLabel.Button.BROWSE).isEnabled());
new DefaultTabItem(OpenShiftLabel.TextLabels.SERVER_TEMPLATE).activate();
assertTrue("Tree with server templates should be visible and enabled if server template " + "tab item is selected.", new DefaultTree().isEnabled());
try {
new PushButton(1, new WithTextMatcher(OpenShiftLabel.Button.BROWSE));
fail("Browse button should not be visible while server template tab item is selected.");
} catch (RedDeerException ex) {
// pass
}
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.
the class OpenShiftExplorerView method getConnectionItem.
private TreeItem getConnectionItem(String server, String username) {
open();
if (username == null) {
username = TreeViewerHandler.getInstance().getNonStyledText(new DefaultTree().getItems().get(0));
}
TreeItem connectionItem = treeViewerHandler.getTreeItem(new DefaultTree(), username);
if (server != null && DatastoreOS3.AUTH_METHOD.equals(AuthenticationMethod.OAUTH)) {
if (treeViewerHandler.getStyledTexts(connectionItem)[0].equals(server)) {
return connectionItem;
} else {
throw new OpenShiftToolsException("There is no connection with specified server " + server + " and username " + username);
}
} else {
return connectionItem;
}
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project linuxtools by eclipse.
the class DockerExplorerView method getDockerConnectionNames.
/**
* Gets names of all docker connections present in docker explorer.
*
* @return list of docker connections names
*/
public List<String> getDockerConnectionNames() {
activate();
List<String> connectionsNames = new ArrayList<String>();
try {
List<TreeItem> connections = new DefaultTree().getItems();
for (TreeItem item : connections) {
connectionsNames.add(getName(item));
}
} catch (CoreLayerException ex) {
// no connections in view
}
return connectionsNames;
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTree in project jbosstools-openshift by jbosstools.
the class HandleCustomTemplateTest method createTemplateFromJson.
private void createTemplateFromJson() {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.open();
explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject().select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_RESOURCE).select();
new DefaultShell(OpenShiftLabel.Shell.NEW_RESOURCE);
new LabeledText(OpenShiftLabel.TextLabels.RESOURCE_LOCATION).setText(System.getProperty("user.dir") + File.separator + "resources" + File.separator + "hello-world-template.json");
new FinishButton().click();
new DefaultShell(OpenShiftLabel.Shell.CREATE_RESOURCE_SUMMARY);
assertTrue("Template 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);
List<OpenShiftResource> templates = explorer.getOpenShift3Connection(connectionReq.getConnection()).getProject().getOpenShiftResources(Resource.TEMPLATE);
assertTrue("There should be precisely 1 created template for the project.", templates.size() > 0);
String templateName = templates.get(0).getName();
assertTrue("Template name '" + templateName + "' does not match required name " + "helloworld-sample.", templateName.equals("helloworld-sample"));
}
use of org.eclipse.reddeer.swt.impl.tree.DefaultTree 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);
}
Aggregations