Search This Blog

Monday, November 19, 2012

Getting started with EasyTest (lazy man tutorial)

If you are not using our functional testing framework  - EasyTest yet (if you fall into this category, do not feel bad as you are not alone - our stats (example) show that you are still in the majority:-) ), then this is a good chance to start!

I would like to talk about an internal *AutoTest command that we use to test XAF Code Examples during the initial testing phase internally (before running example-specific tests). This command checks all the navigation items in your app and ensures that list and detail forms can be opened without errors. Not much, but at least it allows you ensure the minimal possible quality of your application before delivering it to the client. Of course, if you wish more, you can choose from dozens of other built-in EasyTest commands or even implement a custom EasyTest command with blackjack and ..., you know:-)

BTW, creating a custom EasyTest command is not that difficult at it appears, expecially taking into account the detailed tutorial and the availability of the full source code of the built-in EasyTest commands:
%ProgramFiles%\DXperience 12.1\Sources\DevExpress.ExpressApp.Modules\DevExpress.ExpressApp.EasyTest.WinAdapter\
%ProgramFiles%\DXperience 12.1\Sources\DevExpress.ExpressApp.Modules\DevExpress.ExpressApp.EasyTest.WebAdapter\
Well, returning to simple things, this is how to use the command I was talking about:
#Timeout 10
#DropDB SimpleProjectManager
#Application SimpleProjectManagerWin
;#Application SimpleProjectManagerWeb
You can past this stuff (correct app names first, of course!) into the <YourSolutionName>.Module\FunctionalTests\Sample.ets file (it comes with the default XAF solution template) and then right click to choose the Run command in the menu (see this help article for more details).
And here is the result it produces:

View on »
Seriously, it is time to start with EasyTest, no more excuses;-)

As I mentioned in the beginning, this command is internal and unofficial. We also have not tested it under all scenarios supported by XAF. That said, we may not be able to fix issues with it in a reasonable time frame, so please use it at your own risk, and feel free to modify and test it further to better meet your business requirements.risk. Or better implement normal functional tests for each required screen in your app using the wonderful EasyTest Script Reference.

No comments:

Post a Comment