#115 Functional tests

open
5
2012-10-29
2010-01-15
No

There are no functional tests present in the project.
I would very much wish to have these kind of test and have them automated.
Possible approaches: SWTBot, TPTP's Automated GUI Recorder,
GUITAR - http://guitar.sourceforge.net/
abbot - http://abbot.sourceforge.net/doc/overview.shtml

Discussion

  • sky_HALud

    sky_HALud - 2010-01-15

    This would be a warmly welcomed addition to the project. I've heard good things about SWTBot, but it might be too basic. I've had some contact with TPTP when attempting to profile a Web application, about 1 year ago, and it seemed overly complex and slow. But it might have changed. Looking forward to see your ideas about this topic.

     
  • Dan Corneanu

    Dan Corneanu - 2010-01-18

    Hi,
    I have added a new project with SWTBot based tests. The name of the project is org.jcommander.ui.tests, you can find it in CVS in the plugins folder. It is a simple plugin project. Currently it only has a single test case, to demonstrate how SWTBot can be used. You can run the test using the JCommanderUITest.launch launcher fount in the root of the project.

    For now the test has a hard coded path "C:\" but this will change in the future.

    In the future we can configure the test fixture to use an InMemory VFS for the tests, to run identical on all platforms. I think apache's VFS supports this. We can populate the file system with the same structure before each test is run. What do you think about this approach?

    While playing with the first SWTBot test I've found a bug in the
    FileControlModel.java. There is a concurrent access/modification bug in
    the update()/getContent() methods resulting in an IndexOutOfBoundsException. Please run the test and let me know if it also happens to you. I'll fill a bug report for this.

     
  • Dan Corneanu

    Dan Corneanu - 2010-01-30

    Hi,
    I have added a test to model the "Copy file" use case. In the beforeClass()method I prepare a temporary file system (thanks to apaches VFS capabilities) and unpack the content of the "jcmd functional testing resources.zip". Later, the tests can use this file system as their fixture. In the afterClass() method, I just close the VFS manager which results in removing the temporary file system from the disk. This set-up gives us a proper isolated test environment. We can debate if the test fixture should be set up and teared down before/after each test or is it acceptable to set it up before the first test and tear it down after the last one.
    Please have a look and let me know what you think. Yes, some parts of the test, like searching for a cell in the table, are a little bit complicated, but I think we can factor them out.
    SWTBot tests seem to fail if you click on the JCommander window during a test run.
    There is an interesting tool in SWTBot called swtspy. You can use it to inspect the GUI structure and get an idea how to get to a given widget. If you want to run the tool on JCommander you have to:
    - add the org.eclipse.swtbot.eclipse.spy plugin to your launch configuration.
    - start JCommander
    - add the "Eclipse Spy" view to your perspective
    - toogle eclipsespy capture on/off by using "Ctrl - Shift"

    Best regards,
    Dan.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks