User Tools

Site Tools


dev:contributing:qa

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:contributing:qa [2015/08/12 12:08] – [pgTAP Live Database Tests] ybostondev:contributing:qa [2023/11/10 18:14] (current) – add OPAC tests sandbergja
Line 35: Line 35:
  
 ===== Types of Tests ===== ===== Types of Tests =====
 +
 +==== AngularJS Unit Tests ====
 +
 +These test the Web Client apps.
 +
 +  * They are stored in ''Open-ILS/web/js/ui/default/staff/test/''
 +  * See the [[https://code.angularjs.org/1.6.10/docs/guide/unit-testing#additional-tools-for-testing-angularjs-applications|official instructions]] for details.
 +
 +Running the tests:
 +  * See the [[https://evergreen-ils.org/documentation/install/README_3_1.html#install_files_for_web_staff_client|Evergreen README]] for up-to-date details.
 +  * Steps to run the tests as of Evergreen 3.1:
 +
 +  cd $EVERGREEN_ROOT/Open-ILS/web/js/ui/default/staff/
 +  # fetch JS dependencies, described in package.json
 +  npm install
 +  # build, run tests, concat+minify
 +  npm run build-prod   # may not be necessary for running tests
 +  npm run test
 +
 +==== Angular Unit Tests ====
 +
 +See [[dev:angular_dev_best_practices#unit_tests|Evergreen Angular Development Best Practices]]
 +
 +To run on a running Evergreen server:
 +
 +<code sh>
 +cd Open-ILS/src/eg2
 +npm run test
 +</code>
 +
 +==== Angular e2e (end-to-end) Tests ====
 +
 +To run with a GUI:
 +
 +<code sh>
 +cd Open-ILS/src/eg2
 +ng e2e
 +</code>
 +
 +To run without a GUI:
 +
 +<code sh>
 +cd Open-ILS/src/eg2
 +MOZ_HEADLESS=1 ng e2e
 +</code>
 +
 +To run in Chrome instead of Firefox:
 +<code sh>
 +cd Open-ILS/src/eg2
 +npm install --save-dev chromedriver
 +ng e2e --env chrome # with the GUI
 +ng e2e --env chrome-headless # without the GUI
 +</code>
 +
 +For more tips and documentation, visit the [[https://github.com/evergreen-library-system/Evergreen/blob/main/Open-ILS/src/eg2/CHEAT_SHEET.adoc|Angular client cheat sheet]] and the [[https://nightwatchjs.org/v26/|Nightwatch documentation]].
 +
 +==== OPAC Javascript Unit Tests ====
 +
 +To run tests for the javascript in the OPAC:
 +<code sh>
 +cd Open-ILS/web/opac/deps
 +npm i && npm run test
 +</code>
  
 ==== Perl Unit Tests ==== ==== Perl Unit Tests ====
Line 95: Line 158:
  
 The "pgtap" package, which is not part of a standard Evergreen installation, must be installed and the extension must be added to your Evergreen database: The "pgtap" package, which is not part of a standard Evergreen installation, must be installed and the extension must be added to your Evergreen database:
 +
 +Install pgtap from source, the versions in Debian/Ubuntu are not well maintained and are from 2011 when they exist at all. Old versions don't contain all the functions used by Evergreen pgtap tests.
 +
 +  * Download from - http://pgxn.org/dist/pgtap/
 +  * Install Instructions - http://pgtap.org/documentation.html#installation
 +  * Install the package for libtap-parser-sourcehandler-pgtap-perl which provides pg_prove.
  
 <code sh> <code sh>
-sudo apt-get install pgtap # debian/ubuntu version+apt-get install libtap-parser-sourcehandler-pgtap-perl #Debian/Ubuntu provides pg_prove
 psql -U evergreen [other DB connection params] -c "CREATE EXTENSION pgtap;" psql -U evergreen [other DB connection params] -c "CREATE EXTENSION pgtap;"
 </code> </code>
dev/contributing/qa.1439395721.txt.gz · Last modified: 2022/02/10 13:34 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.