Search in sources :

Example 16 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.

the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledAddTagCommandOnSelectedImage.

@Test
public void shouldProvideEnabledAddTagCommandOnSelectedImage() {
    // given
    shouldDisplayImageHierarchyViewWhenSelectingImage();
    // when
    selectImageInTreeView(bot, "root");
    final SWTBotMenu menu = SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Add Tag");
    // then
    MenuAssertion.assertThat(menu).isVisible().isEnabled();
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Example 17 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.

the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledRemoveCommandOnSelectedContainer.

@Test
public void shouldProvideEnabledRemoveCommandOnSelectedContainer() {
    // given
    shouldDisplayImageHierarchyViewWhenSelectingImage();
    // when
    selectImageInTreeView(bot, "root", "foo_image1", "foo_image2", "foo_container21");
    final SWTBotMenu menu = SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Remove");
    // then
    MenuAssertion.assertThat(menu).isVisible().isEnabled();
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Example 18 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.

the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledCommitCommandOnSelectedContainer.

@Test
public void shouldProvideEnabledCommitCommandOnSelectedContainer() {
    // given
    shouldDisplayImageHierarchyViewWhenSelectingImage();
    // when
    selectImageInTreeView(bot, "root", "foo_image1", "foo_image2", "foo_container21");
    final SWTBotMenu menu = SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Commit");
    // then
    MenuAssertion.assertThat(menu).isVisible().isEnabled();
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Example 19 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.

the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledStartCommandOnSelectedContainer.

@Test
public void shouldProvideEnabledStartCommandOnSelectedContainer() {
    // given
    shouldDisplayImageHierarchyViewWhenSelectingImage();
    // when
    selectImageInTreeView(bot, "root", "foo_image1", "foo_image2", "foo_container21");
    final SWTBotMenu menu = SWTUtils.getContextMenu(bot.viewById(DockerImageHierarchyView.VIEW_ID).bot().tree(), "Start");
    // then
    MenuAssertion.assertThat(menu).isVisible().isEnabled();
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Example 20 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu 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;
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)

Aggregations

SWTBotMenu (org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)44 Test (org.junit.Test)27 DockerClient (com.spotify.docker.client.DockerClient)14 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)14 SWTBotEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor)3 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)3 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)3 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)3 IsEditorOpened (net.heartsome.test.swtbot.waits.IsEditorOpened)2 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)2 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)2 SWTBotRadio (org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio)2 SWTBotText (org.eclipse.swtbot.swt.finder.widgets.SWTBotText)2 ArrayList (java.util.ArrayList)1 ContributionItem (org.eclipse.jface.action.ContributionItem)1 IContributionItem (org.eclipse.jface.action.IContributionItem)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 AbstractTest (org.eclipse.linuxtools.profiling.tests.AbstractTest)1 AbstractChartBuilder (org.eclipse.linuxtools.systemtap.graphing.ui.charts.AbstractChartBuilder)1