Skip to content

Cutscenes Test Plan

RileyWhitty edited this page Oct 17, 2023 · 4 revisions

Cutscenes Test Plan

Too test the cutscene system, both the Cutscene class and the CutsceneDisplay component need to be tested to ensure full coverage.

Cutscene Class

Since there is no significant branching within the the Cutscene class, only one path needs to be tested. This path involves the instantiation of the Cutscene object, the calling of the spawnCutscene method and then the calling of the endCutscene method at a later when the continue button is pressed in the Cutscene display. The spawnCutscene and endCutscene methods can be tested by observation since they mostly deal with UI component CutsceneDisplay. However, Junit tests can be implemented to test to see if the pauseGame and unPauseGame correctly modify the game state as well as using observation. The test plan for each individual method is shown below.

spawnCutscene

Used logging in each of the methods called to determine if the correct methods were called. Also used the terminal command dialogueScreen to observe that the spawnCutscene method works as intended with the game being paused and the cutscene display being spawned.

pauseGame

This method has not been fully tested yet. Have observed when called that the game does pause when this method is called and that the time does stop but NPC's, while stationary, still have some of their animations still running. Need to implement Junit tests to ensure that the game state is being properly changed when this method is called.

unPauseGame

This method has not been fully tested yet. Have observed that the game seems to run correctly as usual after this method is called. Need to implement Junit tests to ensure that the game state is being properly changed when this method is called.

endCutscene

Used logging in each of the methods called to determine if the correct methods were called. Also used the terminal command dialogueScreen to observe that the endCutscene method works as intended with the game being un-paused and the cutscene display being disposed.

CutsceneDisplay Component

Since there is no branching within the the CutsceneDisplay class, only one path needs to be tested. This path involves the spawning of all the UI elements (in sequential order) and then the clearing of all the elements when the continue button is pressed. This can be done almost entirely through observation since this component only generates/removes UI components and does not alter the game state with the only exception being the event handler that is attached to the continue button. The test plan for each individual method is shown below.

spawnCutsceneDisplay

Used logging in each of the methods called inside this method to ensure that the correct methods are called. Observed that the spawn cutscene display method correctly called the required methods and that the UI is correctly spawned. Used the debug mode on the table widget to see the layout of the table that would usually be invisible to determine that everything was spawned correctly in the right position. To enable the debug mode for the table widget remove the // from the front of line 77 in the cutscene display file.

dimScreen

Observed that this method correctly dims the screen.

placeSprite

Observed that this method correctly places the sprite in the top left cell of the table. Used the table debug mode to double check this.

spawnSprite

Used logging in each of the methods called inside this method to ensure that the correct methods are called. Observed that this method correctly calls the placeSprite method. Also saw that this method correctly handles the RADIO and ALIEN cutscene types by observing that the correct images were displayed in the cutscene.

spawnDialogueBox

Observed that this method correctly displays the dialogue text within the Typing Label. Also observed that it also correctly sizes the typing label widget and places it in the top right cell of the table widget. Used the table debug mode to double check this.

spawnContinueButton

Observed that this method correctly displays the continue button in the bottom right cell. Used logging to ensure that the button press event is handled and to check that the endCutscene method is called on the Cutscene object. Observed that pressing the button successfully ended the cutscene.

dispose

Observed that this method disposed of the entire UI generated by the CutsceneDisplay

Clone this wiki locally