Changes between Version 28 and Version 29 of Contribute/QA


Ignore:
Timestamp:
12/04/12 08:13:15 (9 years ago)
Author:
aviraldg
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Contribute/QA

    v28 v29  
    6262== Advanced ==
    6363
    64 === Create a Generic Test Function for Search Tests ===
    65 Currently the Sahana test framework has a {{{create}}} function in {{{eden/modules/tests/web2unittests.py}}} which makes it simple to write tests for creating records. A similar function could be written for the Search Function: This would do the following:
    66 * Have parameters for:
    67  * The search query -- which fields to search on and their values.
    68   * Look at the {{{create}}} function's {{{data}}} parameter. It has additional information about the form. Do you need anything like that? Could you use the same format for your parameter?
    69   * Would it make sense to share any code with {{{create}}}?
    70  * The expected results. It is sufficient to just test that the right number of records are returned and give a list of the first n (determined in test case) values in a specific sorted column.
    71   * You may want tests that return no results, or one result, or multiple results. What would be a good way to pass in the expected results?
    72 * Fill the search criteria in the advanced search form.
    73 * Execute the search.
    74 * Check that the results are exactly as given.
    75 * If feasible, extend this to also test simple search.
    76  * Can you use the same data to test the simple search form?
    77  * Does the caller need to tell you which field the simple search uses?
    78 * Think about what code could be shared between your {{{search}}} function, the {{{create}}} function, and the {{{report}}} function task below.
    79 Test this function in at least one test script.
     64=== ~~Create a Generic Test Function for Search Tests~~ ===
     65~~Currently the Sahana test framework has a {{{create}}} function in {{{eden/modules/tests/web2unittests.py}}} which makes it simple to write tests for creating records. A similar function could be written for the Search Function: This would do the following:~~
     66* ~~Have parameters for:~~
     67 * ~~The search query -- which fields to search on and their values.~~
     68  * ~~Look at the {{{create}}} function's {{{data}}} parameter. It has additional information about the form. Do you need anything like that? Could you use the same format for your parameter?~~
     69  * ~~Would it make sense to share any code with {{{create}}}?~~
     70 * ~~The expected results. It is sufficient to just test that the right number of records are returned and give a list of the first n (determined in test case) values in a specific sorted column.~~
     71  * ~~You may want tests that return no results, or one result, or multiple results. What would be a good way to pass in the expected results?~~
     72* ~~Fill the search criteria in the advanced search form.~~
     73* ~~Execute the search.~~
     74* ~~Check that the results are exactly as given.~~
     75* ~~If feasible, extend this to also test simple search.~~
     76 * ~~Can you use the same data to test the simple search form?~~
     77 * ~~Does the caller need to tell you which field the simple search uses?~~
     78* ~~Think about what code could be shared between your {{{search}}} function, the {{{create}}} function, and the {{{report}}} function task below.~~
     79~~Test this function in at least one test script.~~
    8080
     81(Implemented: https://github.com/flavour/eden/commit/cec2df2dfeb0ea6779941d9a77fd65c6786e3b96)
    8182=== Create a Generic Test Function for Report Tests ===
    8283Currently the Sahana test framework has a {{{create}}} function in {{{eden/modules/tests/web2unittests.py}}} which makes it simple to write tests for creating records. A similar function could be written for the Report Function. Ideally this would re-use features from / share code with the {{{search}}} helper described above -- it would be good to read that description. Because of this dependency, it might be better if this is done after {{{search}}}. Note for GCI: It's ok to claim this task if someone is working on {{{search}}}, and get a start on it. The {{{report}}} helper would do the following: