jluudev / arthurslastcrusade

https://arthurslastcrusade.onrender.com
0 stars 0 forks source link

Test Results (Justin Yuen) #37

Open justdanyuen opened 3 months ago

justdanyuen commented 3 months ago
  1. Create a new hero and check their initial XP Input: curl -X 'POST' \ 'https://arthurslastcrusade.onrender.com/world/create_hero/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934' \ -H 'Content-Type: application/json' \ -d '{ "hero_name": "Justin", "classType": "Mage", "level": 1, "age": 1, "power": 5, "health": 10, "xp": 0 }'

response: Internal Server Error

Testing on existing heroes instead:

curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/world/view_heroes/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'

Response:

[ { "name": "Olivia", "power": 10, "health": 50 }, { "name": "Madison", "power": 10, "health": 50 } ] /hero/check_xp/{hero_id}

curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_xp/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'

Response: { "xp": 0 }

Unclear which hero this id is associated to without looking at the database. I'd recommend logging which hero we accessed with a print statment.

justdanyuen commented 3 months ago
  1. Attack hero and monitor health changes Initial health: /hero/check_health/{hero_id}

/hero/check_health/{health_id} curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_health/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'

Response:

{ "health": 50 } /moster/attack_hero/{monster_id} curl -X 'POST' \ 'https://arthurslastcrusade.onrender.com/monster/attack_hero/2?hero_id=1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934' \ -d ''

Response: { "success": true }

/hero/check_health/{health_id} curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_health/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'

Response:

{ "health": 46 }

There was a net -4 change in health after attacking, so successful modification to hero's health.

justdanyuen commented 3 months ago
  1. Kill a hero with an attack that will diminish their health to 0 or less. Finding available monsters to attack: /hero/find_monsters/{dungeon_id} curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/find_monsters/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'

Response: [ { "id": 3, "name": "Coconut Slime", "level": 4, "health": 10, "power": 3 }, { "id": 4, "name": "Coconut Slime", "level": 5, "health": 11, "power": 4 }, { "id": 5, "name": "Coconut Slime", "level": 4, "health": 10, "power": 3 }, { "id": 6, "name": "Coconut Slime", "level": 4, "health": 10, "power": 3 }, { "id": 7, "name": "Coconut Slime", "level": 5, "health": 11, "power": 4 }, { "id": 8, "name": "Coconut Slime", "level": 4, "health": 10, "power": 3 }, { "id": 20, "name": "Cyclops", "level": 13, "health": 80, "power": 35 } ]

We will use Cyclops (id 20) to attack our hero.

/monster/attack_hero/{monster_id} curl -X 'POST' \ 'https://arthurslastcrusade.onrender.com/monster/attack_hero/20?hero_id=1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934' \ -d ''

Response: Response: { "success": true }

Let's check the hero's health. /hero/check_health{hero_id} curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_health/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'

Response: { "health": 11 }

The attack wasn't enough to kill the hero, let's attack again. /monster/attack_hero/{monster_id} curl -X 'POST' \ 'https://arthurslastcrusade.onrender.com/monster/attack_hero/20?hero_id=1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934' \ -d ''

Response: Response: { "success": true }

Let's check the hero's health again. /hero/check_health{hero_id} curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_health/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'

Response: { "health": -24 }

The hero has negative health, so let's make sure it dies properly.

/hero/die/{hero_id} curl -X 'POST' \ 'https://arthurslastcrusade.onrender.com/hero/die/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934' \ -d ''

Response:

{ "success": true }

After executing the die command, it was unclear which method to check if the hero was still in the guild.