Package org.eclipse.swtbot.swt.finder

Examples of org.eclipse.swtbot.swt.finder.SWTBot


    createClass(projectName, "Class", packageName, className);
  }

  private void createClass(String projectName, String classType,
      String packageName, String className) {
    SWTBot localBot = bot.viewByTitle("Package Explorer").bot();
    localBot.tree().expandNode(projectName).select("src");
    bot.menu("File").menu("New").menu(classType).click();
    bot.textWithLabel("Package:").setText(packageName);
    bot.textWithLabel("Name:").setText(className);
    bot.button("Finish").click();
  }
View Full Code Here


    setupProjectDependency(projectName);
  }

  private void setupProjectDependency(String projectName) {
    bot.menu("Window").menu("Show View").menu("Navigator").click();
    SWTBot localBot = bot.viewByTitle("Navigator").bot();
    SWTBotTree tree = localBot.tree();
    SWTBotTreeItem node = tree.expandNode(projectName + "Test");
    node = node.expandNode(".classpath").select();

    final SWTBotContextMenu cmenu = new SWTBotContextMenu(tree);
    bot.performWithTimeout(new VoidResult() {
View Full Code Here

            + ");", "Assert.assertEquals(\"expected result\", "
            + expectedResultStr + ", result);", "}", "}");
  }

  private void createJUnit4TestSuite(String projectName, String packageName) {
    SWTBot localBot = bot.viewByTitle("Package Explorer").bot();
    localBot.tree().expandNode(projectName + "Test", "src")
        .select(packageName);
    bot.menu("File").menu("New").menu("Other...").click();
    bot.shell("New").activate();
    bot.tree().expandNode("Java", "JUnit 4").select("JUnit 4 Test Suite");
    bot.button("Next >").click();
View Full Code Here

    bot.button("Finish").click();
  }

  private void executeJUnit4TestSuiteInUi(String projectName,
      String packageName) {
    SWTBot localBot = bot.viewByTitle("Package Explorer").bot();
    localBot.tree().expandNode(projectName + "Test", "src", packageName)
        .select("AllTests.java");
    SWTBotMenu menu = bot.menu("Run").menu("Run As");
    try {
      getSubMenuItemContainingTest(menu, "JUnit Test");
    } catch (WidgetNotFoundException wnfe) {
View Full Code Here

        final Matcher<MenuItem> matcher = WidgetMatcherFactory.allOf(WidgetMatcherFactory.widgetOfType(MenuItem.class), withMnemonic);
        final ContextMenuFinder menuFinder = new FirstContextMenuFinder(tree);
       
        final List<MenuItem> items = new ArrayList<MenuItem>();

        new SWTBot().waitUntil(new DefaultCondition() {
            public String getFailureMessage() {
                return "Could not find context menu with text: " + text; //$NON-NLS-1$
            }

            public boolean test() throws Exception {
View Full Code Here

   * @return the tree item with the specified text.
   * @throws WidgetNotFoundException if the node was not found.
   */
  private SWTBotTreeItem getTreeItem(final String nodeText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + nodeText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

   * Waits until browser loads page.
   *
   * @throws TimeoutException if page is not loaded after default timeout
   */
  public void waitForPageLoaded() {
    new SWTBot().waitUntil(new WaitForBrowserLoadsPage(this));
  }
View Full Code Here

    TestUtil.showExplorerView();
  }

  protected void changeFilesInProject() throws Exception {
    SWTBot packageExlBot = bot.viewByTitle("Package Explorer").bot();
    SWTBotTreeItem coreTreeItem = selectProject(PROJ1, packageExlBot.tree());
    SWTBotTreeItem rootNode = coreTreeItem.expand().getNode(0)
        .expand().select();
    rootNode.getNode(0).select().doubleClick();

    SWTBotEditor corePomEditor = bot.editorByTitle(FILE1);
View Full Code Here

  }

  protected void commit(String projectName) throws InterruptedException {
    showDialog(projectName, "Team", "Commit...");

    SWTBot shellBot = bot.shell(CommitDialog_CommitChanges).bot();
    shellBot.styledText(0).setText(TEST_COMMIT_MSG);
    shellBot.toolbarButtonWithTooltip(CommitDialog_SelectAll).click();
    shellBot.button(CommitDialog_Commit).click();
    TestUtil.joinJobs(JobFamilies.COMMIT);
  }
View Full Code Here

    // when
    launchSynchronization(HEAD, R_HEADS + MASTER, false);

    // then
    SWTBot viewBot = bot.viewByTitle("Synchronize").bot();
    @SuppressWarnings("unchecked")
    Matcher matcher = allOf(widgetOfType(Label.class),
        withRegex("No changes in .*"));

    @SuppressWarnings("unchecked")
    SWTBotLabel l = new SWTBotLabel((Label) viewBot.widget(matcher));
    assertNotNull(l);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.SWTBot

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.