Java Code Examples for org.eclipse.swtbot.swt.finder.SWTBot#activeShell()

The following examples show how to use org.eclipse.swtbot.swt.finder.SWTBot#activeShell() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SWTBotTestUtil.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * add data with option wizard configuration (only for defined types as String Integer Boolean etc.)
 *
 * @param bot
 * @param name
 * @param type
 * @param multiplicity
 * @param defaultValue
 */
public static void addListOfOptionData(final SWTBot bot, final String name, final String type,
        final Map<String, List<String>> options,
        final boolean isMultiple, final String defaultValue) {
    bot.waitUntil(Conditions.shellIsActive("New variable"));
    bot.textWithLabel(org.bonitasoft.studio.properties.i18n.Messages.name + " *").setText(name);
    bot.comboBoxWithLabel(org.bonitasoft.studio.properties.i18n.Messages.datatypeLabel).setSelection(type);
    SWTBotShell activeShell = bot.activeShell();
    bot.button("List of options...").click();
    bot.waitUntil(Conditions.shellIsActive("List of options"));
    int i = 0;
    for (final String optionsName : options.keySet()) {
        bot.button("Add", 0).click();
        bot.table(0).click(i, 0);
        bot.text().setText(optionsName);
        int j = 0;
        for (final String option : options.get(optionsName)) {
            bot.button("Add", 1).click();
            bot.table(1).click(j, 0);
            bot.text().setText(option);
            j++;
        }
        i++;
    }
    bot.button(IDialogConstants.OK_LABEL).click();
    activeShell.setFocus();
    if (isMultiple) {
        bot.checkBox("Is multiple").select();
    }
    if (defaultValue != null) {
        bot.textWithLabel(org.bonitasoft.studio.properties.i18n.Messages.defaultValueLabel).setText(defaultValue);
        bot.sleep(1000);
    }
    bot.button(IDialogConstants.FINISH_LABEL).click();
}
 
Example 2
Source File: SWTBotConnectorTestUtil.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * use it when the wizard "New definition" is active. (menu
 * development>connectors>New definition...)
 * 
 * @param bot
 * @param categoryId
 * @throws Exception
 */
public static void createNewCategory(SWTBot bot, String categoryId) {
    bot.waitUntil(Conditions.widgetIsEnabled((bot.button("New..."))), 10000);
    SWTBotShell activeShell = bot.activeShell();
    bot.button("New...").click();
    bot.waitUntil(Conditions.widgetIsEnabled(bot.activeShell()));
    Assert.assertFalse("ok button should be desabled",
            bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.textWithLabel("Id").setText(categoryId);
    bot.textWithLabel("Display name").setText(categoryId);
    bot.button(IDialogConstants.OK_LABEL).click();
    activeShell.setFocus();
}
 
Example 3
Source File: SWTBotActorFilterUtil.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * use it when the wizard "New definition" is active. (menu
 * development>Actors filters>New definition...)
 *
 * @param bot
 * @param categoryId
 * @throws Exception
 */
public static void createNewCategory(final SWTBot bot, final String categoryId)
        throws Exception {
    bot.waitUntil(Conditions.widgetIsEnabled(bot.button("New...")), 10000);
    SWTBotShell activeShell = bot.activeShell();
    bot.button("New...").click();
    Assert.assertFalse("ok button should be desabled",
            bot.button(IDialogConstants.OK_LABEL).isEnabled());
    bot.textWithLabel("Id").setText(categoryId);
    bot.textWithLabel("Display name").setText(categoryId);
    bot.button(IDialogConstants.OK_LABEL).click();
    activeShell.setFocus();
}
 
Example 4
Source File: SwtBotTestingUtilities.java    From google-cloud-eclipse with Apache License 2.0 4 votes vote down vote up
/**
 * Simple wrapper to block for actions that either open or close a window.
 */
public static void performAndWaitForWindowChange(SWTBot bot, Runnable runnable) {
  SWTBotShell shell = bot.activeShell();
  runnable.run();
  waitUntilShellIsNotActive(bot, shell);
}
 
Example 5
Source File: SwtBotTestingUtilities.java    From google-cloud-eclipse with Apache License 2.0 4 votes vote down vote up
/**
 * Simple wrapper to block for actions that close a window.
 */
public static void performAndWaitForWindowClose(SWTBot bot, Runnable runnable) {
  SWTBotShell shell = bot.activeShell();
  runnable.run();
  waitUntilShellIsClosed(bot, shell);
}
 
Example 6
Source File: SwtBotUtils.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Simple wrapper to block for actions that either open or close a window.
 */
public static void performAndWaitForWindowChange(SWTBot bot, Runnable runnable) {
  SWTBotShell shell = bot.activeShell();
  runnable.run();
  waitUntilShellIsNotActive(bot, shell);
}