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));
}
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());
}
}
}
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();
}
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();
}
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();
}
Aggregations