:warning: This project relies heavily on https://github.com/hitobito/development, so you might start there and get it working before checking out this repo.
git clone https://github.com/scout-ch/midata-cypress.git
cd midata-cypress
git clone https://github.com/hitobito/development.git
cd development/app
git clone https://github.com/hitobito/hitobito.git
git clone https://github.com/hitobito/hitobito_youth.git
git clone https://github.com/hitobito/hitobito_pbs.git
cd ../..
docker-compose pull
docker volume create hitobito_bundle
docker volume create hitobito_yarn_cache
docker-compose run --rm cypress
# edit tests and continue…
# when finished:
docker-compose down
Generally check the docs:
docker-compose run --rm cypress
# edit tests and continue…
# when finished:
docker-compose down
If you want to run the tests against a running dev server:
docker-compose run --rm --no-deps -e CYPRESS_BASE_URL=http://rails:3000 cypress
Note: You can only connect to servers running inside docker-compose. If you need to connect to servers outside (aka you only wan't to run cypress in docker), check here.
docker-compose up -d rails worker
yarn install --frozen-lockfile
yarn run ci:wait && yarn run cypress:open
xhost local:root
to allow the root user from the Docker container to send messages to the X serverdocker-compose run cypress-gui
This will run hitobito with Cypress (if it is not already running), wait for the seeding to finish and then open the Cypress GUI.It is probably easier, faster and cleaner to use cypress directly (check above).
brew cask install xquartz
) and restart your machineIP=$(ipconfig getifaddr en0)
. (You might want to adjust the en0
to your network interface of choice…)xhost + $IP
to allow the Docker container to send messages to the X serverRun DISPLAY=$IP:0 docker-compose run cypress-gui
Not yet tested
https://dev.to/darksmile92/run-gui-app-in-linux-docker-container-on-windows-host-4kde
When you have set everything up, you should be able to start the same as on the mac…
If you don't want to run the test server on port 3000 or on another host you can either edit the baseURL in .docker/cypress/spec/cypress.json
or set an env var before starting: export CYPRESS_BASE_URL=http://localhost:8080