use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project linuxtools by eclipse.
the class ImageRunSWTBotTest method shouldNotReportErrorIfNoContainerWithSameNameExists.
@Test
public void shouldNotReportErrorIfNoContainerWithSameNameExists() {
// given
final DockerClient client = MockDockerClientFactory.image(MockImageFactory.name("foo:latest").build()).container(MockContainerFactory.name("foo_bar").build()).build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// expand the 'Images' node and select the 'foo' images
SWTUtils.getTreeItem(dockerExplorerViewBot, "Test", "Images", "foo").select();
// when opening the "Run Image..." wizard
final SWTBotTree dockerExplorerViewTreeBot = dockerExplorerViewBot.bot().tree();
dockerExplorerViewTreeBot.contextMenu("Run...").click();
// when use an existing container name
bot.textWithLabel(WizardMessages.getString("ImageRunSelectionPage.containerName")).setText("foo_bar_baz");
// then
assertThat(bot.button("Finish").isEnabled()).isEqualTo(true);
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project linuxtools by eclipse.
the class ImageSearchSWTBotTest method openPullWizard.
private void openPullWizard(final DockerClient client) {
// given
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
// expand the 'Images' node
final SWTBotTreeItem imagesTreeItem = SWTUtils.getTreeItem(dockerExplorerViewBot, "Test", "Images");
// when opening the "Pull..." wizard
final SWTBotTree dockerExplorerViewTreeBot = dockerExplorerViewBot.bot().tree();
imagesTreeItem.select();
dockerExplorerViewTreeBot.contextMenu("Pull...").click();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project translationstudio8 by heartsome.
the class ProjectDelete method deletePrj.
/**
* 删除项目
* @param name
* 项目名称
* @param deleteContent
* 是否同时删除项目文件夹
*/
public void deletePrj(Entry from, String name, boolean deleteContent) {
ProjectTreeView ptv = ProjectTreeView.getInstance();
SWTBotTree treePrj = ProjectTreeView.getTree();
Waits.prjExistOnTree(name);
// 取消选中任何项目,避免误操作
treePrj.unselect();
// 选择项目并删除
treePrj.select(name).isActive();
switch(from) {
case CONTEXT_MENU:
{
ptv.ctxMenuDelete().click();
break;
}
case MENU:
{
TS.getInstance().menuEditDelete().click();
break;
}
default:
{
assertTrue("无此入口:" + from, false);
}
}
// 确认删除对话框
ConfirmProjectDeleteDialog cpd = new ConfirmProjectDeleteDialog(name);
cpd.isActive();
// 选择是否删除内容
if (deleteContent) {
cpd.radBtnAlsoDeleteContentsUnder().click();
cpd.btnYes().click();
Waits.shellClosed(cpd);
SWTBotShell[] shells = HSBot.bot().shells();
if (shells.length > 1) {
ProgressDialog dlgProg = new ProgressDialog("dlgTitleProgressDeleteResource");
Waits.shellClosed(dlgProg);
}
Waits.prjNotExistOnTree(name);
Waits.prjNotExistInWorkspace(name);
} else {
cpd.radBtnDoNotDeleteContents().click();
cpd.btnYes().click();
Waits.shellClosed(cpd);
SWTBotShell[] shells = HSBot.bot().shells();
if (shells.length > 1) {
ProgressDialog dlgProg = new ProgressDialog("dlgTitleProgressDeleteResource");
Waits.shellClosed(dlgProg);
}
Waits.prjNotExistOnTree(name);
Waits.prjExistInWorkspace(name);
}
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project gfm_viewer by satyagraha.
the class ProjectBot method createSimpleProject.
public static ProjectBot createSimpleProject() {
String projectName = "Project_" + System.currentTimeMillis();
bot.menu("File").menu("New").menu("Project...").click();
SWTBotShell shell = bot.shell("New Project");
shell.activate();
bot.tree().expandNode("General").select("Project");
bot.button("Next >").click();
bot.textWithLabel("Project name:").setText(projectName);
bot.button("Finish").click();
SWTUtils.sleep(2000);
SWTBotTree projectsTree = bot.viewByTitle("Project Explorer").bot().tree();
SWTBotTreeItem projectTree = projectsTree.getTreeItem(projectName);
return new ProjectBot(projectTree);
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project xtext-xtend by eclipse.
the class SwtBotProjectHelper method expandNode.
public static SWTBotTreeItem expandNode(final AbstractSWTBot<?> bot, final String node) {
SWTBotTreeItem item = null;
if ((bot instanceof SWTBotTree)) {
item = ((SWTBotTree) bot).getTreeItem(node);
} else {
if ((bot instanceof SWTBotTreeItem)) {
item = ((SWTBotTreeItem) bot).getNode(node);
}
}
boolean _isExpanded = item.isExpanded();
boolean _not = (!_isExpanded);
if (_not) {
item.expand();
}
return item;
}
Aggregations