use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project linuxtools by eclipse.
the class BuildDockerImageShortcutSWTBotTest method getRunAsdockerImageBuildContextMenu.
/**
* @return the {@link SWTBotMenu} for the "Run as > Docker Image Build"
* shortcut
*/
private SWTBotMenu getRunAsdockerImageBuildContextMenu(final String projectName, final String dockerFileName) {
final SWTBotTreeItem fooProjectTreeItem = SWTUtils.getTreeItem(this.projectExplorerViewRule.getProjectExplorerBotView(), projectName);
assertThat(fooProjectTreeItem).isNotNull();
SWTUtils.syncExec(() -> fooProjectTreeItem.expand());
final SWTBotTreeItem dockerfileTreeItem = SWTUtils.getTreeItem(fooProjectTreeItem, dockerFileName);
assertThat(dockerfileTreeItem).isNotNull();
SWTUtils.select(dockerfileTreeItem);
final SWTBotMenu runAsDockerImageBuildMenu = SWTUtils.getContextMenu(this.projectExplorerViewRule.getProjectExplorerBotView().bot().tree(), "Run As", "1 Docker Image Build");
return runAsDockerImageBuildMenu;
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project linuxtools by eclipse.
the class DockerComposeSWTBotTest method shouldValidateLaunchConfiguration.
@Test
@RunWithProject("foo")
// ignored for now because the "Run" menu from the toolbar remains
@Ignore
public // found.
void shouldValidateLaunchConfiguration() throws CoreException {
// given
final DockerClient client = MockDockerClientFactory.build();
final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
final IFile dockerComposeScript = projectInit.getProject().getFile("docker-compose.yml");
LaunchConfigurationUtils.createDockerComposeUpLaunchConfiguration(dockerConnection, dockerComposeScript);
// when
bot.toolbarDropDownButtonWithTooltip("Run").menuItem("Run Configurations...").click();
final SWTBotTreeItem dockerComposeTreeItem = SWTUtils.expand(bot.tree(), "Docker Compose");
SWTUtils.select(dockerComposeTreeItem, "Docker Compose [foo]");
// verify that the config is set and the form can be closed with the
// "OK" button
ComboAssertions.assertThat(bot.comboBox(0)).isEnabled().itemSelected("Test");
TextAssertions.assertThat(bot.text(2)).isEnabled().textEquals("/foo");
ButtonAssertions.assertThat(bot.button("Run")).isEnabled();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.
the class IsProjectNotExist method test.
/** (non-Javadoc)
* @see org.eclipse.swtbot.swt.finder.waits.ICondition#test()
*/
public boolean test() throws Exception {
boolean result = true;
SWTBotTreeItem[] items = ProjectTreeView.getTree().getAllItems();
for (SWTBotTreeItem item : items) {
if (projectName.equals(item.getText())) {
result = false;
break;
}
}
return result;
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem in project translationstudio8 by heartsome.
the class ProjectFile method openFile.
/**
* @param from
* 打开文件的入口:右键菜单、双击,请使用 TS 类提供的常量;
*/
public void openFile(Entry from) {
assertTrue("参数错误,Excel 数据行 row 为 null。", row != null);
getDataFile();
SWTBotTreeItem item = select();
assertTrue("如下选择类型不是文件:" + selectType, selectType == TsUIConstants.ResourceType.FILE);
switch(from) {
case DOUBLE_CLICK:
{
item.doubleClick();
break;
}
case CONTEXT_MENU:
{
view.ctxMenuOpenFile().click();
break;
}
default:
{
assertTrue("参数错误,无此入口:" + from, false);
}
}
HSBot.bot().waitUntil(new IsFileOpenedInEditor(fileName));
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem 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);
}
Aggregations