Testing OpenC3
Cypress
Prerequesits
-
Be sure
NODE_EXTRA_CA_CERTS=/path/to/Globalsign.pem
is included in environment variables. -
Rename (or delete) Cypress cache if it exists. (Usually located at
AppData\Local\Cypress\Cache
) -
Install Yarn
npm install --global yarn
-
Install Cypress
OpenC3> npm install cypress
Cypress Testing
-
Start OpenC3
OpenC3> openc3.bat start
-
Open OpenC3 in your browser. At the login screen, set the password to “password”.
-
Navigate to cypress folder, install testing dependencies with yarn.
cypress> yarn
-
[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
-
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
-
Navigate to openc3 folder. Run the command:
openc3> bundle exec rspec
Code coverage reports can be found at openc3/coverage/index.html