-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from Capstone-Projects-2024-Spring/BP-278-Rem…
…ove-inapplicable-Integration-Tests-and-update-existing-ones Bp 278 remove inapplicable integration tests and update existing ones
- Loading branch information
Showing
6 changed files
with
520 additions
and
376 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
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 |
---|---|---|
@@ -1,145 +1,229 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
# Integration tests | ||
# Integration Tests | ||
|
||
|
||
You can find the generated integration test report [here.](https://htmlpreview.github.io/?https://github.com/Capstone-Projects-2024-Spring/project-blastpad/blob/assets/integration-report.html) | ||
|
||
|
||
Tests to demonstrate each use-case based on the use-case descriptions and the sequence diagrams. External input should be provided via mock objects and results verified via mock objects. Integration tests should not require manual entry of data nor require manual interpretation of results. | ||
|
||
## Integration Test for Use Case 4 | ||
This integration test is for the scenario where the user debugs a Blockly game they created. | ||
- Input: Void | ||
- Expected Output: True | ||
|
||
``` | ||
public Use_Case_4_Integration_Test(Void) -> Boolean | ||
# Starting Blast Pad | ||
deviceManager = New DeviceManager() | ||
|
||
# Open gallery to view games | ||
deviceManager.loadGallery() | ||
|
||
# View games in the gallery | ||
Games gamesArray = deviceManager.Gallery.viewGames() | ||
## Integration Test for Use Case 1 | ||
A user would like to play a game on their BlastPad. | ||
|
||
1. Upon turning on the BlastPad the user is routed to the Homescreen. | ||
2. Upon pressing the "Code Editor" button the user is sent to the Blockly Code Editor. | ||
3. Upon Pressing the "Create New Game" button the user is able to manipulate blocks in the editor and save the game to storage. | ||
|
||
<details open="True"> | ||
- Runs `Blockly Compiler / Game Compiles` unit test. | ||
- Runs `Blockly Compiler / Compiled Game Runs` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Integration Test for Use Case 2 | ||
A user would like to develop a game using the BlastPad. | ||
|
||
1. Upon turning on the BlastPad the user is routed to the Homescreen. | ||
2. Upon pressing the "Code Editor" button the user is sent to the Blockly Code Editor. | ||
3. Upon Pressing the "Create New Game" button the user is able to manipulate blocks in the editor and save the game to storage. | ||
|
||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Saved Games` unit test. | ||
- Runs `Flask / Access Editor` unit test. | ||
- Runs `Blockly Compiler / Game Compiles` unit test. | ||
- Runs `Flask / Save Game` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Integration Test for Use Case 3 | ||
A user would like to develop a game for the BlastPad with their laptop. | ||
|
||
1. Upon startup, the BlastPad starts the flask server. | ||
2. Upon connecting to blastpad.local:8000/editor, the user is presented with the editor. | ||
3. Upon pressing the "Save Game" button, the workspace is saved to the BlastPad. | ||
|
||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Saved Games` unit test. | ||
- Runs `Flask / Access Editor` unit test. | ||
- Runs `Blockly Compiler / Game Compiles` unit test. | ||
- Runs `Flask / Save Game` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
|
||
## Integration Test for Use Case 4 | ||
A user’s Blockly code fails during compilation and they would like to view the error message in order to debug their blocks. | ||
|
||
1. Upon startup, the BlastPad starts the flask server. | ||
2. Upon connecting to blastpad.local:8000/editor, the user is presented with the editor. | ||
3. Upon pressing the "Save Game" button, the workspace is not saved and an error message is displayed. | ||
|
||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Saved Games` unit test. | ||
- Runs `Flask / Access Editor` unit test. | ||
- Runs `Blockly Compiler / Game Compiles` unit test. | ||
- Runs `Flask / Fail to Save Game` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
|
||
# Open a game that doesn't compile in the Blockly Editor | ||
deviceManager.BlockEditor.loadWorkspace(gamesArray[0]) | ||
|
||
# Compile the game and store the compilation status message | ||
output = deviceManager.BlockEditor.workspaces[0].compileGame() | ||
|
||
# Check if the compilation failed | ||
return output != "Successful Compilation!" | ||
``` | ||
|
||
## Integration Test for Use Case 5 | ||
This integration test is for the scenario where the user creates an account | ||
- Input: username (String), password (String) | ||
- Expected Output: True | ||
A user would like to join a classroom from the BlastPad. | ||
|
||
1. Upon turning on the BlastPad the user is routed to the Homescreen. | ||
2. Upon pressing the "Settings" button the settings page is displayed. | ||
3. Upon pressing the "Join Classroom" button, the user is able to join a classroom. | ||
|
||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Saved Games` unit test. | ||
- Runs `Flask / Retrieve Games from a Classroom` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
|
||
|
||
|
||
``` | ||
public Use_Case_5_Integration_Test(string username, string password) -> Boolean | ||
# Starting Blast Pad | ||
deviceManager = New DeviceManager() | ||
|
||
# Create account (method returns true if successfully created) | ||
return deviceManager.UserManager.createAccount(username, password) | ||
``` | ||
|
||
## Integration Test for Use Case 6 | ||
This integration test is for the scenario where the user joins a classroom | ||
- Input: classroom_id (int) | ||
- Expected Output: True | ||
A user would like to view their classmate's games and play one. | ||
|
||
``` | ||
public Use_Case_5_Integration_Test(int classroom_id) -> Boolean | ||
# Saving classroom that user wants to join | ||
classroom = New Classroom(classroom_id) | ||
|
||
# Starting Blast Pad | ||
deviceManager = New DeviceManager() | ||
1. Upon turning on the BlastPad the user is routed to the Homescreen. | ||
2. Upon pressing the "Settings" button the settings page is displayed. | ||
3. Upon pressing the "Join Classroom" button, the user is able to join a classroom. | ||
4. Upon pressing the "Classroom" button, the user is able to view games in a classroom. | ||
5. Upon pressing the "Download Game" button, the user is able to download and play a game from the classroom. | ||
|
||
# Open gallery to access Classroom Manager | ||
deviceManager.loadGallery() | ||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Saved Games` unit test. | ||
- Runs `Flask / Retrieve Games from a Classroom` unit test. | ||
- Runs `Flask / Download Game from Classroom` unit test. | ||
- Runs `Blockly Compiler / Game Compiles` unit test. | ||
- Runs `Blockly Compiler / Compiled Game Runs` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
# Join classroom (method returns true if successfully joined) | ||
return deviceManager.Gallery.ClassroomManager.joinClassroom(classroom) | ||
``` | ||
|
||
## Integration Test for Use Case 7 | ||
|
||
A user would like to view their classmate's games and play one. | ||
|
||
Stubbed functional units: ClassroomManager, example database with classrooms, BlocklyCompiler | ||
|
||
• Verify that ClassroomManager can initialize correctly | ||
• Verify that ClassroomManager can communicate with the example database | ||
• Verify that ClassroomManager returns classrooms from the example database when viewClassrooms() is called | ||
• Verify that ClassroomManager can view the games stored inside one of the returned classrooms | ||
• Verify that BlocklyCompiler can compile one of the games stored in the classroom | ||
|
||
## Integration Test for Use Case 8 | ||
|
||
|
||
## Integration Test for Use Case 7 | ||
A user would like to upload a game to a Classroom | ||
|
||
Stubbed functional units: ClassroomManager, example database with classrooms | ||
1. Upon turning on the BlastPad the user is routed to the Homescreen. | ||
2. Upon pressing the "Settings" button the settings page is displayed. | ||
3. Upon pressing the "Join Classroom" button, the user is able to join a classroom. | ||
4. Upon pressing the "Share to Classroom" button, the user is able to share their game to a classroom. | ||
|
||
• Verify that ClassroomManager can initialize correctly | ||
• Verify that ClassroomManager can communicate with the example database | ||
• Verify that ClassroomManager can call a classroom's uploadGame() method | ||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Saved Games` unit test. | ||
- Runs `Flask / Retrieve Games from a Classroom` unit test. | ||
- Runs `Flask / Upload Game to Classroom` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
## Integration Test for Use Case 9 | ||
|
||
A user/teacher would like to a create a classroom to host BlastPad projects for students | ||
|
||
Stubbed functional units: BlastPad website, example database with classrooms | ||
|
||
• Verify that a classroom can be added to the example database with a query. | ||
• Verify that a shortlink to the classroom can be generated. | ||
|
||
|
||
## Integration Test for Use Case 10 | ||
## Integration Test for Use Case 8 | ||
A user would like to view the games on the Community Hub and play one. | ||
|
||
A user/teacher would like to approve an uploaded game to be visible in the Classroom | ||
1. Upon turning on the BlastPad the user is routed to the Homescreen. | ||
2. Upon pressing the "Community Hub" button, the user is able to join a classroom. | ||
3. Upon pressing the "Download Game" button, the user is able to download and play a game from the community hub. | ||
|
||
Stubbed functional units: BlastPad website, example database with classrooms | ||
|
||
• Verify that a classroom's games can be retrieved from the example database with a query. | ||
• Verify that a game in a pending state can be filtered from a list of retrieved games. | ||
• Verify that this game can be downloaded from the database with a query. | ||
• Verify that the game's pending state can be changed to an approved state with a query. | ||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Saved Games` unit test. | ||
- Runs `Flask / Retrieve Games from the Community Hub` unit test. | ||
- Runs `Flask / Download Game from Community Hub` unit test. | ||
- Runs `Blockly Compiler / Game Compiles` unit test. | ||
- Runs `Blockly Compiler / Compiled Game Runs` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
|
||
## Integration Test for use case 1 | ||
- Runs `compileBlocklyToPython()` unit tests. | ||
- Runs `startGame()` unit tests. | ||
- Passes if all tests pass. | ||
|
||
## Integration Test for use case 3 | ||
- Runs `createNewGame()` unit tests. | ||
- Runs `saveGame()` unit tests. | ||
- Passes if all tests pass. | ||
|
||
## Integration Test for Use Case 2 | ||
|
||
A user would like to develop a game using the BlastPad | ||
|
||
Stubbed Functional Units: Blockly Code Editor, Device Manager, Gallery | ||
## Integration Test for Use Case 9 | ||
A user would like to upload a game to the Community Hub. | ||
|
||
### Assertions | ||
1. Upon turning on the BlastPad the user is routed to the Homescreen. | ||
4. Upon pressing the "Share to Community Hub" button, the user is able to share their game to a community hub. | ||
|
||
1. Upon turning on the BlastPad the user is routed to the Homescreen (Device Manager: loadGallery() unit test) | ||
2. Upon pressing the "Code Editor" button the user is sent to the Blockly Code Editor (Gallery: openCodeEditor() unit test) | ||
3. Upon Pressing the "Create New Game" button the user is able to manipulate blocks in the editor and save the game to storage (BlocklyEditor: saveWorkSpace() unit test) | ||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Saved Games` unit test. | ||
- Runs `Flask / Retrieve Games from the Community Hub` unit test. | ||
- Runs `Flask / Upload Game to Community Hub` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
## Integration Test for Use Case 11 | ||
|
||
A user would like to configure the WiFi | ||
|
||
Stubbed Functional Units: Configuration, Device Manager, Gallery | ||
## Integration Test for Use Case 10 | ||
A user/teacher would like to a create a classroom to host BlastPad projects for students | ||
|
||
### Assertions | ||
1. Upon turning on the BlastPad the user is routed to the Homescreen. | ||
2. Upon pressing the "Settings" button the settings page is displayed. | ||
3. Upon pressing the "Create" tab, the create classroom dialog is displayed. | ||
4. Upon pressing the "Create Classroom" button, the user's classroom is added to the database of classrooms. | ||
|
||
1. Upon turning on the BlastPad the user is routed to the Homescreen (Device Manager: loadGallery() unit test) | ||
2. After pressing the "WiFi" button the user is sent to the WiFi configuration screen (Gallery: openConfiguration() unit test) | ||
3. The user is shown a list of available networks on the Configuration screen (Configuration: scan() unit test) | ||
4. Then a network is selected and the user enters in a security key and presses the "Connect" button (Configuration: connect(SSID, securityKey) unit test) | ||
|
||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Saved Games` unit test. | ||
- Runs `Flask / Create Classroom` unit test. | ||
- Passes if all tests pass. | ||
</details> | ||
|
||
|
||
|
||
## Integration Test for Use Case 11 | ||
A user would like to configure the WiFi for the BlastPad. | ||
|
||
1. Upon turning on the BlastPad the user is routed to the Homescreen | ||
2. Upon pressing the "Settings" button the user is sent to the settings page | ||
3. Upon pressing the "Wi-Fi" tab, the user is presented with the wifi configuration dialog. | ||
4. The user is shown a list of available networks on the configuration dialog. | ||
5. Upon selecting a network, the user is able to enter the network's password. | ||
6. Upon successfully entering the network's password, the BlastPad is connected to the network. | ||
|
||
<details open="True"> | ||
- Runs `Flask / Access Home Screen` unit test. | ||
- Runs `Flask / Get Local Wifi Networks` unit test. | ||
- Passes if all tests pass. | ||
</details> |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
# Unit tests | ||
# Unit Tests | ||
|
||
|
||
## Unit Test Reports | ||
|
Oops, something went wrong.