Retour aux cas pratiques
PostmanFondamental

Écrire un test Postman vérifiant la présence d’un champ JSON

Scénario

Contexte Une requête GET /profile retourne un objet JSON contenant les champs id, name et email. Le Problème Aucun test n’existe pour vérifier que le champ email est présent dans la réponse. Contraintes Écrire un script Postman utilisant pm.response.json() pour vérifier que la propriété email existe. Livrable attendu Un test Postman simple validant la structure minimale de la réponse JSON.

Compétences ciblées

postmanjson validationapi testingassertion
    Écrire un test Postman vérifiant la présence d’un champ JSON — mise en situation Postman | CodeDuel