use of org.eclipse.reddeer.swt.api.TreeItem in project linuxtools by eclipse.
the class DockerConnection method getContainersNames.
public List<String> getContainersNames() {
select();
List<String> containersNames = new ArrayList<String>();
List<TreeItem> containers = treeViewerHandler.getTreeItem(item, "Containers").getItems();
for (TreeItem item : containers) {
containersNames.add(treeViewerHandler.getNonStyledText(item));
}
return containersNames;
}
use of org.eclipse.reddeer.swt.api.TreeItem in project linuxtools by eclipse.
the class DockerConnection method getImagesNames.
public List<String> getImagesNames(boolean withTag) {
select();
List<String> imagesNames = new ArrayList<String>();
List<TreeItem> images = treeViewerHandler.getTreeItem(item, "Images").getItems();
for (TreeItem item : images) {
String imageName = treeViewerHandler.getNonStyledText(item);
if (withTag) {
String imageTag = getImageTag(item);
imagesNames.add(imageName + imageTag);
} else {
imagesNames.add(imageName);
}
}
return imagesNames;
}
use of org.eclipse.reddeer.swt.api.TreeItem in project linuxtools by eclipse.
the class HierarchyViewTest method testHierarchyView.
@Test
public void testHierarchyView() {
DockerImagesTab imageTab = openDockerImagesTab();
buildImage(IMAGE_TEST_BUILD, DOCKERFILE_FOLDER, imageTab);
if (mockitoIsUsed()) {
buildImage();
}
DockerImageHierarchyTab hierarchyTab = openDockerImageHierarchyTab();
List<TreeItem> treeItems = hierarchyTab.getTreeItems();
compareTextInFirstNode(treeItems, "alpine:3.3");
List<TreeItem> treeItems2 = treeItems.get(0).getItems();
compareTextInFirstNode(treeItems2, IMAGE_TEST_BUILD + NAME_TAG_SEPARATOR + IMAGE_TAG_LATEST);
}
use of org.eclipse.reddeer.swt.api.TreeItem in project jbosstools-openshift by jbosstools.
the class CDKTestUtils method removeAccessRedHatCredentials.
// removes access redhat com credentials used for first cdk run
public static void removeAccessRedHatCredentials(String domain, String username) {
WorkbenchPreferenceDialog dialog = new WorkbenchPreferenceDialog();
dialog.open();
// $NON-NLS-1$ //$NON-NLS-2$
dialog.select("JBoss Tools", "Credentials");
try {
new WaitUntil(new WidgetIsFound(org.eclipse.swt.custom.CLabel.class, new WithMnemonicTextMatcher("Credentials")), // $NON-NLS-1$
TimePeriod.MEDIUM);
// $NON-NLS-1$
new DefaultCLabel("Credentials");
DefaultTree tree = new DefaultTree(1);
TreeItem item = TreeViewerHandler.getInstance().getTreeItem(tree, new String[] { domain, username });
item.select();
// $NON-NLS-1$
new PushButton(new WithTextMatcher("Remove User")).click();
new WaitUntil(new JobIsRunning(), TimePeriod.MEDIUM, false);
} catch (WaitTimeoutExpiredException exc) {
// $NON-NLS-1$
log.error("JBoss Tools - Credentials preferences page has timed out");
exc.printStackTrace();
} catch (JFaceLayerException exc) {
// $NON-NLS-1$
log.error("JBoss Tools - Credentials does not contain required username to be deleted");
exc.printStackTrace();
} finally {
dialog.ok();
}
}
use of org.eclipse.reddeer.swt.api.TreeItem in project jbosstools-openshift by jbosstools.
the class DebuggingEAPAppTest method ensureCorrectFrameIsSelected.
private TreeItem ensureCorrectFrameIsSelected(LaunchView debugView) {
List<TreeItem> items;
TreeItem createHelloMessageDebugItem;
// get frames of suspended thread. If the desired frame is not present,
// try reopening Debug view
items = getSuspendedThreadTreeItem(debugView).getItems();
if (items.size() < 2) {
// no stack trace available. Try to close&reopen Debug view (dirty
// hack)
debugView.close();
debugView = new LaunchView();
debugView.open();
items = getSuspendedThreadTreeItem(debugView).getItems();
}
final List<TreeItem> tIList = items;
// wait for frame texts to populate.
new WaitUntil(new AbstractWaitCondition() {
@Override
public boolean test() {
return tIList.stream().peek(ti -> LOGGER.debug(ti.getText())).filter(ti -> ti.getText().contains("createHelloMessage")).findFirst().isPresent();
}
}, TimePeriod.LONG);
createHelloMessageDebugItem = tIList.stream().peek(ti -> LOGGER.debug(ti.getText())).filter(ti -> ti.getText().contains("createHelloMessage")).findFirst().get();
// select the item and return it
createHelloMessageDebugItem.select();
return createHelloMessageDebugItem;
}
Aggregations