Search in sources :

Example 6 with SWTBotToolbarButton

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

the class TestCreateSystemtapScript method finalCleanUp.

@AfterClass
public static void finalCleanUp() {
    projectExplorer.setFocus();
    SWTBotToolbarButton forwardButton = projectExplorer.toolbarPushButton("Forward");
    projectExplorer.toolbarPushButton("Back to Workspace").click();
    bot.waitUntil(Conditions.widgetIsEnabled(forwardButton));
    projectExplorer.bot().tree().select(SYSTEMTAP_PROJECT_NAME).contextMenu("Delete").click();
    SWTBotShell deleteShell = bot.shell("Delete Resources");
    deleteShell.bot().button("OK").click();
    bot.waitUntil(Conditions.shellCloses(deleteShell));
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton) AfterClass(org.junit.AfterClass)

Example 7 with SWTBotToolbarButton

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

the class DockerImagesViewSWTBotTest method verifyBuildAndPullActionEnablement.

@Test
public void verifyBuildAndPullActionEnablement() {
    // given
    final DockerClient client = MockDockerClientFactory.image(MockImageFactory.name("angry_bar").build()).build();
    final DockerConnection dockerConnection = MockDockerConnectionFactory.from("Test", client).withDefaultTCPConnectionSettings();
    DockerConnectionManagerUtils.configureConnectionManager(dockerConnection);
    SWTUtils.syncExec(() -> SWTUtils.getView(bot, "org.eclipse.ui.views.PropertySheet", true));
    this.dockerImagesView.setFocus();
    // select the container in the table
    selectImageInTable("angry_bar");
    List<SWTBotToolbarButton> buttons = this.dockerImagesBotView.getToolbarButtons();
    for (SWTBotToolbarButton button : buttons) {
        if (button.getText().equals("Build Image")) {
            assertThat(button.isEnabled());
        } else if (button.getText().equals("Pull...")) {
            assertThat(button.isEnabled());
        }
    }
    unselectImages();
    buttons = this.dockerImagesBotView.getToolbarButtons();
    for (SWTBotToolbarButton button : buttons) {
        if (button.getText().equals("Build Image")) {
            assertThat(button.isEnabled());
        } else if (button.getText().equals("Pull...")) {
            assertThat(button.isEnabled());
        }
    }
    unselectConnections();
    buttons = this.dockerImagesBotView.getToolbarButtons();
    for (SWTBotToolbarButton button : buttons) {
        if (button.getText().equals("Build Image")) {
            assertThat(!button.isEnabled());
        } else if (button.getText().equals("Pull...")) {
            assertThat(!button.isEnabled());
        }
    }
}
Also used : DockerConnection(org.eclipse.linuxtools.internal.docker.core.DockerConnection) DockerClient(com.spotify.docker.client.DockerClient) SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton) Test(org.junit.Test)

Example 8 with SWTBotToolbarButton

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

the class DockerComposeSWTBotTest method shouldStopDockerCompose.

@Test
@RunWithProject("foo")
public void shouldStopDockerCompose() throws CoreException {
    // given
    shouldStartDockerComposeFromScratch();
    // when
    final SWTBotToolbarButton consoleToolbarStopButton = SWTUtils.getConsoleToolbarButtonWithTooltipText(bot, ConsoleMessages.getString("DockerComposeStopAction.tooltip"));
    ToolbarButtonAssertions.assertThat(consoleToolbarStopButton).isEnabled();
    consoleToolbarStopButton.click();
    // then
    // verify the latch is down
    assertThat(latch.getCount()).isEqualTo(0);
    // verify the stop button is disabled
    ToolbarButtonAssertions.assertThat(consoleToolbarStopButton).isNotEnabled();
}
Also used : SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton) Test(org.junit.Test) RunWithProject(org.eclipse.linuxtools.internal.docker.ui.testutils.RunWithProject)

Example 9 with SWTBotToolbarButton

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton in project gfm_viewer by satyagraha.

the class MarkdownViewTest method shouldNotFollowEditorSelectedWhenNotLinked.

@Test
public void shouldNotFollowEditorSelectedWhenNotLinked() throws Exception {
    LOGGER.info("");
    assertThat(MarkdownViewBot.isPresent(), is(false));
    ProjectBot project = ProjectBot.createSimpleProject();
    project.newFile("file1.md");
    project.newFile("file2.md");
    MarkdownViewBot markdownViewBot = MarkdownViewBot.open();
    assertThat(MarkdownViewBot.isPresent(), is(true));
    SWTBotToolbarButton linkedButton = markdownViewBot.getLinkedButton();
    EditorBot editorBot1 = EditorBot.findByName("file1.md").show();
    SWTUtils.sleep(2000);
    assertThat(markdownViewBot.getTitle(), is("file1"));
    EditorBot editorBot2 = EditorBot.findByName("file2.md").show();
    SWTUtils.sleep(2000);
    assertThat(markdownViewBot.getTitle(), is("file2"));
    // set unlinked
    linkedButton.click();
    editorBot2.close();
    SWTUtils.sleep(2000);
    assertThat(markdownViewBot.getTitle(), is("file2"));
    editorBot1.close();
    SWTUtils.sleep(2000);
    assertThat(markdownViewBot.getTitle(), is("file2"));
    linkedButton.click();
    markdownViewBot.close();
    project.delete();
}
Also used : EditorBot(code.satyagraha.gfm.viewer.bots.EditorBot) ProjectBot(code.satyagraha.gfm.viewer.bots.ProjectBot) MarkdownViewBot(code.satyagraha.gfm.viewer.bots.MarkdownViewBot) SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton) Test(org.junit.Test)

Example 10 with SWTBotToolbarButton

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton in project gfm_viewer by satyagraha.

the class MarkdownViewBot method showPreferences.

public PreferencesBot showPreferences() {
    SWTBotToolbarButton toolbarButton = UtilityBot.getToolbarButtonWithTooltip(gfmView, "Preferences");
    toolbarButton.click();
    return PreferencesBot.fromActivatedPreferences();
}
Also used : SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton)

Aggregations

SWTBotToolbarButton (org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton)13 Test (org.junit.Test)8 DockerClient (com.spotify.docker.client.DockerClient)4 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)4 RunWithProject (org.eclipse.linuxtools.internal.docker.ui.testutils.RunWithProject)4 MarkdownViewBot (code.satyagraha.gfm.viewer.bots.MarkdownViewBot)3 ProjectBot (code.satyagraha.gfm.viewer.bots.ProjectBot)3 EditorBot (code.satyagraha.gfm.viewer.bots.EditorBot)2 ProjectFileBot (code.satyagraha.gfm.viewer.bots.ProjectBot.ProjectFileBot)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IsEditorLayoutHorizontal (net.heartsome.cat.ts.test.ui.waits.IsEditorLayoutHorizontal)1 IsEditorLayoutVertical (net.heartsome.cat.ts.test.ui.waits.IsEditorLayoutVertical)1 IFile (org.eclipse.core.resources.IFile)1 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)1 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)1 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 AfterClass (org.junit.AfterClass)1