Test Plan for QuickTimeEvent - UQcsse3200/2024-studio-2 GitHub Wiki
Objective
To validate the functionality and correctness of the QuickTimeEventDisplay and QuickTimeEventActions classes, ensuring that it correctly handles events, and updates gui components used for testing the QuickTimeEvent.
Test Coverage
-
Exit button returns to main menu
- Test Case:
exitButtonShouldReturnToMenu() - Purpose: Verify that the exit button returns user to main menu.
Steps:
- Trigger an
"exit"event - Verify that the screen is changed to
ScreenType.MAIN_MENU
Verification:
- Use
Mockitoto check that the mock game calls itssetScreen()method with parameterScreenType.MAIN_MENU
- Test Case:
-
Start button begins count down
- Test Case:
startButtonShouldDecCounter - Purpose: Verify that the start button will begin a count down process and that the gui display is updated with the correct time each second.
Steps:
- Trigger a
"start"event - Verify that counter display is no longer blank
- Add 1 sec to game time
- Verify that counter display is decremented by 1
Verification:
- Check that the text in the counter
Labelis no longer the empty string"" - Ensure that when 1 second passes, the counter text is updated with a number equal to one less it's previous value
- Test Case:
-
Count down transitions to quick-time event
- Test Case:
shouldStartQuickTimeEvent - Purpose: Verify that once the counter reaches zero, the quick-time events begin
Steps:
- Trigger a
"start"event - Continue adding 1 sec to game time until an event other than
"editLabel"is triggered - Verify that a
"startQuickTime"event is triggered
Verification:
- Use
getLastTriggeredEvent()to determine what event was last triggered on ui component - Ensure that we keep updating the ui until a new event is spotted
- Test Case:
-
Display handles fast input on quick-time event
- Test Case:
shouldHandleFastQuickTimeEvent - Purpose: Verify that
QuickTimeEventDisplaycorrectly handles fast button press that are too fast
Steps:
- Create an example quick-time event with duration 1 sec and delay 0.1 secs
- Trigger a
"startQuickTime"event - Increase the game and action times to 0.5 secs
- Initiate a key down event with
Keys.W - Verify that
"target_fast"image is displayed
Verification:
- Use
Mockitoto check that the spy display calls itssetTargetImage()method with parameter"target_fast"
- Test Case:
-
Display handles correct input on quick-time event
- Test Case:
shouldHandlePerfectQuickTimeEvent - Purpose: Verify that
QuickTimeEventDisplaycorrectly handles button presses that are within the right time window
Steps:
- Create an example quick-time event with duration 1 sec and delay 0.1 secs
- Trigger a
"startQuickTime"event - Increase the game and action times to 0.995 secs
- Initiate a key down event with
Keys.W - Verify that
"target_perfect"image is displayed
Verification:
- Use
Mockitoto check that the spy display calls itssetTargetImage()method with parameter"target_perfect"
- Test Case: