mercredi 4 mars 2009

ShuangXi effect : UI testing and documentation

In my never-ending quest of ideas or tools to avoid doing boring stuff (that sacred goal explains my interest in pragmatic modeling), I made quite a victory today thanks to one of those gems you find in Eclipse.

Here I'm speaking about the help/tutorials you get in the Eclipse help menu.
We often add many many screenshots in the tutorial but this tiny litle idea of "showing stuff to the user" may have a huge cost ! The drawback of using such images in the help is that as the tool evolve the ui do so, and the tutorial screenshots are quickly really different from the real tool user interface.
Then you even have to recapture screenshots for at every release, or just decide that "a real doc has no screenshots"

Both are inadmissible, one idea would be to integrate this "screen capture" step in the build process and automatically capture the wizards, views or properties. Then, you would even be able to localize your documentation screenshots starting this process for every localization you have. You've got pretty much any thing you need, right now thanks to Eclipse, to do that.

The gem I mentioned is SWTBot , thanks to this litle tool I quickly managed to get a basic test scenario working to test UI. Even if testing is important, and testing UI is tricky, here my goal was to produce the screenshots from the tests, here is the code (it anybody knows how to highlight code with blogger...):

bot.view("Welcome").close();"Window").menu("Open Perspective").menu("Other...").click();
SWTBotShell openPerspectiveShell ="Open Perspective");

SWTBotShell newProjectShell ="New Project");
bot.tree().expandNode("Acceleo").getNode("Generator Project").select();

bot.button("Next >").click();


captureScreenshot("4-generator-project-done.png");"File").menu("New").menu("Empty Generator").click();
SWTBotShell newTemplateShell ="New");

That's the喜喜 (ShuangXi) effect, you roughly test your UI and you get your screenshots !

ps : special "Hi" to the unique Guangzhou visitor I had on this blog so far :)
Enregistrer un commentaire