Package org.eclipse.swtbot.swt.finder.widgets

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell


    Repository repo = lookupRepository(remoteRepositoryFile);
    RevWalk rw = new RevWalk(repo);
    String previous = rw.parseCommit(repo.resolve("HEAD")).name();

    touchAndSubmit(null);
    SWTBotShell pushDialog = openPushDialog();

    SWTBotCombo destinationCombo = pushDialog.bot().comboBox();
    String[] items = destinationCombo.items();
    for (int i = 0; i < items.length; i++) {
      if (items[i].startsWith(destination))
        destinationCombo.setSelection(i);
    }

    pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
    if (withConfirmPage)
      pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
    pushDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
    SWTBotShell confirm = bot.shell(NLS.bind(UIText.PushResultDialog_title,
        destination));
    String result = confirm.bot().tree().getAllItems()[0].getText();

    assertTrue("Wrong result", result.contains(previous.substring(0, 7)));

    confirm.close();

    pushDialog = openPushDialog();

    destinationCombo = pushDialog.bot().comboBox();
    for (int i = 0; i < items.length; i++) {
      if (items[i].startsWith(destination))
        destinationCombo.setSelection(i);
    }

    pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
    if (withConfirmPage)
      pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
    pushDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
    confirm = bot.shell(NLS.bind(UIText.PushResultDialog_title, destination));
    result = confirm.bot().tree().getAllItems()[0].getText();

    confirm.close();

    assertTrue("Wrong result",
        result.contains(UIText.PushResultTable_statusUpToDate));
  }
View Full Code Here


    String menuString = util.getPluginLocalizedValue("PushAction_label");
    String submenuString = util
        .getPluginLocalizedValue("RemoteSubMenu.label");
    ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team",
        submenuString, menuString);
    SWTBotShell dialog = bot.shell(UIText.PushWizard_windowTitleDefault);
    return dialog;
  }
View Full Code Here

    ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
        IResource.DEPTH_INFINITE, null);
    waitInUI();
    mapping = RepositoryMapping.getMapping(project);
    assertNull(mapping);
    SWTBotShell connectDialog = openConnectDialog();
    // test the "share with repository in parent folder" scenario
    connectDialog.bot()
        .checkBox(UIText.ExistingOrNewPage_InternalModeCheckbox)
        .select();
    connectDialog.bot().tree().getAllItems()[0].select();
    connectDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
    ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
        IResource.DEPTH_INFINITE, null);
    waitInUI();
    mapping = RepositoryMapping.getMapping(project);
    assertNotNull(mapping);
View Full Code Here

  @Test
  public void testCompareWithCommit() throws Exception {
    String compareWithCommitMenuText = util
        .getPluginLocalizedValue("CompareWithCommitAction.label");
    String dialogTitle = UIText.CommitSelectionDialog_WindowTitle;
    SWTBotShell dialog = openCompareWithDialog(compareWithCommitMenuText,
        dialogTitle);
    // use the default (the last commit) -> no changes
    assertEquals(3, dialog.bot().table().rowCount());
    dialog.bot().table().select(0);

    JobJoiner jobJoiner = JobJoiner.startListening(
        ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60,
        TimeUnit.SECONDS);
    dialog.bot().button(IDialogConstants.OK_LABEL).click();
    jobJoiner.join();

    closeFirstEmptySynchronizeDialog();

    assertSynchronizeNoChange();

    // use the second (previous) -> should have a change
    dialog = openCompareWithDialog(compareWithCommitMenuText, dialogTitle);
    dialog.bot().table().select(1);

    jobJoiner = JobJoiner.startListening(
        ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60,
        TimeUnit.SECONDS);
    dialog.bot().button(IDialogConstants.OK_LABEL).click();
    jobJoiner.join();

    assertSynchronizeFile1Changed();
  }
View Full Code Here

  @Test
  public void testCompareWithRef() throws Exception {
    String compareWithRefActionLabel = util
        .getPluginLocalizedValue("CompareWithBranchOrTagAction.label");
    String dialogTitle = UIText.CompareTargetSelectionDialog_WindowTitle;
    SWTBotShell dialog = openCompareWithDialog(compareWithRefActionLabel,
        dialogTitle);

    // use the default (the last commit) -> no changes
    JobJoiner jobJoiner = JobJoiner.startListening(
        ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60,
        TimeUnit.SECONDS);
    dialog.bot().button(UIText.CompareTargetSelectionDialog_CompareButton)
        .click();
    jobJoiner.join();

    closeFirstEmptySynchronizeDialog();

    assertSynchronizeNoChange();

    // use the tag -> should have a change
    dialog = openCompareWithDialog(compareWithRefActionLabel, dialogTitle);
    SWTBotTreeItem tags = dialog.bot().tree().getTreeItem(TAGS).expand();
    TestUtil.getChildNode(tags, "SomeTag").select();

    jobJoiner = JobJoiner.startListening(
        ISynchronizeManager.FAMILY_SYNCHRONIZE_OPERATION, 60,
        TimeUnit.SECONDS);
    dialog.bot().button(UIText.CompareTargetSelectionDialog_CompareButton)
        .click();
    jobJoiner.join();

    assertSynchronizeFile1Changed();
  }
View Full Code Here

    bis.close();
    git.commit().setAll(true).setMessage("To be merged").call();
    git.merge().include(masterId).call();
    String menuLabel = util
        .getPluginLocalizedValue("CompareWithPreviousAction.label");
    SWTBotShell selectDialog = openCompareWithDialog(menuLabel, UIText.CommitSelectDialog_WindowTitle);
    assertEquals(2, selectDialog.bot().table().rowCount());
    selectDialog.close();
    // cleanup: checkout again master and delete merged branch
    git.checkout().setName("refs/heads/master").call();
    git.branchDelete().setBranchNames(newBranch.getName()).setForce(true).call();
  }
View Full Code Here

  private SWTBotShell openCompareWithDialog(String menuLabel,
      String dialogTitle) {
    SWTBotTree projectExplorerTree = selectProjectItem();
    ContextMenuHelper.clickContextMenu(projectExplorerTree, "Compare With",
        menuLabel);
    SWTBotShell dialog = bot.shell(dialogTitle);
    return dialog;
  }
View Full Code Here

   */
  private void closeFirstEmptySynchronizeDialog() {
    // Do not use bot.shell(String) : we don't want to fail if not present.
    SWTBotShell[] shells = bot.shells();
    for (int i = 0; i < shells.length; i++) {
      SWTBotShell shell = shells[i];
      if ("Synchronize Complete - Git".equals(shell.getText()))
        shell.close();
    }
  }
View Full Code Here

    assertEquals(EXPECTED_WORKSPACE_PATCH_CONTENT, patchContent);
  }

  private CreatePatchWizard openCreatePatchWizard() throws Exception {
    CreatePatchWizard.openWizard(PROJ1, PROJ2);
    SWTBotShell shell = bot
        .shell(UIText.GitCreatePatchWizard_CreatePatchTitle);
    return new CreatePatchWizard(shell);
  }
View Full Code Here

    touchAndSubmit(null);
    String initialContent = getTestFileContent();
    String menuLabel = util
        .getPluginLocalizedValue("replaceWithPreviousVersionAction.label");
    clickReplaceWith(menuLabel);
    SWTBotShell confirm = bot
        .shell(UIText.DiscardChangesAction_confirmActionTitle);
    executeReplace(confirm);
    String replacedContent = getTestFileContent();
    assertThat(replacedContent, not(initialContent));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.