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.
- Create a new method in the
UITest
class calledcreateJavaProject
. - Use the
bot
to create a new Java project by copying thecreateProject
method as a template. - Add the
org.eclipse.core.resources
as a dependency to the plug-in. - Add a method
getProject
, which takes aprojectName
and returns anIProject
fromResourcesPlugin.getWorkspace().getRoot().getProject()
. - 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.