Skip to content

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Aug 10, 2023

E2E test for downloading a torrent file.

Subtasks

  • Clean the torrent (in the database and filesystem) after passing the test.
  • Delete the temporarily registered users.

@josecelano josecelano linked an issue Aug 10, 2023 that may be closed by this pull request
Some test register a new user (we have not share the same account so far).
The newly generated user remains in the database after executing the
test. This commit cleans the database removing the user.
@josecelano josecelano requested review from mickvandijke and removed request for mickvandijke August 10, 2023 15:54
@josecelano
Copy link
Member Author

Hi @mario-nt @grmbyrn, this is an example of E2E testing in the frontend app.

  • I've added some new tests for torrent downloads.
  • I've also added a new test for torrent upload (only registered users can upload torrents).
  • I've added code to clean the database after running the tests (remove test torrents and users).

Hi @Wolfremium13, I do not like to clean the database running DELETE SQL queries because tests are coupled to the database implementation.

For the torrents, there is an option in the UI to delete a torrent, but I do not know if it's a good idea to couple one test with another feature. Although we already have commands to execute common steps like login, registration, etcetera.

For the app users, there is no option in the app to delete users, so we do not have an alternative. We need to delete records in the inverse order of dependency between tables.

With these changes the database should be empty after executing all tests.

@josecelano josecelano marked this pull request as ready for review August 10, 2023 16:03
@josecelano josecelano merged commit a556a36 into torrust:develop Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

E2E tests: download a torrent
1 participant