Search in sources :

Example 11 with SWTBotMenu

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

the class DockerExplorerViewSWTBotTest method shouldProvideDisabledStopCommandOnMultipleContainersAtOnce.

@Test
public void shouldProvideDisabledStopCommandOnMultipleContainersAtOnce() {
    // given
    final DockerClient client = MockDockerClientFactory.container(MockContainerFactory.name("gentle_foo").status("Running").build()).container(MockContainerFactory.name("angry_bar").status("Stopped").build()).build();
    final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
    DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
    // open the context menu on one of the containers
    selectContainersInTreeView("Test", "gentle_foo", "angry_bar");
    final SWTBotMenu menuCommand = dockerExplorerViewBot.bot().tree().contextMenu("Stop");
    // then
    MenuAssertion.assertThat(menuCommand).isVisible().isNotEnabled();
}
Also used : DockerConnection(org.eclipse.linuxtools.internal.docker.core.DockerConnection) DockerClient(com.spotify.docker.client.DockerClient) SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) Test(org.junit.Test)

Example 12 with SWTBotMenu

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

the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledPushCommandOnSelectedImage.

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

Example 13 with SWTBotMenu

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

the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledPauseCommandOnSelectedContainer.

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

Example 14 with SWTBotMenu

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

the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledUnpauseCommandOnSelectedContainer.

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

Example 15 with SWTBotMenu

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

the class DockerImageHierarchyViewSWTBotTest method shouldProvideEnabledRemoveCommandOnSelectedImage.

@Test
public void shouldProvideEnabledRemoveCommandOnSelectedImage() {
    // given
    shouldDisplayImageHierarchyViewWhenSelectingImage();
    // when
    selectImageInTreeView(bot, "root");
    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)

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