Skip to content

Test Plan for Companion Lab window

gaurikadiwan edited this page Oct 5, 2023 · 1 revision

Introduction

The LabWindow class is responsible for creating a laboratory window in the game where players can interact with various potions and perform actions. This test plan outlines test scenarios to ensure that the LabWindow class functions correctly and displays potion images as expected.

Mock Stages

stage (Mock): Simulates the game stage.

potionStage (Mock): Simulates the stage for potion images.

Test Steps

  1. Create a new instance of LabWindow.

LabWindow labWindow = LabWindow.MakeNewLaboratory();

stage.addActor(labWindow);

  1. Add potion images to the potionStage.

addPotionImagesToStage(potionStage);

  1. Simulate a rendering cycle for the game.

Gdx.graphics.getGL20().glClearColor(0, 0, 0, 0); Gdx.graphics.getGL20().glClear(GL20.GL_COLOR_BUFFER_BIT);

  1. Render the potion images on the potionStage

potionStage.act(Gdx.graphics.getDeltaTime()); potionStage.draw();

  1. Assert that potion images are present on the potionStage using their actor names.

assertNotNull(potionStage.getRoot().findActor("DeathPotionImage"));

assertNotNull(potionStage.getRoot().findActor("SpeedPotionImage"));

Screenshot 2023-10-05 at 7 49 40 AM

Conclusion

This test plan verifies the creation of the LabWindow and the presence of potion images on the stage. It ensures that the LabWindow functions correctly and displays potion images as expected in the game.

Clone this wiki locally