diff --git a/scripts/e2e-testing.sh b/scripts/e2e-testing.sh index 18a0efa..fc2a839 100644 --- a/scripts/e2e-testing.sh +++ b/scripts/e2e-testing.sh @@ -11,6 +11,8 @@ echo echo "Running end-to-end testing..." echo "Testing GET route '/api/v1'..." curl $API_URL/api/v1; echo +echo +echo ---------------------------------------------------------------- # Testing '/api/v1/labels'. echo @@ -37,13 +39,20 @@ curl -X DELETE $API_URL/api/v1/labels/3; echo echo echo "Testing GET route after DELETE '/api/v1/labels/:labelID'..." curl $API_URL/api/v1/labels/3; echo +echo +echo ---------------------------------------------------------------- # Test '/api/v1/bills' echo -echo "Using 'year' with value of 2023, 'month' with value of 5, and 'day' with value of 30 " echo "Testing GET route '/api/v1/bills'..." curl $API_URL/api/v1/bills; echo echo +echo "Testing POST route '/api/v1/bills'..." +curl -X POST -H 'Content-Type: application/json' -d '{"id": 10, "year": 2023,"month":6, "day": 10, "money": 200, "label": "shopping"}' $API_URL/api/v1/bills; echo + +# Test '/api/v1/bills/:year?/:month?/:day?' +echo +echo "Using 'year' with value of 2023, 'month' with value of 5, and 'day' with value of 30 " echo "Testing GET route '/api/v1/bills/:year'..." curl $API_URL/api/v1/bills/2023; echo echo @@ -52,11 +61,29 @@ curl $API_URL/api/v1/bills/2023/5; echo echo echo "Testing GET route '/api/v1/bills/:year/:month/:day'..." curl $API_URL/api/v1/bills/2023/5/30; echo + +# Test '/api/v1/bills/id/:billID' echo -echo "Testing POST route '/api/v1/bills" -curl -X POST -H 'Content-Type: application/json' -d '{"year": 2023,"month":6, "day": 10, "money": 200, "label": "shopping"}' $API_URL/api/v1/bills; echo - +echo "Using 'billID' with value of 10 (the one created beforehand)." +echo "Testing GET route '/api/v1/bills/id/:billID'..." +curl $API_URL/api/v1/bills/id/10; echo +# Test '/api/v1/bills/:billID' +echo +echo "Using 'billID' with value of 10 (the one created beforehand)." +echo "Testing PUT route '/api/v1/bills/:billID'..." +curl -X PUT -H 'Content-Type: application/json' -d '{"year": 2023,"month":6, "day": 10, "money": 21.2, "label": "transport"}' $API_URL/api/v1/bills/10; echo +echo +echo "Testing GET route after PUT '/api/v1/bills/:billID'..." +curl $API_URL/api/v1/bills/id/10; echo +echo +echo "Test DELETE route '/api/v1/bills/:billID'..." +curl -X DELETE $API_URL/api/v1/bills/10; echo +echo +echo "Testing GET route after DELETE '/api/v1/bills/id/:billID'..." +curl $API_URL/api/v1/bills/id/10; echo +echo +echo ---------------------------------------------------------------- ## Testing '/api/v1/auth/login'. #echo