Good Eclipse plugin testing tool
We wrote several Eclipse plugins to allow us to debug the company's hardware and firmware. I'm looking for a good tool that will automate GUI testing of the plugins. I read about the Eclipse Unit tests but I'm looking for a more complex scenarios that a开发者_JS百科lso tests integration between the different plugins. Freeware\open source is preferable if it will answer our needs.
Check out WindowTester from Instansiations/Google. Google bought Instansiations in summer 2010 and then made this product free (and in December 2010 it's open source). This is a commercial quality automated test tool. It generates nice JUnit test cases from your recorded session.
You definetely should try Xored Q7 for functional and UI testing of Eclipse-based applications, which is available in either Professional or Community Edition. The last one is free.
Regarding GUI testing, have you seen SWTBot? It may not be sophisticated enough for you, but it may be worth looking at.
I've had this proof of concept code sitting in the repository for a while waiting until the GUI in the project to be stable enough for it to be worth writing high level tests.
Hope some of this answer helps!
public class TestExampleGUI
{
public static Shell shell ;
public static Display testDisplay;
public boolean buttonClicked = false;
@Before
public void setUp() throws Exception
{
testDisplay = new Display();
testDisplay.beep();
shell = new Shell(testDisplay);
Button button = new Button(shell, 0);
button.setText("Button");
button.addSelectionListener(new SelectionListener()
{
@Override
public void widgetDefaultSelected(SelectionEvent e)
{
System.out.println("Default Pressed");
}
@Override
public void widgetSelected(SelectionEvent e)
{
System.out.println("Pressed");
buttonClicked = true;
}
});
shell.setText("Test");
shell.setLayout(new FillLayout());
shell.setSize(800,900);
shell.open();
}
@After
public void tearDown() throws Exception
{
}
@Test
public void testExampleGUI()
{
SWTWorkbenchBot bot = new SWTWorkbenchBot();
// click on a button with the given text
bot.button("Button").click();
assertTrue(buttonClicked);
}
}
精彩评论