The following tests are testing a Docker deployment of an OSCAL Viewer interface calling a backend REST service. The Cypress tests check that everything appears on the screen as expected when making REST calls to files representing the various OSCAL objects.
Cypress is an end-to-end testing suite for running automated tests, in a browser, of web applications.
- To run the Cypress tests, you first need to have the create and run the Docker container. Directions for doing so can be found here. Following these instructions will have the container run in the background, used by Cypress to run the tests.
- Navigate to the
/end-to-end-tests
directory and runnpm install
- If Cypress has not been installed yet, run
npm install cypress --save-dev
. This installs Cypress as a devDependency for the project. - Run
npx cypress open
to run the tests. A window showing all Cypress tests will open. To run all tests, click the Run integration spec button. To run a specific test file, click on that file in the window. - If you make changes to a test file, the tests will run again after the changes are saved.
- To create a new Cypress test file, create a
.spec.js
file in thecypress/integration/OSCAL
directory.