For example: I want to "test" Eclipse-CDT. I can't do it using Java code so I need to import a C-project. I didn't found it in Run Configurtion therefore I:
* Create SWTBot Test Plug-in
* Record a sequence of actions via SWTBot Test Recorder:
** Import a C-project
** Change perspective
** Do stuff (run program and check registers for exapmles)
* Insert recorded actions into @Test method
* Run As > SWTBot Test
Here is a problem. SWTBot fails at picking imported project showing various changing errors (mostly "WidgetNotFoundException" at expanding package view or picking imported project from project tree and "NullPointerException" at the same point). Testing code looks like
@Test
public void test() {
bot.menu("File").menu("Import...").click();
bot.tree().expandNode("General").getNode("Existing Projects into Workspace").select();
bot.button("Next >").click();
bot.comboBox().setText("C:\\Sandbox\\JavaWorkspace\\CDTtest");
bot.button("Browse...").click();
bot.button("Finish").click();
bot.toolbarButtonWithTooltip("&Restore").click();
bot.tree().getTreeItem("CDTtest").getNode("main.c").select();
bot.menu("Project").menu("Build Project").click();
bot.menu("Run").menu("Debug").click();
bot.tree().getTreeItem("General Registers").expand();
bot.menu("Run").menu("Step Over").click();
}
Is there more appropriate way to described things? Or maybe a more appropriate tool for that?