-
Notifications
You must be signed in to change notification settings - Fork 3
Testing Methods
- our Jest testing was split up into frontend and backend testing.
To run our frontend test you need to input into the terminal
- cd frontend
- npm test
To perform the testing of the frontend we needed to test when and how the components rendered on the page. We did this by using the react testing library to
- check the rendering of all the components.
- check the form inputs in all pages.
- check the buttons in each of the components fires the correct event and submits the forms correctly.
- check whether dummy database data was correctly rendered on the page
- check that the html code correctly rendered in our page.
To run our frontend test you need to input into the terminal
- cd backend
- npm test
The backend testing was split between testing the rooms and the playlist. The testing consisted of whether or not the backend logic correctly responded to
(Rooms)
- creating a new room with a mixture of its data missing (e.g. no title, no password,... etc
- Joining an existing room with and without a password
- when joining a room whether the user was denied when a password was wrong
(Playlist)
- adding a new song with missing room information
- trying to add a song to a non existent room
- adding a song with missing song information (e.g. no title, no url,... etc)
- retrieveing the playlist with missing room information
- trying to get a playlist from a non existent room
For socket.io related functionality, JEST tests did not provide a meaningful way of testing the exchanges and logic behind the server. Functional testing on the other hand, provided a much indicative way of testing difference scenarios that could occur when using the application.
To perform the following tests, the backend and frontend should both be running. Rooms will need to created through the Create Room page and joined via the Join Room page (the Room ID for each room can be found in the header of the Room page). According to the scenarios, the tester may have create/join one or more room instances to test different functionalities of the application. All the instances need to be displayed on screen for these tests to run properly. The Google Chrome browser is recommended for these tests. The list below shows some of the tests that were performed, designed to simulate different use cases and scenarios.
| ID | Test procedure | Expected | Results |
|---|---|---|---|
| 1 | 1. Connect a client to a room 2. Search and add one or more songs |
Playlist displays and starts playing newly added song | Pass |
| 2 | 1. Connect more than 1 client to the same room 2. Search and add one or more songs |
Playlist displays and starts playing newly added song for all clients | Pass |
| 3 | 1. Connect a client to a room 2. Search and add one or more songs 3. Click vote skip button |
Song gets skipped and removed from playlist | Pass |
| 4 | 1. Connect 2 clients to the same room 2. Search and add one or more songs 3. Click vote skip button in client 1 |
- Both clients display vote status - Client 1 displays "You have voted yes." - Client 2 displays "You have not voted." |
Pass |
| 5 | 1. Connect more than 1 client to the same room 2. Search and add one or more songs 3. Click vote skip button in client 1 4. Click vote skip button in client 1 again |
The displayed vote status closes for both clients | Pass |
| 6 | 1. Connect 2 clients to the same room 2. Search and add one or more songs 3. Click vote skip button in client 1 4. Click vote skip button in client 2 |
1. The displayed vote status closes for both clients 2. Song gets skipped and removed from playlist |
Pass |
| 7 | 1. Connect more than 2 clients to the same room 2. Search and add one or more songs 3. Click vote skip button in client 1 4. Click vote skip button in client 2 |
The displayed vote status updates for all connected clients | Pass |
| 8 | 1. Connect more than 2 clients to the same room 2. Search and add one or more songs 3. More than 75% of the connected clients click vote skip |
1. The displayed vote status closes for all clients 2. Song gets skipped and removed from playlist |
Pass |
| 9 | 1. Connect 2 clients to different rooms 2. Search and add one or more songs in both rooms 3. Click vote skip button in room 1 |
- Song gets skipped and removed from playlist in room 1 - Song in room 2 continues playing |
Pass |
| 10 | 1. Perform tests 1-8 but repeat step 1 twice to have clients join 2 different rooms 2. Perform the rest of the steps on one of the rooms |
The same results are expected but only in the room that the actions were performed in. | Pass |
Group 39 Cream Cat - Andy Huang, Sunho Jung, Wenxin Pan, Kevin Yee
2021 Semester 1, CompSci 732 / SoftEng 750 - University of Auckland