v5

Testing COSMOS

Cypress

Prerequesits

  1. Be sure NODE_EXTRA_CA_CERTS=/path/to/Globalsign.pem is included in environment variables.

  2. Rename (or delete) Cypress cache if it exists. (Usually located at AppData\Local\Cypress\Cache)

  3. Install Yarn

     npm install --global yarn
    
  4. Install Cypress

     COSMOS> npm install cypress
    

Cypress Testing

  1. Start COSMOS

     COSMOS> cosmos-control.bat start
    
  2. Open COSMOS in your browser. At the login screen, set the password to “password”.

  3. Navigate to cypress folder, install testing dependencies with yarn.

     cypress> yarn
    
  4. [Optional] Fix istanbul/nyc coverage source lookups (use fixlinux if not on Windows).

    Tests will run successfully without this step and you will get coverage statistics, but line-by-line coverage won’t work.

     cypress> yarn run fixwindows
    
  5. Open Cypress and run tests

     cypress> yarn run cypress open
    

Code coverage reports can be viewed at cypress/coverage/lcov-report/index.html

Unit Tests

  1. Navigate to cosmos folder. Run the command:

     cosmos> bundle exec rspec
    

Code coverage reports can be found at cosmos/coverage/index.html