Time for action – waiting for a condition

Typically an action may require some result to happen in the user interface before testing can continue. Since the SWTBot can run much faster than a human can, waiting for the result of an action may be necessary. To demonstrate this, create a Java project with a single source file and then use the conditions to wait until the class file is compiled.

  1. Create a new method in the UITest class called createJavaProject.
  2. Use the bot to create a new Java project by copying the createProject method as a template.
  3. Add the org.eclipse.core.resources as a dependency to the plug-in.
  4. Add a method getProject, which takes a projectName and returns an IProject from ResourcesPlugin.getWorkspace().getRoot().getProject().
  5. At ...

Get Eclipse Plug-in Development Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.