Search in sources :

Example 1 with SWTBotLink

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotLink in project epp.mpc by eclipse.

the class AbstractMarketplaceWizardBotTest method selectToInstall.

protected SWTBotLink selectToInstall(int count) {
    if (count == 0) {
        return null;
    }
    bot.button("Install").click();
    waitForWizardProgress(3 * PROGRESS_TIMEOUT);
    assertSame(getWizard().getPage(FeatureSelectionWizardPage.class.getName()), getWizardDialog().getCurrentPage());
    bot.button("< Install More").click();
    waitForWizardProgress();
    SWTBotLink selectedSolutionsLink = selectedSolutionsLink(1);
    for (int i = 2; i <= count; i++) {
        bot.button("Install").click();
        selectedSolutionsLink = selectedSolutionsLink(i);
    }
    return selectedSolutionsLink;
}
Also used : SWTBotLink(org.eclipse.swtbot.swt.finder.widgets.SWTBotLink)

Example 2 with SWTBotLink

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotLink 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)

Example 3 with SWTBotLink

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotLink in project epp.mpc by eclipse.

the class MarketplaceWizardTest method testShowSelected.

@Test
public void testShowSelected() {
    SWTBotLink link = selectToInstall(3);
    checkSkipForGtk3();
    link.click();
    // wait for the action to be processed
    bot.waitUntil(new DefaultCondition() {

        public boolean test() throws Exception {
            List<Widget> items = this.bot.getFinder().findControls(NodeMatcher.any());
            return items.size() == 3;
        }

        public String getFailureMessage() {
            return "Not getting expected selection";
        }
    }, 10000);
}
Also used : SWTBotLink(org.eclipse.swtbot.swt.finder.widgets.SWTBotLink) DefaultCondition(org.eclipse.swtbot.swt.finder.waits.DefaultCondition) List(java.util.List) Test(org.junit.Test)

Aggregations

SWTBotLink (org.eclipse.swtbot.swt.finder.widgets.SWTBotLink)3 Test (org.junit.Test)2 List (java.util.List)1 SWTBotClickableStyledText (org.eclipse.epp.mpc.tests.ui.wizard.widgets.SWTBotClickableStyledText)1 StyleRange (org.eclipse.swt.custom.StyleRange)1 DefaultCondition (org.eclipse.swtbot.swt.finder.waits.DefaultCondition)1 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)1 Ignore (org.junit.Ignore)1