Skip to content

Testing Methods

sjun521 edited this page May 9, 2021 · 14 revisions

Jest tests

  • our Jest testing was split up into frontend and backend testing.

1. frontend testing

To run our frontend test you need to input into the terminal

  1. cd frontend
  2. 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.

2. backend testing - testing axios calls

To run our frontend test you need to input into the terminal

  1. cd backend
  2. npm test

Functional tests

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

Clone this wiki locally