Search in sources :

Example 11 with SWTBotView

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

the class CommitNonWSChangesTest method clickOnCommit.

private void clickOnCommit() throws Exception {
    SWTBotView repoView = TestUtil.showView(RepositoriesView.VIEW_ID);
    TestUtil.joinJobs(JobFamilies.REPO_VIEW_REFRESH);
    SWTBotTree tree = repoView.bot().tree();
    TestUtil.waitUntilTreeHasNodeContainsText(bot, tree, REPO1, 10000);
    tree.getAllItems()[0].contextMenu("Commit...").click();
}
Also used : SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)

Example 12 with SWTBotView

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

the class SynchronizeViewPushTest method shouldUpdateTrackingBranchOnPush.

@Test
public void shouldUpdateTrackingBranchOnPush() throws Exception {
    makeChangesAndCommit(PROJ1);
    Repository repository = lookupRepository(repositoryFile);
    ObjectId headId = repository.resolve(Constants.HEAD);
    String trackingBranch = Constants.R_REMOTES + "origin/master";
    launchSynchronization(Constants.HEAD, trackingBranch, false);
    SWTBotView viewBot = bot.viewById(ISynchronizeView.VIEW_ID);
    SWTBotToolbarButton pushButton = viewBot.toolbarButton(UIText.GitActionContributor_Push);
    JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.PUSH, 30, TimeUnit.SECONDS);
    pushButton.click();
    TestUtil.openJobResultDialog(jobJoiner.join());
    String destinationString = repositoryFile.getParentFile().getName() + " - " + "origin";
    SWTBotShell resultDialog = bot.shell(NLS.bind(UIText.PushResultDialog_title, destinationString));
    resultDialog.close();
    Repository remoteRepository = lookupRepository(childRepositoryFile);
    ObjectId masterOnRemote = remoteRepository.resolve("master");
    assertThat("Expected push to update branch on remote repository", masterOnRemote, is(headId));
    ObjectId trackingId = repository.resolve(trackingBranch);
    assertThat("Expected tracking branch to be updated", trackingId, is(headId));
}
Also used : Repository(org.eclipse.jgit.lib.Repository) ObjectId(org.eclipse.jgit.lib.ObjectId) JobJoiner(org.eclipse.egit.ui.test.JobJoiner) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) SWTBotToolbarButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton) Test(org.junit.Test)

Example 13 with SWTBotView

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

the class ShowInTest method testOpenHistory.

@Test
public void testOpenHistory() throws Exception {
    try {
        SWTBotView view = bot.viewById(IHistoryView.VIEW_ID);
        view.close();
    } catch (Exception e) {
    // ignore
    }
    SWTBotTree projectExplorerTree = TestUtil.getExplorerTree();
    getProjectItem(projectExplorerTree, PROJ1).select();
    String menuString = util.getPluginLocalizedValue("ShowResourceInHistoryAction_label");
    ContextMenuHelper.clickContextMenuSync(projectExplorerTree, "Team", menuString);
    bot.viewById(IHistoryView.VIEW_ID).close();
}
Also used : SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) Test(org.junit.Test)

Example 14 with SWTBotView

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

the class DynamicVariablesTest method assertVariable.

private void assertVariable(String expected, String variableName, String argument) throws CoreException {
    IResource findMember = project.findMember(TEST_FILE);
    SWTBotView explorerView = TestUtil.showExplorerView();
    final ISelectionProvider selectionProvider = explorerView.getViewReference().getView(true).getSite().getSelectionProvider();
    final StructuredSelection structuredSelection = new StructuredSelection(findMember);
    PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {

        @Override
        public void run() {
            selectionProvider.setSelection(structuredSelection);
        }
    });
    IDynamicVariable dynamicVariable = VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable(variableName);
    String value = dynamicVariable.getValue(argument);
    assertEquals(expected, value);
}
Also used : ISelectionProvider(org.eclipse.jface.viewers.ISelectionProvider) IDynamicVariable(org.eclipse.core.variables.IDynamicVariable) SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IResource(org.eclipse.core.resources.IResource)

Example 15 with SWTBotView

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

the class HistoryViewTest method toggleShowAllBranchesButton.

private void toggleShowAllBranchesButton(boolean checked) throws Exception {
    getHistoryViewTable(PROJ1);
    SWTBotView view = bot.viewById(IHistoryView.VIEW_ID);
    SWTBotToolbarToggleButton showAllBranches = (SWTBotToolbarToggleButton) view.toolbarButton(UIText.GitHistoryPage_showAllBranches);
    boolean isChecked = showAllBranches.isChecked();
    if (isChecked && !checked || !isChecked && checked)
        showAllBranches.click();
}
Also used : SWTBotView(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView) SWTBotToolbarToggleButton(org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton)

Aggregations

SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)41 SWTBotTree (org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)14 Test (org.junit.Test)12 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)10 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)7 Repository (org.eclipse.jgit.lib.Repository)3 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)3 Git (org.eclipse.jgit.api.Git)2 Composite (org.eclipse.swt.widgets.Composite)2 Tree (org.eclipse.swt.widgets.Tree)2 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)2 SWTBotStyledText (org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText)2 SWTBotToolbarToggleButton (org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarToggleButton)2 DockerClient (com.spotify.docker.client.DockerClient)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 IResource (org.eclipse.core.resources.IResource)1 CoreException (org.eclipse.core.runtime.CoreException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IDynamicVariable (org.eclipse.core.variables.IDynamicVariable)1 GitScopeOperation (org.eclipse.egit.ui.internal.operations.GitScopeOperation)1