Skip to content
shackbarth edited this page Aug 22, 2013 · 13 revisions

How to setup testing the xTuple Mobile Application locally.

Configuration and Setup

The configuration must be correct in your login_data.js and config.js files in order for testing to work.

cd /path/to/xtuple
cp test/shared/sample_login_data.js login_data.js -- unless login_data.js already exists

Edit test/shared/login_data.js so that the username, password, and org are valid values that would allow you to log into the xtuple application if run locally. In a default installation, these values are admin, admin, and dev.

Edit the node-datasource/config.js by putting your database in the testDatabase field. In a default installation, this value is dev.

The tests also require mocha to be installed globally.

cd /path/to/xtuple
sudo npm install -g mocha

Mocha Testing

The build test should be run first, when the datasource is not running. This will test the build process, and provide a clean slate for further testing. This test assumes that you have a masterref database of version >= 4.1 at /path/to/xtuple/test/mocha/lib/demo-test.backup.

The test can be run with

npm run-script test-build

Most of our tests are integration tests using zombiejs and require a running datasource. These can be run with:

npm run-script test

The tests in the routes folder cannot be run at the same time as the tests that involve client-side zombie testing, because of namespace collisions. Use this command for those:

npm run-script test-datasource