Search in sources :

Example 61 with SWTBotShell

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

the class GlobalConfigurationPageTest method testCanCreateSameEntryValue.

@Test
public void testCanCreateSameEntryValue() throws Exception {
    config.setString(TESTSECTION, null, TESTNAME, "already");
    config.save();
    getGitConfigurationPreferencePage();
    preferencePage.bot().button(UIText.ConfigurationEditorComponent_AddButton).click();
    SWTBotShell addDialog = bot.shell(UIText.AddConfigEntryDialog_AddConfigTitle);
    addDialog.activate();
    addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_KeyLabel).setText(TESTSECTION + "." + TESTNAME);
    addDialog.bot().textWithLabel(UIText.AddConfigEntryDialog_ValueLabel).setText("true");
    assertTrue(addDialog.bot().button(IDialogConstants.OK_LABEL).isEnabled());
    addDialog.close();
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) Test(org.junit.Test)

Example 62 with SWTBotShell

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

the class GlobalConfigurationPageTest method afterTest.

@AfterClass
public static void afterTest() throws Exception {
    configFile.delete();
    SystemReader.setInstance(null);
    // reset saved preferences state
    SWTBotShell preferencePage = new Eclipse().openPreferencePage(null);
    preferencePage.bot().tree(0).getTreeItem("General").select();
    preferencePage.bot().button(IDialogConstants.OK_LABEL).click();
    TestUtil.processUIEvents();
}
Also used : Eclipse(org.eclipse.egit.ui.test.Eclipse) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) AfterClass(org.junit.AfterClass)

Example 63 with SWTBotShell

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

the class SmartImportWizardTest method setBotAndAtivateShell.

@Before
public void setBotAndAtivateShell() {
    SWTBotShell[] shells = bot.shells();
    for (SWTBotShell shell : shells) {
        if (isEclipseShell(shell)) {
            shell.activate();
            return;
        }
    }
    fail("No active Eclipse shell found!");
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) Before(org.junit.Before)

Example 64 with SWTBotShell

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

the class EGitTestCase method activateShell.

@Before
public void activateShell() {
    SWTBotShell[] shells = bot.shells();
    for (SWTBotShell shell : shells) {
        if (Eclipse.isEclipseShell(shell)) {
            shell.activate();
            return;
        }
    }
    fail("No active Eclipse shell found!");
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) Before(org.junit.Before)

Example 65 with SWTBotShell

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

the class LocalRepositoryTestCase method assertClickOpens.

protected void assertClickOpens(SWTBotTree tree, String menu, String window) {
    ContextMenuHelper.clickContextMenu(tree, menu);
    SWTBotShell shell = bot.shell(window);
    shell.activate();
    shell.bot().button(IDialogConstants.CANCEL_LABEL).click();
    shell.close();
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

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