Search in sources :

Example 1 with SWTBotClickableStyledText

use of org.eclipse.epp.mpc.tests.ui.wizard.widgets.SWTBotClickableStyledText in project epp.mpc by eclipse.

the class MarketplaceWizardTest method testNoninstallableLearnMore.

@Test
public void testNoninstallableLearnMore() {
    SWTBot assumeLearnMoreBot = assume(bot);
    SWTBotClickableStyledText learnMoreLabel = SWTBotClickableStyledText.from(assumeLearnMoreBot.styledTextWithId(AbstractMarketplaceDiscoveryItem.WIDGET_ID_KEY, DiscoveryItem.WIDGET_ID_LEARNMORE));
    StyleRange linkRange = findLink(learnMoreLabel);
    learnMoreLabel.click(linkRange);
    checkMarketplaceBrowser();
}
Also used : SWTBot(org.eclipse.swtbot.swt.finder.SWTBot) StyleRange(org.eclipse.swt.custom.StyleRange) SWTBotClickableStyledText(org.eclipse.epp.mpc.tests.ui.wizard.widgets.SWTBotClickableStyledText) Test(org.junit.Test)

Example 2 with SWTBotClickableStyledText

use of org.eclipse.epp.mpc.tests.ui.wizard.widgets.SWTBotClickableStyledText in project epp.mpc by eclipse.

the class MarketplaceWizardTest method testSearchTag.

@Test
public void testSearchTag() {
    Matcher<StyledText> widgetOfType = widgetOfType(StyledText.class);
    Matcher<StyledText> withId = withId(AbstractMarketplaceDiscoveryItem.WIDGET_ID_KEY, DiscoveryItem.WIDGET_ID_TAGS);
    Matcher<StyledText> emptyText = withText("");
    @SuppressWarnings("unchecked") Matcher<StyledText> nonEmptyTagMatcher = allOf(widgetOfType, withId, not(emptyText));
    SWTBotClickableStyledText tagsLabel = SWTBotClickableStyledText.from(new SWTBotStyledText(bot.widget(nonEmptyTagMatcher, 0), nonEmptyTagMatcher));
    StyleRange linkRange = findLink(tagsLabel);
    String tag = getText(linkRange, tagsLabel);
    tagsLabel.click(linkRange);
    waitForWizardProgress();
    String searchTerm = searchField().getText();
    assertEquals(MarketplaceViewer.QUERY_TAG_KEYWORD + tag, searchTerm);
}
Also used : SWTBotStyledText(org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText) StyledText(org.eclipse.swt.custom.StyledText) SWTBotClickableStyledText(org.eclipse.epp.mpc.tests.ui.wizard.widgets.SWTBotClickableStyledText) SWTBotStyledText(org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText) StyleRange(org.eclipse.swt.custom.StyleRange) SWTBotClickableStyledText(org.eclipse.epp.mpc.tests.ui.wizard.widgets.SWTBotClickableStyledText) Test(org.junit.Test)

Example 3 with SWTBotClickableStyledText

use of org.eclipse.epp.mpc.tests.ui.wizard.widgets.SWTBotClickableStyledText in project epp.mpc by eclipse.

the class MarketplaceWizardTest method testMoreInfoLearnMore.

// TODO conditional on embedded browser availability
// FIXME
@Ignore("Tooltip doesn't stay open")
@Test
public void testMoreInfoLearnMore() {
    SWTBotClickableStyledText descriptionLabel = SWTBotClickableStyledText.from(bot.styledTextWithId(AbstractMarketplaceDiscoveryItem.WIDGET_ID_KEY, AbstractMarketplaceDiscoveryItem.WIDGET_ID_DESCRIPTION));
    StyleRange linkRange = findLink(descriptionLabel, "more\u00a0info");
    bot.sleep(5000);
    descriptionLabel.click(linkRange);
    bot.sleep(5000);
    SWTBotShell tooltip = bot.shellWithId(AbstractMarketplaceDiscoveryItem.WIDGET_ID_KEY, DiscoveryItem.WIDGET_ID_OVERVIEW);
    SWTBotLink moreLink = tooltip.bot().linkWithId(AbstractMarketplaceDiscoveryItem.WIDGET_ID_KEY, DiscoveryItem.WIDGET_ID_LEARNMORE);
    moreLink.click();
    checkMarketplaceBrowser();
}
Also used : SWTBotLink(org.eclipse.swtbot.swt.finder.widgets.SWTBotLink) StyleRange(org.eclipse.swt.custom.StyleRange) SWTBotClickableStyledText(org.eclipse.epp.mpc.tests.ui.wizard.widgets.SWTBotClickableStyledText) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

SWTBotClickableStyledText (org.eclipse.epp.mpc.tests.ui.wizard.widgets.SWTBotClickableStyledText)3 StyleRange (org.eclipse.swt.custom.StyleRange)3 Test (org.junit.Test)3 StyledText (org.eclipse.swt.custom.StyledText)1 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)1 SWTBotLink (org.eclipse.swtbot.swt.finder.widgets.SWTBotLink)1 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)1 SWTBotStyledText (org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText)1 Ignore (org.junit.Ignore)1