Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix E2E tests #692

Merged
merged 5 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
chmod 0600 $PGPASSFILE
backend/db-setup/create-db.sh
- name: Run API
env:
env:
OKTA_API_KEY: ${{ secrets.OKTA_API_KEY }}
OKTA_OAUTH2_CLIENT_ID: ${{ secrets.OKTA_OAUTH2_CLIENT_ID }}
run: cd backend; ./gradlew bootRun --args='--spring.profiles.active=dev' &> ../gradle-log.txt &
Expand All @@ -76,5 +76,7 @@ jobs:
run: cd frontend; yarn
- name: Run frontend
run: cd frontend; yarn start &> ../yarn-log.txt &
- name: Build e2e container images
run: cd frontend/e2e; docker-compose build
- name: Run e2e tests
run: docker-compose -f frontend/e2e/docker-compose.yml --env-file frontend/e2e/.env run nightwatch ./nightwatch-entrypoint.bash;
run: cd frontend/e2e; docker-compose run nightwatch ./nightwatch-entrypoint.bash;
2 changes: 0 additions & 2 deletions frontend/e2e/.env

This file was deleted.

18 changes: 1 addition & 17 deletions frontend/e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,15 @@ services:
- HUB_PORT=4444
- START_XFVB=FALSE

chrome:
image: selenium/node-chrome
command: bash -c "sudo chown -R seluser:seluser /app && /opt/bin/entry_point.sh"
network_mode: "host"
volumes:
- /dev/shm:/dev/shm
- downloads:/app/downloads
depends_on:
- selenium-hub
environment:
- HUB_HOST=localhost
- HUB_PORT=4444
- NODE_PORT=5556
- START_XFVB=FALSE

nightwatch:
image: gitlab-dev.bespinmobile.cloud:4567/gearfit/gearfit/nightwatch:latest
build: .
network_mode: "host"
depends_on:
- firefox
- chrome
volumes:
- /dev/shm:/dev/shm
- "${E2E_DIR}:/app/e2e"
- ".:/app/e2e"
- downloads:/app/downloads

volumes:
Expand Down
16 changes: 8 additions & 8 deletions frontend/e2e/pages/patients.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ module.exports = {
editPatient: {
selector: '.prime-edit-patient',
elements: {
firstName: '#text-4-1',
lastName: '#text-8-1',
facility: '#drop-14-1',
dob: '#text-16-1',
phone: '#text-18-1',
address: '#text-22-1',
state: '#drop-30-1',
zip: '#text-32-1',
firstName: 'input[name="firstName"]',
lastName: 'input[name="lastName"]',
facility: 'select[name="currentFacilityId"]',
dob: 'input[name="birthDate"]',
phone: 'input[name="telephone"]',
address: 'input[name="street"]',
state: 'select[name="state"]',
zip: 'input[name="zipCode"]',
resident: 'input[name="residentCongregateSetting"]+label',
healthcareWorker: 'input[name="employedInHealthcare"]+label',
saveButton: '.prime-save-patient-changes',
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"lint:prettier": "prettier -c ./src",
"lint:write": "prettier --write ./src",
"test": "TZ='UTC' react-scripts test",
"e2e": "docker-compose -f e2e/docker-compose.yml --env-file e2e/.env run nightwatch ./nightwatch-entrypoint.bash; docker-compose -f e2e/docker-compose.yml --env-file e2e/.env down -v",
"e2e": "cd e2e; docker-compose build; docker-compose run nightwatch ./nightwatch-entrypoint.bash; docker-compose down -v; cd ..",
"eject": "react-scripts eject",
"compile-scss": "node-sass --include-path ./src/scss --include-path ./node_modules/uswds/dist/scss --output-style compressed -o ./src/styles/ ./src/scss/App.scss",
"watch-css": "yarn compile-scss && node-sass --include-path ./src/scss --include-path ./node_modules/uswds/dist/scss -o src/styles/ --watch --recursive src/scss/App.scss",
Expand Down