first shell script to run frontend tests

This commit is contained in:
anovazzi1 2023-10-09 12:33:04 -03:00
commit d419fd6ee4
2 changed files with 44 additions and 6 deletions

31
src/frontend/run-tests.sh Executable file
View file

@ -0,0 +1,31 @@
#!/bin/bash
# Navigate to the project root directory (where the Makefile is located)
cd ../../
# Start the frontend using 'make frontend' in the background
make frontend &
# Give some time for the frontend to start (adjust sleep duration as needed)
sleep 10
#Run frontend only Playwright tests
cd src/frontend && npx playwright test --ui tests/onlyFront
# Start the backend using 'make backend' in the background
make backend &
# Give some time for the backend to start (adjust sleep duration as needed)
sleep 10
# Navigate back to the test directory
cd src/frontend
# Run Playwright tests
npx playwright test --ui tests/end-to-end
# After the tests are finished, you can add cleanup or teardown logic here if needed
# Terminate the background processes (backend and frontend)
pkill -f "make backend"
pkill -f "make frontend"