Skip to content

Enemies' Features Test Plans

mhUnt3rS edited this page Oct 19, 2023 · 7 revisions

Introduction:

This page outlines all the test plans that interact with the enemies entities. The test plans identify the objective, the methodolgy.

Test Plan for Boss Basic Melee

Objective:

To validate that the Boss is attacking

Methodology:

Test through video. Boss will bump into player, deal damage to player and then apply knockback. You will see that the health of player decreases, the player is bumped away from the Boss, and an attack animation is played.

Test Plan for Boss Special Attack

Objective:

To validate the Boss’ Special attack activates at 50% HP

Methodology:

Test through video. Once Boss is 50% HP or below, the Boss will unleash a ring of projectiles that move outward.

Test Plan for Enemy Animations

Objective:

To validate that the small enemies are visually moving and acting

Methodology:

Test through video. Enemies will wander when not targeting the enemy, should be in a non-aggressive stance. Once player is in line of sight of enemy, then enemy will start moving towards the player. Once adjacent to player, the enemy will trigger an attack animation. If enemy is at 0% HP, then enemy will trigger death animation.

Test Plan for Drop Component

Objective:

To validate that the enemies drop a material when they die.

Methodology:

Test through video. When player defeats enemy, they will trigger death animation and despawn. On the coordinate they despawn a random material, and should show up on screen.

Test Plan for Enemy Sprite Scaling

Objective:

To change the size of enemy sprites.

Methodology:

  • Apply changes to code and test through video
  • Do initial game test; Start GdxGame
  • Walk to an enemy; See the enemy sizes
  • Access the EnemyFactory Class.
  • Change scale sizes depending on how large the sprites should be, each enemy has a different value
  • Save and test in the game; Start GdxGame
  • Walk to an enemy; Their size should be different.

Test Plan for Run Task (completed in RunTaskTest)

Objective:

Enemy should move away from target once in range.

Methodology:

Test 1: Entity should run once target is within range Steps: MOck a GdxGame Create target entity and set its position within game Create a new entity, and add the AITaskComponent with a new run task taking the target entity, priority 10 and run distance 5 as its parameters. Then set its position within the run range of the target. Loop through and update the entity and physics service Assert that the distance between the player and target has increased

Test 2: Tesk should have priority 10 once target is in range Steps: Mock a GdxGame Create target entity and set its position within game Create a new entity, and add the AITaskComponent with a new run task taking the target entity, priority 10 and run distance 5 as its parameters. Then set its position within the run range of the target. Assert that the priority is 10

Test 3: Tesk should have priority -1 when target is not in range. Steps: MOck a GdxGame create target entity and set its position within game Create a new entity, and add the AITaskComponent with a new run task taking the target entity, priority 10 and run distance 5 as its parameters. Then set its position outside of the run range from the target.. Assert that the priority is -1.

Functionality Demonstrations

Enemy.functionality.Tests.mp4

Sprint 3

For all Boss Functionality Demonstration, Please [click here](Enemy Wiki) and check out each respective Boss Attack.

Test Plan for SpawnAttackTask (Summoner Boss)

  • Objective: To ensure the task is spawning entities appropriately.
  • Methodology: Test through in-game testing.
    • Do initial game test; Start GdxGame
    • Walk to summoner enemy
    • Ensure that summoner enemy initially spawns only 2 enemies.
    • Kill one of the spawned enemies.
    • Ensure that the summoner enemy spawns only 1 new enemy.
    • Kill both of the spawned enemies.
    • Ensure that only 2 new enemies are spawned.

Test Plan for God Task (Final Boss)

  • Objective: Spawn Final Boss, watch its attack functionality
  • Methodology: Test through in-game testing
    • Specify in Spawner.json file for Final Boss to spawn; request for only one boss
    • Start GdxGame
    • Wait for boss to spawn on map, assuming the spawner already exists on map.
    • Walk towards Final Boss, and see multiple projectiles firing out of boss
    • Many Projectiles should be firing in a spiral shape.

Test Plan for Spray Task (Ranged Boss)

  • Objective: Spawn Ranged Boss, watch its attack functionality
  • Methodology: Test through in-game testing
    • Specify in Spawner.json file for Ranged Boss to spawn; request for only one boss
    • Start GdxGame
    • Wait for boss to spawn on map, assuming the spawner already exists on map.
    • Walk towards Ranged Boss, and see multiple projectiles firing out of boss
    • 3 Projectiles should be firing periodically

Sprint 4

Test Plan For Spawn Attack Task/Necromancer

Test 1

Objective: Task should be inactive when it does not need to spawn enemies.

  • Methodology: Test through J unit testing.
    • Mock a GdxGame
    • Create target entity and set its position within game.
    • Create a new entity, and add the AITaskComponent with a new SpawnAttackTask which has the maximum number of entities spawned as 0.
    • Assert that the priority is less than 0

Test 2

Objective: Task should be active when it needs to spawn enemies.

  • Methodology: Test through J unit testing.
    • Mock a GdxGame
    • Create target entity and set its position within game.
    • Create a new entity, and add the AITaskComponent with a new SpawnAttackTask which has the maximum number of entities spawned as 10 and priority of 10.
    • Assert that the priority is equal to 10.

Test 3

Objective: Ensure that enemies are not spawned outside of the game area.

  • Methodology: Test through user testing.
    • Start GdxGame
    • Walk to necromancer enemy which has SpawnAttackTask and make it run to edge of game area.
    • Wait for the necromancer to spawn entities.
    • Ensure that entities are only spawned within game area and game does not crash.
    • Repeat steps 2-4 on each side of game area.

Test 4

Objective: Ensure that enemies are not spawned outside of the game area.

  • Methodology: Test through user testing.
    • Start GdxGame
    • Walk to necromancer enemy which has SpawnAttackTask and make it run to edge of game area.
    • Wait for the necromancer to spawn entities.
    • Ensure that only 5 enemies are spawned.
    • Kill 1 enemy.
    • Ensure necromancer only spawns 1 enemy.
    • Repeat steps 5 and 6 four times, increasing the number of enemies killed by 1 each cycle.

Test 5

Objective: Ensure enemies are spawned by necromancer enemies with correct positioning.

  • Methodology: Test through user testing.
    • Start GdxGame
    • Walk to necromancer enemy.
    • Position yourself randomly within range of enemy.
    • Ensure that if the y distance between player and enemy is greater than the x distance, that enemies are spawned to the left or right of necromancer. Otherwise, they should be spawned above and below.
    • Repeat steps 3 and 4.
Clone this wiki locally