Skip to content

PlanetTravel Testing Plan

Henry Batt edited this page Oct 18, 2023 · 4 revisions

Introduction:

The PlanetTravel code is integral to the core gameplay of the game being in charge of switching from the current level to the next level or returning back to the level after existing to a separate screen for information display or additional activities outside the core levels.

Test Plan:

Objective:

To ensure that the PlanetTravel behaves in the correct manner for each type of transition that can be triggered and that it goes to the correct area and all state data is appropriately updated through the following:

  • Calling a full planetary travel correctly transitions to the minigame setup.
  • Triggering an instant travel moves to the correct location and updates game state data.
  • Attempting to return to the previous planet behaves as expected.

Methodology:

SetUp (BeforeEach):

  • Mock up a game to transition through.
  • Register the GameStateObserver with the ServiceLocator.
  • Setup the GameStateObserver service with appropriate data on the current planet, and its next planet.
  • Create a PlanetTravel instance to call.

CleanUp(AfterEach):

  • Clear the ServiceLocator after use.

Test Case 1: testServiceSetup

Objective: To ensure that all required Services for the PlanetTravel are setup.

Steps:

  • Verify that Services exist inside the ServiceLocator.

Test Case 2: testFullTravel

Objective: To ensure that when a full experience travel is called, we correctly transition to the correct screen to begin gameplay.

Steps:

  • Call the full travel transition
  • Verify that the correct screen was set for gameplay.

Test Case 3: testInstantTravel

Objective: To ensure that when an instant travel is called, the game state is set correctly, and we end up in the correct location.

Steps:

  • Load in the expected next planet from the config.
  • Trigger the transition
  • Verify that the planet we ended up on was the same as expected.

Test Case 4: testReturnToCurrent

Objective: To ensure that when we attempt to return to the current planet we go to the correct one.

Steps:

  • Trigger the return to the planet.
  • Verify that the planet we returned to had the correct, expected, name.

Test Case 5: testPlanetTravel

Objective: To ensure that moving to a planet ends up in the correct.

Steps:

  • Move to a random planet ("Earth")
  • Verify the planet we are now on is "Earth".
  • Repeat for an additional planet "Mars" to ensure it is correctly overwritten.

Dependencies:

  • The PlanetTravel test is dependent on the config files for the Planet "Earth" existing.
Clone this wiki locally