uiowaSEP2024 / 002_ImagePro

Image processing backend
1 stars 0 forks source link

Fix cypress tests #120

Closed powersaudrey25 closed 6 months ago

powersaudrey25 commented 6 months ago

Overview

2 out of 4 of our Cypress tests were failing due to not being able to find the users in the database.

Implementation

Upon research I realized these tests did not need to be rewritten and instead it was a problem with seeding our db. I discovered that running 'python seed.py' does not seed our development database like I thought. Instead I found the file tasks.py in the backend directory that contains commands to seed, upgrade, drop, create, etc our dev db. Steps I took to fix the tests:

  1. navigated to backend directory
  2. ran python tasks.py db:dev:seed
  3. updated the password fields in the feature files to reflect the seeded passwords

Testing

  1. seed the dev database using the command above from tasks.py
  2. run psql -U postgres
  3. run select * from users; to verify seeded users are in the users table
  4. navigate to frontend directory and run npm run test:e2e to verify all tests pass (takes ~10 mins to run)

Problems Faced

I could not figure out how to seed the dev database, but the commands in tasks.py solved this issue. I will be posting those in our quickstart wiki page.

Notes

See the quickstart wiki page for more info on tasks.py. Since no tests needed to be re-written this was really a 1 point issue instead of 3.

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud