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

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


    }

    public static ProjectBot createSimpleProject() {
        String projectName = "Project_" + System.currentTimeMillis();
        bot.menu("File").menu("New").menu("Project...").click();
        SWTBotShell shell = bot.shell("New Project");
        shell.activate();
        bot.tree().expandNode("General").select("Project");
        bot.button("Next >").click();
        bot.textWithLabel("Project name:").setText(projectName);
        bot.button("Finish").click();
        SWTUtils.sleep(2000);
View Full Code Here


    }
   
    public ProjectFileBot newFile(String fileName) {
        projectTree.setFocus();
        projectTree.contextMenu("New").menu("File").click();
        SWTBotShell shell = bot.shell("New File");
        shell.activate();
        bot.textWithLabel("File name:").setText(fileName);
        bot.button("Finish").click();
        SWTUtils.sleep(2000);
        SWTBotTreeItem treeItem = projectTree.getNode(fileName);
        return new ProjectFileBot(treeItem);
View Full Code Here

   
    public void delete() {
        projectTree.contextMenu("Refresh").click();
        SWTUtils.sleep(2000);
        projectTree.contextMenu("Delete").click();
        SWTBotShell shell = bot.shell("Delete Resources");
        shell.activate();
        shell.pressShortcut(SWT.ALT, 'D');
        bot.button("OK").click();
        projectTree = null;
    }
View Full Code Here

        return !getGfmViews().isEmpty();
    }
   
    public static MarkdownViewBot open() {
        bot.menu("Window").menu("Show View").menu("Other...").click();
        SWTBotShell shell = bot.shell("Show View");
        shell.activate();
        bot.tree().expandNode("GFM Support").select("GFM View");
        bot.button("OK").click();
        return findById();
    }
View Full Code Here

    }
    return ret;
  }
 
  public static SWTBotShell activateShell(SWTWorkbenchBot bot, String shell) {
    SWTBotShell s = bot.shell(shell);
    s.activate();
    return s;
  }
View Full Code Here

    assertHasRepo(repositoryFile);
    SWTBotTree tree = getOrOpenView().bot().tree();
    tree.getAllItems()[0].select();
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue(DELETE_REPOSITORY_CONTEXT_MENU_LABEL));
    SWTBotShell shell = bot.shell(UIText.DeleteRepositoryConfirmDialog_DeleteRepositoryWindowTitle);
    shell.activate();
    shell.bot()
        .checkBox(
            UIText.DeleteRepositoryConfirmDialog_DeleteGitDirCheckbox)
        .select();
    shell.bot()
        .checkBox(
            UIText.DeleteRepositoryConfirmDialog_DeleteWorkingDirectoryCheckbox)
        .select();
    shell.bot().button(IDialogConstants.OK_LABEL).click();
    TestUtil.joinJobs(JobFamilies.REPOSITORY_DELETE);

    refreshAndWait();
    assertEmpty();
    assertProjectExistence(PROJ1, false);
View Full Code Here

        .expandNode(
            UIText.RepositoriesViewLabelProvider_SubmodulesNodeText)
        .getItems()[0].select();
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue(DELETE_REPOSITORY_CONTEXT_MENU_LABEL));
    SWTBotShell shell = bot
        .shell(UIText.DeleteRepositoryConfirmDialog_DeleteRepositoryWindowTitle);
    shell.activate();
    shell.bot()
        .checkBox(
            UIText.DeleteRepositoryConfirmDialog_DeleteGitDirCheckbox)
        .select();
    shell.bot()
        .checkBox(
            UIText.DeleteRepositoryConfirmDialog_DeleteWorkingDirectoryCheckbox)
        .select();
    shell.bot().button(IDialogConstants.OK_LABEL).click();
    TestUtil.joinJobs(JobFamilies.REPOSITORY_DELETE);

    refreshAndWait();
    assertFalse(subRepo.getDirectory().exists());
    assertFalse(subRepo.getWorkTree().exists());
View Full Code Here

    remotesItem = myRepoViewUtil.getRemotesItem(tree, repositoryFile)
        .expand();
    remotesItem.select();
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("NewRemoteCommand"));
    SWTBotShell shell = bot.shell(UIText.NewRemoteDialog_WindowTitle);
    shell.bot().textWithLabel(UIText.NewRemoteDialog_NameLabel).setText(
        "testRemote");
    // configure fetch first
    shell.bot().radio(UIText.NewRemoteDialog_FetchRadio).click();
    shell.bot().button(IDialogConstants.OK_LABEL).click();

    // configure fetch dialog
    shell = bot.shell(UIText.SimpleConfigureFetchDialog_WindowTitle);
    // change uri
    shell.bot().button(UIText.SimpleConfigureFetchDialog_ChangeUriButton)
        .click();
    shell = bot.shell(UIText.SelectUriWiazrd_Title);
    shell.bot().text().setText("file:///" + remoteRepositoryFile.getPath());
    shell.bot().button(IDialogConstants.FINISH_LABEL).click();
    // now we have the fetch URI
    // back to dialog
    shell = bot.shell(UIText.SimpleConfigureFetchDialog_WindowTitle);
    shell.bot().button(UIText.SimpleConfigureFetchDialog_AddRefSpecButton)
        .click();
    shell = bot.shell(UIText.SimpleFetchRefSpecWizard_WizardTitle);
    shell.bot().textWithLabel(UIText.FetchSourcePage_SourceLabel).setText(
        "refs/heads/*");
    shell.bot().button(IDialogConstants.NEXT_LABEL).click();
    shell.bot().textWithLabel(UIText.FetchDestinationPage_DestinationLabel)
        .setText("refs/remotes/testRemote/*");
    shell.bot().button(IDialogConstants.FINISH_LABEL).click();
    // back to dialog
    shell = bot.shell(UIText.SimpleConfigureFetchDialog_WindowTitle);
    // save
    shell.bot().button(UIText.SimpleConfigureFetchDialog_SaveButton)
        .click();

    refreshAndWait();
    // assert 1 children
    SWTBotTreeItem item = myRepoViewUtil.getRemotesItem(tree,
        repositoryFile).expand().getNode("testRemote").expand();
    List<String> children = item.getNodes();
    assertEquals(2, children.size());
    item.select();
    // now we add push
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("ConfigurePushCommand"));

    shell = bot.shell(UIText.SimpleConfigurePushDialog_WindowTitle);
    shell.bot()
        .button(UIText.SimpleConfigurePushDialog_AddRefSpecButton, 1)
        .click();

    // add push spec
    shell = bot.shell(UIText.RefSpecDialog_WindowTitle);

    shell.bot().textWithLabel(UIText.RefSpecDialog_SourceBranchPushLabel)
        .setText("HEAD");
    shell.bot().textWithLabel(UIText.RefSpecDialog_DestinationPushLabel)
        .setText("refs/for/master");
    final Text text = shell.bot().textWithLabel(
        UIText.RefSpecDialog_DestinationPushLabel).widget;
    shell.display.syncExec(new Runnable() {

      public void run() {
        text.setFocus();
        text.notifyListeners(SWT.Modify, new Event());
      }
    });
    shell.bot().button(IDialogConstants.OK_LABEL).click();
    shell = bot.shell(UIText.SimpleConfigurePushDialog_WindowTitle);
    shell.bot().button(UIText.SimpleConfigurePushDialog_SaveButton).click();

    refreshAndWait();
    // assert 2 children
    item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand()
        .getNode("testRemote").expand();
    children = item.getNodes();
    assertEquals(2, children.size());
    item.getNode(0).select();
    // we remove the fetch, the URI is copied into push
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("RemoveFetchCommand"));
    refreshAndWait();
    // assert 1 children
    item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand()
        .getNode("testRemote").expand();
    children = item.getNodes();
    assertEquals(1, children.size());
    item.getNode(0).select();
    // now we also remove the push
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("RemovePushCommand"));
    refreshAndWait();
    // assert 0 children
    item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand()
        .getNode("testRemote").expand();
    children = item.getNodes();
    assertEquals(0, children.size());

    myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode(
        "testRemote").select();

    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("ConfigureFetchCommand"));

    String shellText = UIText.SimpleConfigureFetchDialog_WindowTitle;
    shell = bot.shell(shellText);
    // change uri
    shell.bot().button(UIText.SimpleConfigureFetchDialog_ChangeUriButton)
        .click();
    shell = bot.shell(UIText.SelectUriWiazrd_Title);
    shell.bot().text().setText("file:///" + remoteRepositoryFile.getPath());
    shell.bot().button(IDialogConstants.FINISH_LABEL).click();
    // back to dialog
    shell = bot.shell(shellText);
    // add refSpec
    shell.bot().button(UIText.SimpleConfigureFetchDialog_AddRefSpecButton)
        .click();
    shell = bot.shell(UIText.SimpleFetchRefSpecWizard_WizardTitle);
    shell.bot().textWithLabel(UIText.FetchSourcePage_SourceLabel).setText(
        "refs/heads/*");
    shell.bot().button(IDialogConstants.NEXT_LABEL).click();
    shell.bot().textWithLabel(UIText.FetchDestinationPage_DestinationLabel)
        .setText("refs/remotes/testRemote/*");
    shell.bot().button(IDialogConstants.FINISH_LABEL).click();
    // back to dialog
    shell = bot.shell(shellText);
    // save
    shell.bot().button(UIText.SimpleConfigureFetchDialog_SaveButton)
        .click();
    refreshAndWait();
    // assert 1 children
    item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand()
        .getNode("testRemote").expand();
    children = item.getNodes();
    assertEquals(2, children.size());

    // we remove the fetch again
    item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand()
        .getNode("testRemote").expand();
    children = item.getNodes();
    assertEquals(2, children.size());
    item.getNode(0).select();
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("RemoveFetchCommand"));
    refreshAndWait();

    myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand().getNode(
        "testRemote").select();

    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("ConfigurePushCommand"));

    shellText = UIText.SimpleConfigurePushDialog_WindowTitle;
    shell = bot.shell(shellText);
    shell.bot().button(UIText.SimpleConfigurePushDialog_AddPushUriButton)
        .click();

    // back to dialog
    shell = bot.shell(shellText);
    shell = bot.shell(UIText.SelectUriWiazrd_Title);
    shell.bot().text().setText("file:///" + remoteRepositoryFile.getPath());
    shell.bot().button(IDialogConstants.FINISH_LABEL).click();
    shell = bot.shell(shellText);
    // Add is on two buttons
    shell.bot()
        .button(UIText.SimpleConfigurePushDialog_AddRefSpecButton, 1)
        .click();
    // add push spec
    shell = bot.shell(UIText.RefSpecDialog_WindowTitle);

    shell.bot().textWithLabel(UIText.RefSpecDialog_SourceBranchPushLabel)
        .setText("HEAD");
    shell.bot().textWithLabel(UIText.RefSpecDialog_DestinationPushLabel)
        .setText("refs/for/master");
    final Text text2 = shell.bot().textWithLabel(
        UIText.RefSpecDialog_DestinationPushLabel).widget;
    shell.display.syncExec(new Runnable() {

      public void run() {
        // focus for update of other fields
        text2.setFocus();
        text2.notifyListeners(SWT.Modify, new Event());
      }
    });

    shell.bot().button(IDialogConstants.OK_LABEL).click();

    // back to dialog
    shell = bot.shell(shellText);
    shell.bot().button(UIText.SimpleConfigurePushDialog_SaveButton).click();
    refreshAndWait();
    // assert 2 children
    item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand()
        .getNode("testRemote").expand();
    children = item.getNodes();
    assertEquals(1, children.size());
    item.select();
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("RepoViewRemoveRemote.label"));
    shell = bot.shell(UIText.RepositoriesView_ConfirmDeleteRemoteHeader);
    // Cancel
    shell.bot().button(IDialogConstants.CANCEL_LABEL).click();

    refreshAndWait();
    // assert 2 children
    item = myRepoViewUtil.getRemotesItem(tree, repositoryFile).expand()
        .getNode("testRemote").expand();
View Full Code Here

    localItem.getNode(0).select();

    ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
        .getPluginLocalizedValue("CreateBranchCommand"));

    SWTBotShell createPage = bot
        .shell(UIText.CreateBranchWizard_NewBranchTitle);
    createPage.activate();
    // getting text with label doesn't work
    createPage.bot().textWithId("BranchName").setText("newLocal");
    createPage.bot().checkBox(UIText.CreateBranchPage_CheckoutButton)
        .select();
    createPage.bot().button(IDialogConstants.FINISH_LABEL).click();
    TestUtil.joinJobs(JobFamilies.CHECKOUT);
    refreshAndWait();

    localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
        repositoryFile);
    localItem.expand();
    assertEquals("Wrong number of children", 2, localItem.getNodes().size());

    touchAndSubmit("Some more changes");

    localItem.getNode(1).select();
    assertCheckoutNotAvailable(view);
    localItem.getNode(0).select();
    ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
        .getPluginLocalizedValue("CheckoutCommand"));
    TestUtil.joinJobs(JobFamilies.CHECKOUT);
    localItem.getNode(1).select();
    refreshAndWait();
    ContextMenuHelper.clickContextMenu(view.bot().tree(), myUtil
        .getPluginLocalizedValue("RepoViewDeleteBranch.label"));
    SWTBotShell confirmPopup = bot
        .shell(UIText.UnmergedBranchDialog_Title);
    confirmPopup.activate();
    confirmPopup.bot().button(IDialogConstants.OK_LABEL).click();
    refreshAndWait();
    localItem = myRepoViewUtil.getLocalBranchesItem(view.bot().tree(),
        repositoryFile);
    localItem.expand();
    assertEquals("Wrong number of children", 1, localItem.getNodes().size());
View Full Code Here

    assertTrue("Missing remote branch", children.contains("origin/master"));
    assertTrue("Missing remote branch", children.contains("origin/stable"));
    item.getNode("origin/stable").select();
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("CreateBranchCommand"));
    SWTBotShell shell = bot.shell(UIText.CreateBranchWizard_NewBranchTitle);
    shell.activate();
    assertEquals("stable", shell.bot().textWithId("BranchName").getText());
    shell.bot().button(IDialogConstants.FINISH_LABEL).click();
    refreshAndWait();
    item = myRepoViewUtil.getLocalBranchesItem(tree, clonedRepositoryFile)
        .expand();

    children = item.getNodes();
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.