- Build the docker mampf container by running
docker-compose -f docker-compose.local.yml build
- execute the tests
docker-compose -f docker-compose.local.yml run cypress_runner
- Review the results in console and the results in
cypress/*
folder.
The describing test files can be found/ must be placed in spec/cypress/e2e/*.cy.js
.
You can call arbitrary functions/files in mampf by calling cy.app("clean")
for example located in spec/cypress/app_commands
.
Furthermore, you can setup special scenarios by providing a file in spec/cypress/app_commands/scenarios/
,
that can be called by cy.appScenario("setup")
for example. Always try to
create as much as you can in the scenario and then test the interaction!
For more information visit cypress-documentation.
Start the development version as usual. All commands are executed
in docker/development
Make sure that the seperate test db exist:
docker-compose exec mampf sh -c "RAILS_ENV=test rails db:create"
docker-compose exec mampf sh -c "RAILS_ENV=test rails db:migrate"
docker-compose exec mampf sh -c "RAILS_ENV=test rails db:test:prepare"
And make sure that the sunspot is uptodate:
docker-compose exec mampf sh -c "RAILS_ENV=test rake sunspot:reindex"
Now you can run the tests:
docker-compose exec mampf sh -c "RAILS_ENV=test rails spec"