如何在javascript邮递员测试中设定日期时间和时间条件?

时间:2019-01-02 13:34:20

标签: javascript postman

我正在测试以下代码, 我需要为以下变量创建条件(如果):

"date" : "rdvPrestationHoraireDate",
"heure" : "rdvPrestationHoraireHeure",
"heureDebut" : "rdvPrestationHoraireHeureDebut",
"heureFin" : "rdvPrestationHoraireHeureFin", `
  • 约会时间不超过“ rdvPrestationDuree”不超过60分钟
  • 约会只能在第一天定价
  • 开始时间“ dateDebut”约会的开始时间不大于结束时间“ dateFin”约会的结束日期

更多详细信息:

pm.environment.set("rdvPrestationId", "");
pm.environment.set("rdvPrestationHoraireName", "HoraireFixe");
pm.environment.set("rdvPrestationHoraireDate", "{{aPartirDuLendemain}}");
pm.environment.set("rdvPrestationTypeName", "Telephonique");
pm.environment.set("rdvPrestationNomIntervenant", "STARK");
pm.environment.set("rdvPrestationPrenomIntervenant", "Tony");
pm.environment.set("rdvPrestationTelephoneIntervenant", "0549010203");
pm.environment.set("rdvPrestationReferenceIntervenant", "IM1234");
pm.environment.set("RdvMotifModificationName", "");
pm.environment.set("rdvPrestationNotes", "Notes pris pour rendez vous");
pm.environment.set("rdvPrestationDuree", "60");


var exempleFlux = {

    "prestationId" : "rdvPrestationId",
    "horaire" : {
        "name" : "rdvPrestationHoraireName",
        "value" : { 
            "date" : "rdvPrestationHoraireDate",
            "heure" : "rdvPrestationHoraireHeure",
            "heureDebut" : "rdvPrestationHoraireHeureDebut",
            "heureFin" : "rdvPrestationHoraireHeureFin", 
        },
        "label" : "",
    },
    "dureeRendezVous" : "rdvPrestationDuree",        
    "notes" : "rdvPrestationNotes",
    "typeRendezVous" : {
        "name" : "rdvPrestationTypeName"
    },
    "MotifModificationRdv":{
        "name": "RdvMotifModificationName"
        } ,
    "nomIntervenant" : "rdvPrestationNomIntervenant",
    "prenomIntervenant" : "rdvPrestationPrenomIntervenant",
    "telephoneIntervenant" : "rdvPrestationTelephoneIntervenant",
    "referenceIntervenant" : "rdvPrestationReferenceIntervenant",
}

0 个答案:

没有答案