Search in sources :

Example 96 with SWTBotShell

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

the class MarketplaceWizardTest method testFavorite.

@Test
public void testFavorite() {
    SWTBotButton favorite = bot.buttonWithId(AbstractMarketplaceDiscoveryItem.WIDGET_ID_KEY, DiscoveryItem.WIDGET_ID_RATING);
    bot.sleep(5000);
    favorite.click();
    SWTBotShell login = bot.shell("Authorizing with Eclipse.org");
    login.bot().button("Cancel").click();
// TODO test something useful - we'd need a proper login on the server to do this...
// better to get started with some server mocking in the ui tests...
}
Also used : SWTBotButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotButton) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) Test(org.junit.Test)

Example 97 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project dsl-devkit by dsldevkit.

the class CheckProjectWizardTest method testNextButtonChangesPage.

/**
 * Tests that applying the next button changes the wizard page.
 */
@Test
@BugTest("AIG-479")
public void testNextButtonChangesPage() {
    wizard.writeToTextField(Messages.PROJECT_NAME_LABEL, "a.b");
    SWTBotShell projectPage = wizard.shell(Messages.PROJECT_WIZARD_WINDOW_TITLE);
    wizard.changeToNextPage();
    SWTBotShell catalogPage = wizard.shell(Messages.PROJECT_WIZARD_WINDOW_TITLE);
    assertNotSame("Next button changed page", projectPage, catalogPage);
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) BugTest(com.avaloq.tools.ddk.test.core.BugTest) BugTest(com.avaloq.tools.ddk.test.core.BugTest) Test(org.junit.Test)

Example 98 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project dsl-devkit by dsldevkit.

the class CoreSwtbotTools method openAvaloqPreferencesSection.

/**
 * Open a specific Avaloq Prefrences Page.
 *
 * @param bot
 *          to work with, must not be {@code null}
 * @param section
 *          the name of the desired page (e.g. 'Database'), must not be {@code null}
 */
public static void openAvaloqPreferencesSection(final SWTWorkbenchBot bot, final String section) {
    Assert.isNotNull(bot, ARGUMENT_BOT);
    Assert.isNotNull(section, "section");
    bot.menu("Window").menu("Preferences").click();
    final SWTBotShell shell = bot.shell("Preferences");
    shell.activate();
    final SWTBotTreeItem item = bot.tree().getTreeItem("Avaloq");
    CoreSwtbotTools.waitForItem(bot, item);
    CoreSwtbotTools.expandNode(bot.tree(), "Avaloq").select(section);
}
Also used : SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 99 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project syncope by apache.

the class SyncopeViewTest method canAddReportTemplate.

private boolean canAddReportTemplate() {
    SWTBotTreeItem rTemplateHead = syncopeView.bot().tree().getTreeItem("Report Templates");
    rTemplateHead.setFocus();
    rTemplateHead.select().contextMenu("Add Template").click();
    BOT.sleep(1000);
    // Filling Dialog details
    SWTBotShell addTemplateShell = BOT.activeShell();
    addTemplateShell.activate();
    BOT.textWithLabel("Key").setText("newReportTemplate");
    BOT.button("Add").click();
    // wait for template keys reload
    BOT.waitWhile(new ICondition() {

        @Override
        public boolean test() throws Exception {
            String title = BOT.activeShell().getText();
            return title.equals("Loading Templates");
        }

        @Override
        public void init(final SWTBot bot) {
        }

        @Override
        public String getFailureMessage() {
            return "Unable to Login";
        }
    });
    // recheck available templates
    syncopeView = BOT.viewByTitle("Apache Syncope Templates");
    rTemplateItem = syncopeView.bot().tree().expandNode("Report Templates");
    rtemplateList = rTemplateItem.getItems();
    return (rtemplateList.length == 3 && rtemplateList[1].getText().equals("newReportTemplate"));
}
Also used : SWTBot(org.eclipse.swtbot.swt.finder.SWTBot) SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) ICondition(org.eclipse.swtbot.swt.finder.waits.ICondition)

Example 100 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project syncope by apache.

the class SyncopeViewTest method canLoginAdmin.

@Test
public void canLoginAdmin() throws Exception {
    SWTBotShell loginShell = BOT.activeShell();
    loginShell.activate();
    BOT.textWithLabel("Deployment Url").setText(ADDRESS);
    BOT.textWithLabel("Username").setText(ADMIN_UNAME);
    BOT.textWithLabel("Password").setText(ADMIN_PWD);
    BOT.button("Login").click();
    BOT.waitWhile(new ICondition() {

        @Override
        public boolean test() throws Exception {
            String title = BOT.activeShell().getText();
            return title.equals("Loading Templates");
        }

        @Override
        public void init(final SWTBot bot) {
        }

        @Override
        public String getFailureMessage() {
            return "Unable to Login";
        }
    });
}
Also used : SWTBot(org.eclipse.swtbot.swt.finder.SWTBot) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) ICondition(org.eclipse.swtbot.swt.finder.waits.ICondition) Test(org.junit.jupiter.api.Test)

Aggregations

SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)158 Test (org.junit.Test)82 SWTBotTree (org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)46 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)40 Repository (org.eclipse.jgit.lib.Repository)18 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)11 SWTBotTable (org.eclipse.swtbot.swt.finder.widgets.SWTBotTable)11 File (java.io.File)10 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)9 SWTBotText (org.eclipse.swtbot.swt.finder.widgets.SWTBotText)9 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)7 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)7 SWTBotCombo (org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo)7 Path (org.eclipse.core.runtime.Path)6 JobJoiner (org.eclipse.egit.ui.test.JobJoiner)6 Shell (org.eclipse.swt.widgets.Shell)6 SWTBotButton (org.eclipse.swtbot.swt.finder.widgets.SWTBotButton)6 IProject (org.eclipse.core.resources.IProject)5 SWTBotEclipseEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor)5 ICondition (org.eclipse.swtbot.swt.finder.waits.ICondition)5