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

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


    String menuLabel = util
        .getPluginLocalizedValue("replaceWithPreviousVersionAction.label");
    clickReplaceWith(menuLabel);
    bot.shell(UIText.DiscardChangesAction_confirmActionTitle).bot()
        .button(IDialogConstants.OK_LABEL).click();
    SWTBotShell selectDialog = bot
        .shell(UIText.CommitSelectDialog_WindowTitle);
    assertEquals(2, selectDialog.bot().table().rowCount());
    selectDialog.close();
    // we have closed, so nothing should have changed
    String contentAfterClose = getTestFileContent();
    assertEquals(contentAfterMerge, contentAfterClose);

    clickReplaceWith(menuLabel);
    bot.shell(UIText.DiscardChangesAction_confirmActionTitle).bot()
        .button(IDialogConstants.OK_LABEL).click();
    selectDialog = bot.shell(UIText.CommitSelectDialog_WindowTitle);
    // Select first parent, which should be the master commit
    SWTBotTable table = selectDialog.bot().table();
    assertEquals("Master commit", table.cell(0, 1));
    table.select(0);
    executeReplace(selectDialog);

    String replacedContent = getTestFileContent();
View Full Code Here


    fetch();

    String uri = lookupRepository(childRepositoryFile).getConfig()
        .getString(ConfigConstants.CONFIG_REMOTE_SECTION, "origin",
            ConfigConstants.CONFIG_KEY_URL);
    SWTBotShell confirm = bot.shell(NLS.bind(
        UIText.FetchResultDialog_title, uri));
    SWTBotTree tree = confirm.bot().tree();
    String branch = tree.getAllItems()[0].getText();
    assertTrue("Wrong result",
        branch.contains(initialCommitId.substring(0, 7)));

    confirm.close();

    String newContent = getTestFileContent();
    assertEquals(oldContent, newContent);

    fetch();
    confirm = bot.shell(NLS.bind(UIText.FetchResultDialog_title, uri));
    int count = confirm.bot().tree().rowCount();

    confirm.close();

    assertEquals("Wrong result count", 0, count);

    newContent = getTestFileContent();
    assertEquals(oldContent, newContent);

    SWTBotShell mergeDialog = openMergeDialog();

    SWTBotTreeItem remoteBranches = mergeDialog.bot().tree()
        .getTreeItem(REMOTE_BRANCHES).expand();
    TestUtil.getChildNode(remoteBranches, "origin/master").select();
    mergeDialog.bot().button(UIText.MergeTargetSelectionDialog_ButtonMerge)
        .click();
    bot.shell(UIText.MergeAction_MergeResultTitle).close();
    newContent = getTestFileContent();
    assertFalse(oldContent.equals(newContent));
  }
View Full Code Here

    ObjectId id = repo.resolve(repo.getFullBranch());
    return rw.parseCommit(id);
  }

  private void mergeBranch(String branchToMerge, boolean squash) throws Exception {
    SWTBotShell mergeDialog = openMergeDialog();
    SWTBotTreeItem localBranches = mergeDialog.bot().tree()
        .getTreeItem(LOCAL_BRANCHES).expand();
    TestUtil.getChildNode(localBranches, branchToMerge).select();
    if (squash)
      mergeDialog.bot().radio(UIText.MergeTargetSelectionDialog_MergeTypeSquashButton).click();
    mergeDialog.bot().button(UIText.MergeTargetSelectionDialog_ButtonMerge).click();
    bot.shell(UIText.MergeAction_MergeResultTitle).close();
  }
View Full Code Here

    mergeDialog.bot().button(UIText.MergeTargetSelectionDialog_ButtonMerge).click();
    bot.shell(UIText.MergeAction_MergeResultTitle).close();
  }

  private void createNewBranch(String newBranch, boolean checkout) {
    SWTBotShell newBranchDialog = openCreateBranchDialog();
    newBranchDialog.bot().textWithId("BranchName").setText(newBranch);
    if (!checkout)
      newBranchDialog.bot().checkBox(UIText.CreateBranchPage_CheckoutButton).deselect();
    newBranchDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
  }
View Full Code Here

      newBranchDialog.bot().checkBox(UIText.CreateBranchPage_CheckoutButton).deselect();
    newBranchDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
  }

  private void fetch() throws Exception {
    SWTBotShell fetchDialog = openFetchDialog();
    fetchDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
    JobJoiner jobJoiner = JobJoiner.startListening(JobFamilies.FETCH, 20, TimeUnit.SECONDS);
    fetchDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
    jobJoiner.join();
  }
View Full Code Here

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

    SystemReader.setInstance(null);
  }

  private static String createProject(String projectName) {
    bot.menu("File").menu("New").menu("Project...").click();
    SWTBotShell createProjectDialogShell = bot.shell("New Project");
    bot.tree().getTreeItem("General").expand().getNode("Project").select();
    bot.button("Next >").click();

    bot.textWithLabel("Project name:").setText(projectName);
View Full Code Here

    getProjectItem(projectExplorerTree, PROJ1).select();
    String menuString = util.getPluginLocalizedValue("MergeAction_label");
    ContextMenuHelper.clickContextMenu(projectExplorerTree, "Team",
        menuString);
    Repository repo = lookupRepository(childRepositoryFile);
    SWTBotShell dialog = bot.shell(NLS.bind(
        UIText.MergeTargetSelectionDialog_TitleMergeWithBranch,
        repo.getBranch()));
    return dialog;
  }
View Full Code Here

    String location2 = createProject(projectName2);
    createProject(projectName3);

    ExistingOrNewPage existingOrNewPage = sharingWizard.openWizard(
        projectName1, projectName2);
    SWTBotShell createRepoDialog = existingOrNewPage
        .clickCreateRepository();
    String repoDir = Activator.getDefault().getPreferenceStore()
        .getString(UIPreferences.DEFAULT_REPO_DIR);
    File repoFolder = new File(repoDir, repoName);
    createRepoDialog.bot()
        .textWithLabel(UIText.CreateRepositoryPage_DirectoryLabel)
        .setText(repoFolder.getAbsolutePath());
    createRepoDialog.bot().button(IDialogConstants.FINISH_LABEL).click();

    SWTBotCombo combo = bot
        .comboBoxWithLabel(UIText.ExistingOrNewPage_ExistingRepositoryLabel);
    assertTrue(combo.getText().startsWith(repoName));
    Repository targetRepo = lookupRepository(new File(repoFolder,
View Full Code Here

    String[] menuPath = new String[] {
        util.getPluginLocalizedValue("TeamMenu.label"),
        util.getPluginLocalizedValue("SwitchToMenu.label"),
        UIText.SwitchToMenu_NewBranchMenuLabel };
    ContextMenuHelper.clickContextMenu(projectExplorerTree, menuPath);
    SWTBotShell dialog = bot
        .shell(UIText.CreateBranchWizard_NewBranchTitle);
    return dialog;
  }
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.