<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                #### 斷言測試實例 * * * * * 1.設置環境變量 ~~~ postman.setEnvironmentVariable("key", "value"); ~~~ 例子: `postman.setEnvironmentVariable("url", "http://192.168.36.47/v2/api"); ` 使用環境變量的格式:`{{url}}` 1.1清除環境變量 ~~~ postman.clearEnvironmentVariable("variable_key"); ~~~ 例子:`postman.clearEnvironmentVariable("url");` 2.設置一個全局變量 ~~~ postman.setGlobalVariable("key", "value"); ~~~ 例子:`postman.setGlobalVariable("username", "123@qq.com");` 使用全局變量格式:`{{variableName}}` 2.1清除一個全局變量 ~~~ postman.clearGlobalVariable("key", "value"); ~~~ 例子:`postman.clearGlobalVariable("username", "123@qq.com"); ` 3.檢查響應體包含一個字符串 ~~~ tests["Body matches string"] = responseBody.has("string_you_want_to_search"); ~~~ 例子:響應體包含以下字段 "path": "field is read-only", ~~~ tests["Body matches string"] = responseBody.has("field is read-only"); tests["Body matches string"] = responseBody.has("path"); ~~~ 4.轉換XML身體JSON對象 ~~~ var jsonObject = xml2Json(responseBody); ~~~ 5.檢查響應體等于一個字符串 ~~~ tests["Body is correct"] = responseBody === "response_body_string"; ~~~ 6.檢查一個JSON值字段 ~~~ var data = JSON.parse(responseBody); tests["Your test name"] = data.value === 100; ~~~ 7.Content-Type的存在(不區分大小寫檢查) ~~~ tests["Content-Type is present"] = postman.getResponseHeader("Content-Type"); //Note: the getResponseHeader() method returns the header value, if it exists. ~~~ 8.Content-Type的存在(區分大小寫) ~~~ tests["Content-Type is present"] = responseHeaders.hasOwnProperty("Content-Type"); ~~~ 9.響應時間小于200ms的 ~~~ tests["Response time is less than 200ms"] = responseTime < 200; ~~~ 10.狀態代碼是 ~~~ tests["Status code is 200"] = responseCode.code === 200; tests["Status code is 404"] = responseCode.code === 404; ~~~ 11.代號包含一個字符串 ~~~ tests["Status code name has string"] = responseCode.name.has("Created"); ~~~ 例子:`Status:201 CREATED` ~~~ tests["Status code is 201"] = responseCode.code === 201; tests["Status code name has string"] = responseCode.name.has("Created"); ~~~ 12.成功的POST請求的狀態代碼 ~~~ tests["Successful POST request"] = responseCode.code === 201 || responseCode.code === 202; ~~~ 13.使用TinyValidator的JSON數據 ~~~ var schema = { "items": { "type": "boolean" } }; ~~~ > var data1 = [true, false]; > var data2 = [true, 123]; > console.log(tv4.error); > tests["Valid Data1"] = tv4.validate(data1, schema); > tests["Valid Data2"] = tv4.validate(data2, schema);
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看