Changes between Version 11 and Version 12 of DeveloperGuidelines/Testing
- Timestamp:
- 09/19/14 15:05:59 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/Testing
v11 v12 4 4 ''"A bug is a test case you haven't written yet"'' 5 5 6 ''"Unit Tests allow merciless [http://diveintopython.org/refactoring/refactoring.html refactoring]"''7 8 This page defines what our current approach versus our [wiki:BluePrintTesting BluePrint for future options]9 10 Test-Driven Development is a programming style which says that you 1st write your test cases (from the [BluePrint specs]) & then proceed to make them pass.11 6 12 7 == Automated Tests == 13 8 14 === Smoke Tests ===15 Smoke Tests click through on every link within Sahana Eden and can be used to check for errors on pages and broken links. They are a light-weight approach to detecting basic errors, however they do not test form submission or any interaction. They can be run using [http://twill.idyll.org/ twill] or [http://jeanphix.me/Ghost.py/ Ghost.py]. Ghost is still under development and offers much more features than Twill.16 To run the Smoke Tests using Twill (use g for Ghost):17 {{{18 python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py -A --suite smoke --agent t --force-debug --link-depth 7 -V 319 }}}20 Before running smoke tests, check [http://eden.sahanafoundation.org/wiki/DeveloperGuidelines/Testing/Smoke Developer Guidelines - Smoke Tests] for installation and aditional options.21 9 22 === Selenium Tests===10 === EdenTest === 23 11 Selenium Tests use the [http://seleniumhq.org/docs/03_webdriver.jsp Selenium WebDriver] to simulate user interactions within a browser. They are very thorough as they test interactions in the entire Sahana Eden stack including JS, but can also be fragile (detect false negatives). 24 12 … … 29 17 30 18 19 === Smoke Tests === 20 Smoke Tests click through on every link within Sahana Eden and can be used to check for errors on pages and broken links. They are a light-weight approach to detecting basic errors, however they do not test form submission or any interaction. They are run using EdenTest 21 22 To run the Smoke Tests 23 {{{ 24 python web2py.py --no-banner -M -S eden -R applications/eden/tests/edentest_runner.py -A smoke_tests -o NONE -l NONE 25 }}} 26 Before running smoke tests, check [wiki:DeveloperGuidelines/EdenTest/WriteTestcase/Advanced#SmokeTests Smoke Tests] for additional options. 27 28 31 29 === Unit Tests === 30 ''"Unit Tests allow merciless [http://diveintopython.org/refactoring/refactoring.html refactoring]"'' 31 32 32 Unit Tests can be used to test whether specific "Units" of code are working. They are used extensively to test the Sahana Eden "S3" Framework. 33 Unit Tests require running with the IFRC_Trainprepopulate:33 Unit Tests require running with the following prepopulate: 34 34 {{{ 35 settings.base.prepopulate = ["IFRC", "IFRC_Train"]35 settings.base.prepopulate = ("default", "default/users") 36 36 }}} 37 37 To run all Unit Tests: