Results 1 to 5 of 5

Thread: Application fixture initialisation for functional tests

  1. #1
    Sencha Premium User
    Join Date
    Jul 2016
    Posts
    7

    Default Answered: Application fixture initialisation for functional tests

    My manager has asked me to take a look at Sencha Test (ST) for testing our application's ExtJS front-end. I've spent a few hours reading the docs and have a question regarding how do do fixture initialisation for functional tests:


    We currently use JUnit coupled with WebDriver (with the Java driver). We typically setup a bespoke test fixture per test (by calling the application's SOAP API, for which there is a convenient Java client JAR) and then clear the app's database on teardown (again via the Java API). I'm unclear how we would dovetail this setup and teardown (which we would ideally continue to do using Java) with invoking a ST test. Not quite so important but our tests sometimes also use the app's Java API to assert the state of the database following some user interaction, e.g. asserting the state of the audit trail, confirming a record has been updated correctly, etc.


    So, to summarise, my question is: Is it possible to combine calling a server side API with ST? Any tips or pointers would be appreciated.


    Aside: Starting to wonder if the style of web functional testing I've described is an anti-pattern because I guess it effectively means we can't execute multiple tests in parallel against a single instance of the app. But if that's the case, what is the best practise approach to tidying-up after running a functional test?

  2. Additionally, in the next major release you will be able to use your own Node.js modules in WebDriver tests. That means the ability to require() a database driver or a wrapper to a Java process, for instance.

  3. #2
    Sencha User
    Join Date
    Mar 2016
    Posts
    59
    Answers
    6

    Default

    Functional tests on running apps with databases is challenging. There are many approaches. You have used one which is to clear the database and possibly seed it with expected data. Another option would be to have several seed databases for different tests and have some sort of testing API in the app so the test can cause the app to have the database state it wishes to test. Another approach is to have a sequence of tests which rely on previous tests affects to have the proper state for each subsequent test. Each approach has its drawbacks so I would say best practice is to focus on the areas of most concern and use the approach that seems best for that area.

    There is no current way to integrate directly with a Java API but I would expect you could expose that Java API in some sort of test webservice/restful interface in the app. You could then use AJAX calls in your test to manipulate and check things.

    With functional testing it might be best to focus on logic that is in the UI and let non-UI tests assert that backend logic is proper. In this way you limit the scope of each suite of tests and get rid of some of the brittle and complicated nature of testing.

  4. #3
    Sencha - Test Dev Team marcelofarias's Avatar
    Join Date
    Nov 2011
    Location
    Boca Raton, FL
    Posts
    75
    Answers
    5

    Default

    Additionally, in the next major release you will be able to use your own Node.js modules in WebDriver tests. That means the ability to require() a database driver or a wrapper to a Java process, for instance.
    Marcelo Bukowski de Farias

  5. #4
    Sencha Premium User
    Join Date
    Jul 2016
    Posts
    7

    Default

    Thanks Craig and Marcelo, that's very helpful.

    The ability to include Node.js modules to allow fixture setup and tear-down would be just the job. Sounds like ST3 might be a better fit for the style of functional testing we do.

  6. #5
    Sencha - Test Dev Team marcelofarias's Avatar
    Join Date
    Nov 2011
    Location
    Boca Raton, FL
    Posts
    75
    Answers
    5

    Default

    No need to wait that long - 2.1 will be major
    Marcelo Bukowski de Farias

Similar Threads

  1. Replies: 0
    Last Post: 5 Dec 2016, 3:21 AM
  2. Baff - Business Application Functional Framework (ExtJS/Touch & Spring)
    By bobseed in forum Ext:User Extensions and Plugins
    Replies: 1
    Last Post: 11 Mar 2015, 5:17 AM
  3. ExtJs 4.0 framework for functional tests
    By juhyx in forum Ext: Discussion
    Replies: 0
    Last Post: 29 Aug 2011, 1:40 AM
  4. Ext.Application Functional or In-Development?
    By Pandaxia in forum Ext: Discussion
    Replies: 4
    Last Post: 20 Feb 2011, 6:46 AM
  5. automating functional tests
    By nokia786 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 29 Nov 2008, 8:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •