Testing Planning for Loading system - UQcsse3200/2024-studio-1 GitHub Wiki
Objective
This plan aims to ensure the robust functionality of the Character Loading System, which is responsible for correctly loading and initializing a player entity with the saved state from a JSON file. The goal is to validate that key attributes, including the player's health, collected items, and equipped weapons, are accurately loaded and applied to the entity.
Limitations
Conducting a comprehensive JUnit test at this stage is challenging due to the complexity of mocking multiple dependencies. However, the functionality can be effectively tested through manual validation within the MainGameScreen. Detailed instructions for manual testing are provided below.
Instructions for Manual Testing
The character's state is loaded using the player_save.json
file located in the assets/configs
directory. When the user selects the "Load" option, the PlayerFactory
should correctly create a player entity using the configuration stored in the JSON file.
player_save.json
:
Sample {
"name": "default",
"health": 60,
"favouriteColour": "peach",
"textureFilename": "images/player/player.png",
"textureAtlasFilename": "images/player/player.atlas",
"melee": "knife",
"range": "shotgun",
"items": ["bandage", "energydrink"]
}
In addition to default attributes such as name, health, and favourite colour, the player_save.json
file contains a list of items the player has collected during the game, as well as the equipped melee and ranged weapons.
Expected Outcome
Picture taken from individual branch When the game loads the player's saved state:
- The UI should display a list of items, including bandage and energydrink, in the player's inventory.
- The equipped weapons (melee: knife, ranged: shotgun) should be reflected in the player's inventory, with the correct quantities displayed in the UI.
Picture taken from main branch The screenshot shows that health is loaded successfully, which state that data is loaded, but due to labelling and some issue when merged into main the UI didn't update the corresponding information like the old UI did
Current Issue
The changes and updates from player-ui does not handle the case from loading items from the system even though data is loaded, need to be fixed to be adapted later. Though so the health was displayed correctly which state that the data is loaded successfully
What should be fixed in next sprint
The Display UI for both items and weapons should be added new method for updating the correct number of items and weapons in order to enhance the user's experience