v5

Testing OpenC3

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

     OpenC3> npm install cypress
    

Cypress Testing

  1. Start OpenC3

     OpenC3> openc3.bat start
    
  2. Open OpenC3 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 openc3 folder. Run the command:

     openc3> bundle exec rspec
    

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