generated from CS3219-AY2324S1/course-assessment-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'test-updated-merge' of https://github.com/CS3219-AY2324…
…S1/ay2324s1-course-assessment-g16 into test-updated-merge
- Loading branch information
Showing
1 changed file
with
51 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
|
||
### Features | ||
|
||
- provide video call function with audio | ||
- startCommunication : server socket events | ||
- provide audio call | ||
- startCommunication : server socket events for text based communication | ||
|
||
### Table of Contents: | ||
|
||
|
@@ -22,17 +22,17 @@ | |
|
||
#### Listening port | ||
|
||
http://localhost:3003 | ||
http://localhost:3007 | ||
|
||
|
||
#### Start the microservice on local machine by: | ||
|
||
1. Navigate to peerprep directory. | ||
1. Navigate to CommunicationService directory. | ||
|
||
2. Start the microservice in terminal using commands: | ||
|
||
``` | ||
cd peer-prep\src\backend\communication-service | ||
cd CommunicationService | ||
npm install | ||
npm start | ||
``` | ||
|
@@ -43,70 +43,90 @@ npm start | |
> [email protected] start | ||
> node server.js | ||
Communication service listening on port 3003 | ||
Communication service listening on port 3007 | ||
``` | ||
|
||
4. End communication service in terminal using `Ctrl+C`. | ||
|
||
|
||
#### For backend self-testing: | ||
|
||
Here demonstrate local testing using Webpage: | ||
Here demonstrate local testing using Postman: | ||
|
||
**Note**: | ||
1. In the history panel of Postman, click `new` button and select `Socket.io`. | ||
|
||
> This testing only available currently. | ||
2. Add events to listen include: | ||
|
||
1. Follow step 1 to step 3 in [Initiate Communication Service - Local Machine](#start-the-microservice-on-local-machine-by). | ||
- join | ||
- collaborator-joined | ||
- collaborator-recv-join | ||
- new-message | ||
- recv-message-log | ||
- called | ||
- answered | ||
- colllaborator-end-call | ||
- call-rejected | ||
- collaborator-disconnected | ||
- ice-candidate | ||
|
||
2. In browser, create 2 webpage with url: `http://localhost:3003`. | ||
3. Connect clients to server: | ||
|
||
3. Wait until `Call Collaborator panel` is initialized. | ||
Url 1: http://localhost:3007?sessionId=123c44c9-9bc3-402f-ba56-689eb0d2774d&userId=Gc2Bz9Nl8Wx4 | ||
|
||
4. Click on the `Call Collaborator panel` once in one of the pages, local video will be initiated. | ||
Url 2: http://localhost:3007?sessionId=123c44c9-9bc3-402f-ba56-689eb0d2774d&userId=PxJ3lVtWz8Kq | ||
|
||
5. The `Accept Button` in the other page will be enabled, click it. | ||
4. Test events using the message panel: | ||
|
||
6. Video call is enabled now. | ||
- recv-join | ||
|
||
7. Stop video call by clicking the `End Button`. Video call will be ended for both clients. | ||
- message | ||
|
||
8. End communication service in terminal using `Ctrl+C`. | ||
Arg1: string | ||
|
||
- get-message-log | ||
|
||
- call | ||
|
||
#### Jest testing | ||
Arg1: any | ||
|
||
1. Two terminal windows are required for Jest testing. | ||
- answer | ||
|
||
2. Initiate the communication service in first window by: | ||
Arg1: any | ||
|
||
``` | ||
cd peer-prep\src\backend\communication-service | ||
npm start | ||
``` | ||
- end-call | ||
|
||
- reject-call | ||
|
||
- disconnect | ||
|
||
- ice-candidate | ||
Arg1: any | ||
|
||
|
||
#### Jest testing | ||
|
||
3. Test the service in the other window using terminal commands: | ||
1. Test the service using terminal commands: | ||
|
||
``` | ||
cd peer-prep\src\backend\communication-service | ||
cd CommunicationService | ||
npm test | ||
``` | ||
|
||
4. Quit the server after finished testing using `Ctrl+C`. | ||
2. Quit the server after finished testing using `Ctrl+C`. | ||
|
||
|
||
#### Running in Docker | ||
|
||
**Note**: | ||
|
||
> Please delete the containers for other microservices. | ||
> Please ensure that there are no active container of the required services. | ||
1. Navigate to peerprep directory. | ||
1. Navigate to CommunicationService directory. | ||
|
||
2. Start the microservice in terminal using commands: | ||
|
||
``` | ||
cd peer-prep\src\backend\communication-service | ||
cd CommunicationService | ||
docker-compose up --build | ||
``` | ||
|
||
|
@@ -115,7 +135,7 @@ docker-compose up --build | |
``` | ||
> [email protected] start | ||
> node server.js | ||
> Communication service listening on port 3003 | ||
> Communication service listening on port 3007 | ||
``` | ||
|
||
4. End communication service in terminal using `Ctrl+C` twice. | ||
|