成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

postman--斷言寫法

qingshanli1988 / 834人閱讀

摘要:斷言介紹是一套測試驅(qū)動開發(fā)行為驅(qū)動開發(fā)的斷言庫包含有個斷言庫支持風格的和風格的可以高效的和任何測試框架搭配使用支持在中應(yīng)用獲取斷言方式語法一測試用例名稱表達式語法二斷言庫,可以通過右側(cè)頁簽點擊生成代碼截取實際響應(yīng)信息的

chai.js斷言介紹

  1. 是一套TDD(測試驅(qū)動開發(fā))/BDD(行為驅(qū)動開發(fā))的斷言庫

  2. List item包含有3個斷言庫支持BDD風格的expect/should和TDD風格的assert

  3. List item可以高效的和任何js測試框架搭配使用(支持在postman中應(yīng)用

獲取斷言方式

語法一:
tests[‘測試用例名稱’] = 表達式;
語法二:
Chai.js斷言庫, 可以通過右側(cè)頁簽點擊生成代碼

截取實際響應(yīng)信息的新老版本代碼對比

獲取相應(yīng)狀體碼:var code = responseCode.code; //舊式做法tests[code] = true;var code1 = pm.response.code; //新式做法tests[code] = true;獲取響應(yīng)信息:var info = responseCode.name;var info1 = pm.response.status;獲取響應(yīng)時間:var time = responseTime;tests["case_demo_02:驗證響應(yīng)時間是否再100-500以內(nèi)返回"] = time>=100 && time<=500;var time1 = pm.response.responseTime獲取響應(yīng)頭:var value = postman.getResponseHeader("Content-Type");var v1 = pm.response.headers;獲取響應(yīng)正文:var body_info = responseBody;var b1 = pm.response.text();

匹配正則表達式 match()

> <title>這是一個標題</title>var title_info = body_info.match(new RegExp("(.+?)"))[1];tests[title_info] = true;//[]只能填010"這是一個標題",1"這是一個標題",去除[]"這是一個標題"</span><span id="qoyqs8suu2u"    class="token operator">//</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>匹配一個字符  <span id="qoyqs8suu2u"    class="token operator">+</span>表示匹配前面的子表達式<span id="qoyqs8suu2u"    class="token number">1</span>次或多次  ?懶惰字符 首次遇到右邊界就停止匹配</code></pre> <h3><a id="test_50"></a>test斷言基本語法</h3> <pre><code class="prism language-python">tests<span id="qoyqs8suu2u"    class="token punctuation">[</span><span id="qoyqs8suu2u"    class="token string">"case01 驗證是否為true"</span><span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> true<span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>falsetests<span id="qoyqs8suu2u"    class="token punctuation">[</span><span id="qoyqs8suu2u"    class="token string">"case02 驗證是否1+1=2"</span><span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> <span id="qoyqs8suu2u"    class="token number">1</span><span id="qoyqs8suu2u"    class="token operator">+</span><span id="qoyqs8suu2u"    class="token number">1</span> <span id="qoyqs8suu2u"    class="token operator">==</span><span id="qoyqs8suu2u"    class="token operator">=</span> <span id="qoyqs8suu2u"    class="token number">2</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否相等tests<span id="qoyqs8suu2u"    class="token punctuation">[</span><span id="qoyqs8suu2u"    class="token string">"case03 驗證是否包含123"</span><span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> <span id="qoyqs8suu2u"    class="token string">"1234567hello"</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>has<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"123"</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否包含tests<span id="qoyqs8suu2u"    class="token punctuation">[</span><span id="qoyqs8suu2u"    class="token string">"case04 驗證是否3>5"</span><span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> <span id="qoyqs8suu2u"    class="token number">3</span> <span id="qoyqs8suu2u"    class="token operator">></span> <span id="qoyqs8suu2u"    class="token number">5</span> <span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否相等tests<span id="qoyqs8suu2u"    class="token punctuation">[</span><span id="qoyqs8suu2u"    class="token string">"case05 與運算"</span><span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> <span id="qoyqs8suu2u"    class="token number">3</span> <span id="qoyqs8suu2u"    class="token operator">></span> <span id="qoyqs8suu2u"    class="token number">2</span> <span id="qoyqs8suu2u"    class="token operator">&</span><span id="qoyqs8suu2u"    class="token operator">&</span> <span id="qoyqs8suu2u"    class="token number">3</span><span id="qoyqs8suu2u"    class="token operator">></span><span id="qoyqs8suu2u"    class="token number">1</span> <span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>與運算tests<span id="qoyqs8suu2u"    class="token punctuation">[</span><span id="qoyqs8suu2u"    class="token string">"case06 或運算"</span><span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> <span id="qoyqs8suu2u"    class="token number">3</span> <span id="qoyqs8suu2u"    class="token operator">></span> <span id="qoyqs8suu2u"    class="token number">2</span> <span id="qoyqs8suu2u"    class="token operator">|</span><span id="qoyqs8suu2u"    class="token operator">|</span> <span id="qoyqs8suu2u"    class="token number">3</span><span id="qoyqs8suu2u"    class="token operator">></span><span id="qoyqs8suu2u"    class="token number">5</span> <span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>或運算tests<span id="qoyqs8suu2u"    class="token punctuation">[</span><span id="qoyqs8suu2u"    class="token string">"case07 非運算"</span><span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> !<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token number">3</span> <span id="qoyqs8suu2u"    class="token operator">></span> <span id="qoyqs8suu2u"    class="token number">2</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>非運算</code></pre> <h3><a id="json_61"></a>把響應(yīng)正文解析為json對象</h3> <pre><code class="prism language-python">var jsondata <span id="qoyqs8suu2u"    class="token operator">=</span> JSON<span id="qoyqs8suu2u"    class="token punctuation">.</span>parse<span id="qoyqs8suu2u"    class="token punctuation">(</span>responseBody<span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span><span id="qoyqs8suu2u"    class="token operator">//</span>舊版本寫法var token <span id="qoyqs8suu2u"    class="token operator">=</span> jsondata<span id="qoyqs8suu2u"    class="token punctuation">.</span>expires_in<span id="qoyqs8suu2u"    class="token punctuation">;</span>tests<span id="qoyqs8suu2u"    class="token punctuation">[</span>token<span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> true<span id="qoyqs8suu2u"    class="token punctuation">;</span>var jd <span id="qoyqs8suu2u"    class="token operator">=</span> pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>response<span id="qoyqs8suu2u"    class="token punctuation">.</span>json<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span> <span id="qoyqs8suu2u"    class="token operator">//</span>新版本寫法tests<span id="qoyqs8suu2u"    class="token punctuation">[</span>jd<span id="qoyqs8suu2u"    class="token punctuation">.</span>access_token<span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> true<span id="qoyqs8suu2u"    class="token punctuation">;</span></code></pre> <pre><code class="prism language-python"><span id="qoyqs8suu2u"    class="token operator">></span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span><span id="qoyqs8suu2u"    class="token string">"tags"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span><span id="qoyqs8suu2u"    class="token punctuation">[</span><span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span><span id="qoyqs8suu2u"    class="token string">"id"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span><span id="qoyqs8suu2u"    class="token number">2</span><span id="qoyqs8suu2u"    class="token punctuation">,</span><span id="qoyqs8suu2u"    class="token string">"name"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span><span id="qoyqs8suu2u"    class="token string">"星標組"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span><span id="qoyqs8suu2u"    class="token string">"count"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span><span id="qoyqs8suu2u"    class="token number">0</span><span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">,</span><span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span><span id="qoyqs8suu2u"    class="token string">"id"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span><span id="qoyqs8suu2u"    class="token number">100</span><span id="qoyqs8suu2u"    class="token punctuation">,</span><span id="qoyqs8suu2u"    class="token string">"name"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span><span id="qoyqs8suu2u"    class="token string">"廣東"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span><span id="qoyqs8suu2u"    class="token string">"count"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span><span id="qoyqs8suu2u"    class="token number">0</span><span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">]</span><span id="qoyqs8suu2u"    class="token punctuation">}</span>var jd <span id="qoyqs8suu2u"    class="token operator">=</span> pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>response<span id="qoyqs8suu2u"    class="token punctuation">.</span>json<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>var v <span id="qoyqs8suu2u"    class="token operator">=</span> jd<span id="qoyqs8suu2u"    class="token punctuation">.</span>tags<span id="qoyqs8suu2u"    class="token punctuation">[</span><span id="qoyqs8suu2u"    class="token number">0</span><span id="qoyqs8suu2u"    class="token punctuation">]</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>name<span id="qoyqs8suu2u"    class="token punctuation">;</span> tests<span id="qoyqs8suu2u"    class="token punctuation">[</span>v<span id="qoyqs8suu2u"    class="token punctuation">]</span> <span id="qoyqs8suu2u"    class="token operator">=</span> true<span id="qoyqs8suu2u"    class="token punctuation">;</span></code></pre> <h3><a id="chaijs_79"></a>chai.js斷言語法</h3> <pre><code class="prism language-python"><span id="qoyqs8suu2u"    class="token operator">//</span>chai<span id="qoyqs8suu2u"    class="token punctuation">,</span>js斷言新寫法pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_01 測試用例名稱"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>    pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span>true<span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>be<span id="qoyqs8suu2u"    class="token punctuation">.</span>true<span id="qoyqs8suu2u"    class="token punctuation">;</span>   <span id="qoyqs8suu2u"    class="token operator">//</span>chai<span id="qoyqs8suu2u"    class="token punctuation">.</span>js斷言編寫處<span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_02 相等"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>    pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token number">1</span><span id="qoyqs8suu2u"    class="token operator">+</span><span id="qoyqs8suu2u"    class="token number">1</span><span id="qoyqs8suu2u"    class="token operator">==</span><span id="qoyqs8suu2u"    class="token number">2</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>be<span id="qoyqs8suu2u"    class="token punctuation">.</span>true<span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否相等<span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_02 測試用例名稱"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>    pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token number">2</span> <span id="qoyqs8suu2u"    class="token operator"><</span> <span id="qoyqs8suu2u"    class="token number">5</span> <span id="qoyqs8suu2u"    class="token operator">&</span><span id="qoyqs8suu2u"    class="token operator">&</span> <span id="qoyqs8suu2u"    class="token number">3</span> <span id="qoyqs8suu2u"    class="token operator"><</span> <span id="qoyqs8suu2u"    class="token number">6</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>be<span id="qoyqs8suu2u"    class="token punctuation">.</span>true<span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否為true<span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_03 測試用例名稱"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>    pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">""</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>be<span id="qoyqs8suu2u"    class="token punctuation">.</span>ok<span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否為真值  非空、非<span id="qoyqs8suu2u"    class="token number">0</span> 即為真<span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_04 測試用例名稱"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>    pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"hello"</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>equal<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"hello"</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>  <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否相等<span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_05 測試用例名稱"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>    pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span> <span id="qoyqs8suu2u"    class="token string">"list"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span> <span id="qoyqs8suu2u"    class="token string">"aaa"</span> <span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>eql<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span> <span id="qoyqs8suu2u"    class="token string">"list"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span> <span id="qoyqs8suu2u"    class="token string">"aaa"</span> <span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否深度相等<span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span><span id="qoyqs8suu2u"    class="token string">"list"</span><span id="qoyqs8suu2u"    class="token punctuation">:</span><span id="qoyqs8suu2u"    class="token string">"aaa"</span><span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_06 測試用例名稱"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>    pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"foobar"</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>have<span id="qoyqs8suu2u"    class="token punctuation">.</span>string<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"bar"</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否包含字符串<span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_07 測試用例名稱"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>    pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"foobar"</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>match<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token operator">/</span><span id="qoyqs8suu2u"    class="token operator">^</span>foo<span id="qoyqs8suu2u"    class="token operator">/</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>    <span id="qoyqs8suu2u"    class="token operator">//</span>判斷是否包含,支持正則表達式  <span id="qoyqs8suu2u"    class="token operator">^</span>表示以什么開頭<span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span></code></pre> <h3><a id="chaijs_115"></a>chai.js斷言語法</h3> <pre><code class="prism language-python">pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_01 200"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>response<span id="qoyqs8suu2u"    class="token punctuation">.</span>code<span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>equal<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token number">200</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>test<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"case_demo_0"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> function <span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token punctuation">{<!-- --></span>    pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>expect<span id="qoyqs8suu2u"    class="token punctuation">(</span>pm<span id="qoyqs8suu2u"    class="token punctuation">.</span>response<span id="qoyqs8suu2u"    class="token punctuation">.</span>text<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">.</span>to<span id="qoyqs8suu2u"    class="token punctuation">.</span>have<span id="qoyqs8suu2u"    class="token punctuation">.</span>string<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"文本"</span><span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span><span id="qoyqs8suu2u"    class="token punctuation">}</span><span id="qoyqs8suu2u"    class="token punctuation">)</span></code></pre> <h3><a id="_125"></a>部分基礎(chǔ)語法</h3> <pre><code class="prism language-python">設(shè)置環(huán)境變量token,供后面的接口引用var data <span id="qoyqs8suu2u"    class="token operator">=</span> JSON<span id="qoyqs8suu2u"    class="token punctuation">.</span>parse<span id="qoyqs8suu2u"    class="token punctuation">(</span>responseBody<span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span>postman<span id="qoyqs8suu2u"    class="token punctuation">.</span>setGlobalVariable<span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"token_id"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> value<span id="qoyqs8suu2u"    class="token punctuation">)</span> <span id="qoyqs8suu2u"    class="token operator">//</span>舊方法pm<span id="qoyqs8suu2u"    class="token punctuation">.</span><span id="qoyqs8suu2u"    class="token builtin">globals</span><span id="qoyqs8suu2u"    class="token punctuation">.</span><span id="qoyqs8suu2u"    class="token builtin">set</span><span id="qoyqs8suu2u"    class="token punctuation">(</span><span id="qoyqs8suu2u"    class="token string">"token_id"</span><span id="qoyqs8suu2u"    class="token punctuation">,</span> data<span id="qoyqs8suu2u"    class="token punctuation">.</span>access_token<span id="qoyqs8suu2u"    class="token punctuation">)</span><span id="qoyqs8suu2u"    class="token punctuation">;</span> <span id="qoyqs8suu2u"    class="token operator">//</span>新</code></pre> <p>學IT,上博學谷<br /> https://m.boxuegu.com/inviteShare/invited?id=8a2c9bed6aa1c063016ab53099d00037&source=1&from=singlemessage</p>                </div>                <link  rel="stylesheet">                <link  rel="stylesheet">        </div>        <div   class="qoyqs8suu2u"   id="treeSkill"></div>               
               
                                           
                       
                 </div>
            
                     <div   id="qoyqs8suu2u"   class="mt-64 tags-seach" >
                 <div   id="qoyqs8suu2u"   class="tags-info">
                                                                                                                    
                         <a style="width:120px;" title="云服務(wù)器" href="http://systransis.cn/site/active/kuaijiesale.html?ytag=seo">云服務(wù)器</a>
                                             
                         <a style="width:120px;" title="GPU云服務(wù)器" href="http://systransis.cn/site/product/gpu.html">GPU云服務(wù)器</a>
                                                                                                                                                 
                                      
                     
                    
                                                                                               <a style="width:120px;" title="Postman" href="http://systransis.cn/yun/tag/Postman/">Postman</a>
                                                                                                           <a style="width:120px;" title="postman怎么測試云服務(wù)器本地" href="http://systransis.cn/yun/tag/postmanzenmeceshiyunfuwuqibendi/">postman怎么測試云服務(wù)器本地</a>
                                                                                                           <a style="width:120px;" title="正向斷言" href="http://systransis.cn/yun/tag/zhengxiangduanyan/">正向斷言</a>
                                                                                                           <a style="width:120px;" title="斷言" href="http://systransis.cn/yun/tag/duanyan/">斷言</a>
                                                         
                 </div>
               
              </div>
             
               <div   id="qoyqs8suu2u"   class="entry-copyright mb-30">
                   <p class="mb-15"> 文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。</p>
                 
                   <p>轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/123439.html</p>
               </div>
                      
               <ul class="pre-next-page">
                 
                                  <li id="qoyqs8suu2u"    class="ellipsis"><a class="hpf" href="http://systransis.cn/yun/123438.html">上一篇:#例程學習# | Git技能學習 |簡單Git流程:本地創(chuàng)建、遠程建倉、添加上傳</a></li>  
                                                
                                       <li id="qoyqs8suu2u"    class="ellipsis"><a class="hpf" href="http://systransis.cn/yun/123440.html">下一篇:2021-11-15</a></li>
                                  </ul>
              </div>
              <div   id="qoyqs8suu2u"   class="about_topicone-mid">
                <h3 class="top-com-title mb-0"><span data-id="0">相關(guān)文章</span></h3>
                <ul class="com_white-left-mid atricle-list-box">
                             
                                                                                                    <li>
                                                <div   id="qoyqs8suu2u"   class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="http://systransis.cn/yun/123266.html"><b><em>Postman</em>快速入門-接口測試教程,取和引用響應(yīng)值,<em>斷言</em>,json路徑<em>寫法</em></b></a></h2>
                                                     <p class="ellipsis2 good">摘要:目錄的基礎(chǔ)頁面的功能解釋的基礎(chǔ)頁面的功能解釋如何創(chuàng)建請求如何創(chuàng)建請求提取響應(yīng)結(jié)果中的值然后再其它接口中調(diào)用提取響應(yīng)結(jié)果中的值然后再其它接口中調(diào)用新建環(huán)境來存儲環(huán)境變量新建環(huán)境來存儲環(huán)境變量在中通過語句提取響應(yīng)結(jié)果                                                    目錄 1.Postman的基礎(chǔ)頁面的功能解釋 2.如何創(chuàng)建請求 3.提取?響應(yīng)...</p>
                                                   
                          <div   id="qoyqs8suu2u"   class="com_white-left-info">
                                <div   id="qoyqs8suu2u"   class="com_white-left-infol">
                                    <a href="http://systransis.cn/yun/u-1063.html"><img src="http://systransis.cn/yun/data/avatar/000/00/10/small_000001063.jpg" alt=""><span id="qoyqs8suu2u"    class="layui-hide64">Cc_2011</span></a>
                                    <time datetime="">2021-11-15 11:37</time>
                                    <span><i class="fa fa-commenting"></i>評論0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                                       <li>
                                                <div   id="qoyqs8suu2u"   class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="http://systransis.cn/yun/122099.html"><b>【接口測試—<em>postman</em>】5分鐘讓你學會接口測試工具——<em>postman</em>的基礎(chǔ)常用技巧,看完少走一周</b></a></h2>
                                                     <p class="ellipsis2 good">摘要:今天來和大家分享下,我這段時間做接口測試的一些心得。接口測試就我目前的理解,大部分情況下,接口測試,就是按照接口測試文檔,輸入相應(yīng)的請求,看能否得到文檔上所寫的接口返回消息。這一過程,稱之為接口測試,如果沒有返回相應(yīng)的信息,說明有了。                                                    大家好,我是好學的小師弟。今天來和大家分享下,我這段時間...</p>
                                                   
                          <div   id="qoyqs8suu2u"   class="com_white-left-info">
                                <div   id="qoyqs8suu2u"   class="com_white-left-infol">
                                    <a href="http://systransis.cn/yun/u-134.html"><img src="http://systransis.cn/yun/data/avatar/000/00/01/small_000000134.jpg" alt=""><span id="qoyqs8suu2u"    class="layui-hide64">The question</span></a>
                                    <time datetime="">2021-10-11 10:57</time>
                                    <span><i class="fa fa-commenting"></i>評論0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                                       <li>
                                                <div   id="qoyqs8suu2u"   class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="http://systransis.cn/yun/121600.html"><b><em>Postman</em>接口測試工具</b></a></h2>
                                                     <p class="ellipsis2 good">摘要:簡介是一款功能強大的網(wǎng)頁調(diào)試與發(fā)送網(wǎng)頁請求,并能運行測試用例的測試工具能夠模擬各種從常用的到的等甚至還可以發(fā)送文件額外的。                                                                                                                    持續(xù)更新… 標記  Postman 1....</p>
                                                   
                          <div   id="qoyqs8suu2u"   class="com_white-left-info">
                                <div   id="qoyqs8suu2u"   class="com_white-left-infol">
                                    <a href="http://systransis.cn/yun/u-193.html"><img src="http://systransis.cn/yun/data/avatar/000/00/01/small_000000193.jpg" alt=""><span id="qoyqs8suu2u"    class="layui-hide64">awesome23</span></a>
                                    <time datetime="">2021-09-30 09:47</time>
                                    <span><i class="fa fa-commenting"></i>評論0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                                       <li>
                                                <div   id="qoyqs8suu2u"   class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="http://systransis.cn/yun/118961.html"><b><em>PostMan</em>詳細介紹</b></a></h2>
                                                     <p class="ellipsis2 good">摘要:無論接口調(diào)式還是接口測試,都算的上很優(yōu)秀的工具,好多接口測試平臺,接口測試工具框架的設(shè)計也都能看到的影子主要界面功能介紹新建,可以創(chuàng)建請求,請求集,環(huán)境變量等。                                                    無論接口調(diào)式還是接口測試,postman都算的上很優(yōu)秀的工具,好多接口測試平臺,接口測試工具框架的設(shè)計也都能看到 postman的...</p>
                                                   
                          <div   id="qoyqs8suu2u"   class="com_white-left-info">
                                <div   id="qoyqs8suu2u"   class="com_white-left-infol">
                                    <a href="http://systransis.cn/yun/u-172.html"><img src="http://systransis.cn/yun/data/avatar/000/00/01/small_000000172.jpg" alt=""><span id="qoyqs8suu2u"    class="layui-hide64">mushang</span></a>
                                    <time datetime="">2021-09-03 10:28</time>
                                    <span><i class="fa fa-commenting"></i>評論0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                                       <li>
                                                <div   id="qoyqs8suu2u"   class="atricle-list-right">
                          <h2 class="ellipsis2"><a class="hpf" href="http://systransis.cn/yun/123140.html"><b><em>Postman</em>教程-Pre-request Script和Tests腳本的介紹</b></a></h2>
                                                     <p class="ellipsis2 good">摘要:本章將重點介紹和的相關(guān)知識。與文件夾相關(guān)聯(lián)的腳本將在文件夾中的每個請求之前運行。與集合相關(guān)的腳本將在集合中的每個請求之后運行。腳本使用場景工具借助測試腳來幫助用戶自動判斷接口請求是否正確,相當于工具中的檢查點或者中的斷言功能。                                                                                    ...</p>
                                                   
                          <div   id="qoyqs8suu2u"   class="com_white-left-info">
                                <div   id="qoyqs8suu2u"   class="com_white-left-infol">
                                    <a href="http://systransis.cn/yun/u-804.html"><img src="http://systransis.cn/yun/data/avatar/000/00/08/small_000000804.jpg" alt=""><span id="qoyqs8suu2u"    class="layui-hide64">Steve_Wang_</span></a>
                                    <time datetime="">2021-11-12 10:34</time>
                                    <span><i class="fa fa-commenting"></i>評論0</span> 
                                    <span><i class="fa fa-star"></i>收藏0</span> 
                                </div>
                          </div>
                      </div>
                    </li> 
                                                                           
                </ul>
              </div>
              
               <div   id="qoyqs8suu2u"   class="topicone-box-wangeditor">
                  
                  <h3 class="top-com-title mb-64"><span>發(fā)表評論</span></h3>
                   <div   id="qoyqs8suu2u"   class="xcp-publish-main flex_box_zd">
                                      
                      <div   id="qoyqs8suu2u"   class="unlogin-pinglun-box">
                        <a href="javascript:login()" class="grad">登陸后可評論</a>
                      </div>                   </div>
               </div>
              <div   id="qoyqs8suu2u"   class="site-box-content">
                <div   id="qoyqs8suu2u"   class="site-content-title">
                  <h3 class="top-com-title mb-64"><span>0條評論</span></h3>   
                </div> 
                      <div   id="qoyqs8suu2u"   class="pages"></ul></div>
              </div>
           </div>
           <div   id="qoyqs8suu2u"   class="layui-col-md4 layui-col-lg3 com_white-right site-wrap-right">
              <div   id="qoyqs8suu2u"   class=""> 
                <div   id="qoyqs8suu2u"   class="com_layuiright-box user-msgbox">
                    <a href="http://systransis.cn/yun/u-667.html"><img src="http://systransis.cn/yun/data/avatar/000/00/06/small_000000667.jpg" alt=""></a>
                    <h3><a href="http://systransis.cn/yun/u-667.html" rel="nofollow">qingshanli1988</a></h3>
                    <h6>男<span>|</span>高級講師</h6>
                    <div   id="qoyqs8suu2u"   class="flex_box_zd user-msgbox-atten">
                     
                                                                      <a href="javascript:attentto_user(667)" id="attenttouser_667" class="grad follow-btn notfollow attention">我要關(guān)注</a>
      
                                                                                        <a href="javascript:login()" title="發(fā)私信" >我要私信</a>
                     
                                            
                    </div>
                    <div   id="qoyqs8suu2u"   class="user-msgbox-list flex_box_zd">
                          <h3 class="hpf">TA的文章</h3>
                          <a href="http://systransis.cn/yun/ut-667.html" class="box_hxjz">閱讀更多</a>
                    </div>
                      <ul class="user-msgbox-ul">
                                                  <li><h3 class="ellipsis"><a href="http://systransis.cn/yun/125022.html">2021年軟件測試工具總結(jié)——單元測試工具</a></h3>
                            <p>閱讀 3783<span>·</span>2021-11-25 09:43</p></li>
                                                       <li><h3 class="ellipsis"><a href="http://systransis.cn/yun/124551.html">DiyVM:50元/月起-雙核,2G內(nèi)存,50G硬盤,香港/日本/洛杉磯機房</a></h3>
                            <p>閱讀 2202<span>·</span>2021-11-23 10:13</p></li>
                                                       <li><h3 class="ellipsis"><a href="http://systransis.cn/yun/123439.html">postman--斷言寫法</a></h3>
                            <p>閱讀 835<span>·</span>2021-11-16 11:44</p></li>
                                                       <li><h3 class="ellipsis"><a href="http://systransis.cn/yun/114304.html">CSS font-style斜體字體傾斜體樣式</a></h3>
                            <p>閱讀 2382<span>·</span>2019-08-29 17:24</p></li>
                                                       <li><h3 class="ellipsis"><a href="http://systransis.cn/yun/114219.html">〔總結(jié)系列〕前端技術(shù)精華清單</a></h3>
                            <p>閱讀 1393<span>·</span>2019-08-29 17:17</p></li>
                                                       <li><h3 class="ellipsis"><a href="http://systransis.cn/yun/111693.html">LESS和SASS的區(qū)別與速查表-譯文</a></h3>
                            <p>閱讀 3488<span>·</span>2019-08-29 11:30</p></li>
                                                       <li><h3 class="ellipsis"><a href="http://systransis.cn/yun/108715.html">React手稿 - Context</a></h3>
                            <p>閱讀 2591<span>·</span>2019-08-26 13:23</p></li>
                                                       <li><h3 class="ellipsis"><a href="http://systransis.cn/yun/108136.html">Rxjs 響應(yīng)式編程-第五章 使用Schedulers管理時間</a></h3>
                            <p>閱讀 2353<span>·</span>2019-08-26 12:10</p></li>
                                                
                      </ul>
                </div>

                   <!-- 文章詳情右側(cè)廣告-->
              
  <div   id="qoyqs8suu2u"   class="com_layuiright-box">
                  <h6 class="top-com-title"><span>最新活動</span></h6> 
           
         <div   id="qoyqs8suu2u"   class="com_adbox">
                    <div   id="qoyqs8suu2u"   class="layui-carousel" id="right-item">
                      <div carousel-item>
                                                                                                                       <div>
                          <a href="http://systransis.cn/site/active/kuaijiesale.html?ytag=seo"  rel="nofollow">
                            <img src="http://systransis.cn/yun/data/attach/240625/2rTjEHmi.png" alt="云服務(wù)器">                                 
                          </a>
                        </div>
                                                <div>
                          <a href="http://systransis.cn/site/product/gpu.html"  rel="nofollow">
                            <img src="http://systransis.cn/yun/data/attach/240807/7NjZjdrd.png" alt="GPU云服務(wù)器">                                 
                          </a>
                        </div>
                                                                   
                    
                        
                      </div>
                    </div>
                      
                    </div>                    <!-- banner結(jié)束 -->
              
<div   id="qoyqs8suu2u"   class="adhtml">

</div>
                <script>
                $(function(){
                    $.ajax({
                        type: "GET",
                                url:"http://systransis.cn/yun/ad/getad/1.html",
                                cache: false,
                                success: function(text){
                                  $(".adhtml").html(text);
                                }
                        });
                    })
                </script>                </div>              </div>
           </div>
        </div>
      </div> 
    </section>
    <!-- wap拉出按鈕 -->
     <div   id="qoyqs8suu2u"   class="site-tree-mobile layui-hide">
      <i class="layui-icon layui-icon-spread-left"></i>
    </div>
    <!-- wap遮罩層 -->
    <div   id="qoyqs8suu2u"   class="site-mobile-shade"></div>
    
       <!--付費閱讀 -->
       <div   class="qoyqs8suu2u"   id="payread">
         <div   id="qoyqs8suu2u"   class="layui-form-item">閱讀需要支付1元查看</div>  
         <div   id="qoyqs8suu2u"   class="layui-form-item"><button class="btn-right">支付并查看</button></div>     
       </div>
      <script>
      var prei=0;

       
       $(".site-seo-depict pre").each(function(){
          var html=$(this).html().replace("<code>","").replace("</code>","").replace('<code class="javascript hljs" codemark="1">','');
          $(this).attr('data-clipboard-text',html).attr("id","pre"+prei);
          $(this).html("").append("<code>"+html+"</code>");
         prei++;
       })
           $(".site-seo-depict img").each(function(){
             
            if($(this).attr("src").indexOf('data:image/svg+xml')!= -1){
                $(this).remove();
            }
       })
     $("LINK[href*='style-49037e4d27.css']").remove();
       $("LINK[href*='markdown_views-d7a94ec6ab.css']").remove();
layui.use(['jquery', 'layer','code'], function(){
  $("pre").attr("class","layui-code");
      $("pre").attr("lay-title","");
       $("pre").attr("lay-skin","");
  layui.code(); 
       $(".layui-code-h3 a").attr("class","copycode").html("復(fù)制代碼 ").attr("onclick","copycode(this)");
      
});
function copycode(target){
    var id=$(target).parent().parent().attr("id");
  
                  var clipboard = new ClipboardJS("#"+id);

clipboard.on('success', function(e) {


    e.clearSelection();
    alert("復(fù)制成功")
});

clipboard.on('error', function(e) {
    alert("復(fù)制失敗")
});
}
//$(".site-seo-depict").html($(".site-seo-depict").html().slice(0, -5));
</script>
  <link rel="stylesheet" type="text/css" href="http://systransis.cn/yun/static/js/neweditor/code/styles/tomorrow-night-eighties.css">
    <script src="http://systransis.cn/yun/static/js/neweditor/code/highlight.pack.js" type="text/javascript"></script>
    <script src="http://systransis.cn/yun/static/js/clipboard.js"></script>

<script>hljs.initHighlightingOnLoad();</script>

<script>
    function setcode(){
        var _html='';
    	  document.querySelectorAll('pre code').forEach((block) => {
        	  var _tmptext=$.trim($(block).text());
        	  if(_tmptext!=''){
        		  _html=_html+_tmptext;
        		  console.log(_html);
        	  }
    		 
    		  
    		 
      	  });
    	 

    }

</script>

<script>
function payread(){
  layer.open({
      type: 1,
      title:"付費閱讀",
      shadeClose: true,
      content: $('#payread')
    });
}
// 舉報
function jupao_tip(){
  layer.open({
      type: 1,
      title:false,
      shadeClose: true,
      content: $('#jubao')
    });

}
$(".getcommentlist").click(function(){
var _id=$(this).attr("dataid");
var _tid=$(this).attr("datatid");
$("#articlecommentlist"+_id).toggleClass("hide");
var flag=$("#articlecommentlist"+_id).attr("dataflag");
if(flag==1){
flag=0;
}else{
flag=1;
//加載評論
loadarticlecommentlist(_id,_tid);
}
$("#articlecommentlist"+_id).attr("dataflag",flag);

})
$(".add-comment-btn").click(function(){
var _id=$(this).attr("dataid");
$(".formcomment"+_id).toggleClass("hide");
})
$(".btn-sendartcomment").click(function(){
var _aid=$(this).attr("dataid");
var _tid=$(this).attr("datatid");
var _content=$.trim($(".commenttext"+_aid).val());
if(_content==''){
alert("評論內(nèi)容不能為空");
return false;
}
var touid=$("#btnsendcomment"+_aid).attr("touid");
if(touid==null){
touid=0;
}
addarticlecomment(_tid,_aid,_content,touid);
})
 $(".button_agree").click(function(){
 var supportobj = $(this);
         var tid = $(this).attr("id");
         $.ajax({
         type: "GET",
                 url:"http://systransis.cn/yun/index.php?topic/ajaxhassupport/" + tid,
                 cache: false,
                 success: function(hassupport){
                 if (hassupport != '1'){






                         $.ajax({
                         type: "GET",
                                 cache:false,
                                 url: "http://systransis.cn/yun/index.php?topic/ajaxaddsupport/" + tid,
                                 success: function(comments) {

                                 supportobj.find("span").html(comments+"人贊");
                                 }
                         });
                 }else{
                	 alert("您已經(jīng)贊過");
                 }
                 }
         });
 });
 function attenquestion(_tid,_rs){
    	$.ajax({
    //提交數(shù)據(jù)的類型 POST GET
    type:"POST",
    //提交的網(wǎng)址
    url:"http://systransis.cn/yun/favorite/topicadd.html",
    //提交的數(shù)據(jù)
    data:{tid:_tid,rs:_rs},
    //返回數(shù)據(jù)的格式
    datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
    //在請求之前調(diào)用的函數(shù)
    beforeSend:function(){},
    //成功返回之后調(diào)用的函數(shù)
    success:function(data){
    	var data=eval("("+data+")");
    	console.log(data)
       if(data.code==2000){
    	layer.msg(data.msg,function(){
    	  if(data.rs==1){
    	      //取消收藏
    	      $(".layui-layer-tips").attr("data-tips","收藏文章");
    	      $(".layui-layer-tips").html('<i class="fa fa-heart-o"></i>');
    	  }
    	   if(data.rs==0){
    	      //收藏成功
    	      $(".layui-layer-tips").attr("data-tips","已收藏文章");
    	      $(".layui-layer-tips").html('<i class="fa fa-heart"></i>')
    	  }
    	})
    	 
       }else{
    	layer.msg(data.msg)
       }


    }   ,
    //調(diào)用執(zhí)行后調(diào)用的函數(shù)
    complete: function(XMLHttpRequest, textStatus){
     	postadopt=true;
    },
    //調(diào)用出錯執(zhí)行的函數(shù)
    error: function(){
        //請求出錯處理
    	postadopt=false;
    }
 });
}
</script>
<footer>
        <div   id="qoyqs8suu2u"   class="layui-container">
            <div   id="qoyqs8suu2u"   class="flex_box_zd">
              <div   id="qoyqs8suu2u"   class="left-footer">
                    <h6><a href="http://systransis.cn/"><img src="http://systransis.cn/yun/static/theme/ukd//images/logo.png" alt="UCloud (優(yōu)刻得科技股份有限公司)"></a></h6>
                    <p>UCloud (優(yōu)刻得科技股份有限公司)是中立、安全的云計算服務(wù)平臺,堅持中立,不涉足客戶業(yè)務(wù)領(lǐng)域。公司自主研發(fā)IaaS、PaaS、大數(shù)據(jù)流通平臺、AI服務(wù)平臺等一系列云計算產(chǎn)品,并深入了解互聯(lián)網(wǎng)、傳統(tǒng)企業(yè)在不同場景下的業(yè)務(wù)需求,提供公有云、混合云、私有云、專有云在內(nèi)的綜合性行業(yè)解決方案。</p>
              </div>
              <div   id="qoyqs8suu2u"   class="right-footer layui-hidemd">
                  <ul class="flex_box_zd">
                      <li>
                        <h6>UCloud與云服務(wù)</h6>
                         <p><a href="http://systransis.cn/site/about/intro/">公司介紹</a></p>
                         <p><a  >加入我們</a></p>
                         <p><a href="http://systransis.cn/site/ucan/onlineclass/">UCan線上公開課</a></p>
                         <p><a href="http://systransis.cn/site/solutions.html" >行業(yè)解決方案</a></p>                                                  <p><a href="http://systransis.cn/site/pro-notice/">產(chǎn)品動態(tài)</a></p>
                      </li>
                      <li>
                        <h6>友情鏈接</h6>                                             <p><a >GPU算力平臺</a></p>                                             <p><a >UCloud私有云</a></p>
                                             <p><a >SurferCloud</a></p>                                             <p><a >工廠仿真軟件</a></p>                                             <p><a >Pinex</a></p>                                             <p><a >AI繪畫</a></p>
                                             
                      </li>
                      <li>
                        <h6>社區(qū)欄目</h6>
                         <p><a href="http://systransis.cn/yun/column/index.html">專欄文章</a></p>
                     <p><a href="http://systransis.cn/yun/udata/">專題地圖</a></p>                      </li>
                      <li>
                        <h6>常見問題</h6>
                         <p><a href="http://systransis.cn/site/ucsafe/notice.html" >安全中心</a></p>
                         <p><a href="http://systransis.cn/site/about/news/recent/" >新聞動態(tài)</a></p>
                         <p><a href="http://systransis.cn/site/about/news/report/">媒體動態(tài)</a></p>                                                  <p><a href="http://systransis.cn/site/cases.html">客戶案例</a></p>                                                
                         <p><a href="http://systransis.cn/site/notice/">公告</a></p>
                      </li>
                      <li>
                          <span><img src="https://static.ucloud.cn/7a4b6983f4b94bcb97380adc5d073865.png" alt="優(yōu)刻得"></span>
                          <p>掃掃了解更多</p></div>
            </div>
            <div   id="qoyqs8suu2u"   class="copyright">Copyright ? 2012-2023 UCloud 優(yōu)刻得科技股份有限公司<i>|</i><a rel="nofollow" >滬公網(wǎng)安備 31011002000058號</a><i>|</i><a rel="nofollow" ></a> 滬ICP備12020087號-3</a><i>|</i> <script type="text/javascript" src="https://gyfk12.kuaishang.cn/bs/ks.j?cI=197688&fI=125915" charset="utf-8"></script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://#/hm.js?290c2650b305fc9fff0dbdcafe48b59d";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-DZSMXQ3P9N"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-DZSMXQ3P9N');
</script>
<script>
(function(){
var el = document.createElement("script");
el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?99f50ea166557aed914eb4a66a7a70a4709cbb98a54ecb576877d99556fb4bfc3d72cd14f8a76432df3935ab77ec54f830517b3cb210f7fd334f50ccb772134a";
el.id = "ttzz";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(el, s);
})(window)
</script></div> 
        </div>
    </footer>

<footer>
<div class="friendship-link">
<p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p>
<a href="http://systransis.cn/" title="成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费">成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费</a>

<div class="friend-links">


</div>
</div>

</footer>


<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
</body><div id="oook0" class="pl_css_ganrao" style="display: none;"><fieldset id="oook0"><table id="oook0"><kbd id="oook0"></kbd></table></fieldset><strong id="oook0"><noframes id="oook0"><ul id="oook0"></ul></noframes></strong><dfn id="oook0"></dfn><th id="oook0"><object id="oook0"><bdo id="oook0"></bdo></object></th><cite id="oook0"><abbr id="oook0"><kbd id="oook0"></kbd></abbr></cite><dl id="oook0"><optgroup id="oook0"><del id="oook0"></del></optgroup></dl><center id="oook0"></center><dd id="oook0"><dl id="oook0"><nav id="oook0"></nav></dl></dd><abbr id="oook0"><kbd id="oook0"><tr id="oook0"></tr></kbd></abbr><abbr id="oook0"><delect id="oook0"><tr id="oook0"></tr></delect></abbr><center id="oook0"></center><noframes id="oook0"></noframes><center id="oook0"></center><fieldset id="oook0"><table id="oook0"><tr id="oook0"></tr></table></fieldset><li id="oook0"></li><samp id="oook0"></samp><s id="oook0"><bdo id="oook0"><abbr id="oook0"></abbr></bdo></s><th id="oook0"><nav id="oook0"><li id="oook0"></li></nav></th><input id="oook0"></input><input id="oook0"></input><object id="oook0"></object><del id="oook0"><dfn id="oook0"><rt id="oook0"></rt></dfn></del><dd id="oook0"><th id="oook0"><object id="oook0"></object></th></dd><acronym id="oook0"></acronym><delect id="oook0"><tr id="oook0"><s id="oook0"></s></tr></delect><dd id="oook0"></dd><abbr id="oook0"></abbr><center id="oook0"></center><acronym id="oook0"></acronym><tr id="oook0"></tr><em id="oook0"></em><code id="oook0"></code><strong id="oook0"></strong><cite id="oook0"></cite><nav id="oook0"><li id="oook0"><button id="oook0"></button></li></nav><rt id="oook0"><strong id="oook0"><optgroup id="oook0"></optgroup></strong></rt><em id="oook0"></em><sup id="oook0"><source id="oook0"><dl id="oook0"></dl></source></sup><menu id="oook0"><tr id="oook0"><acronym id="oook0"></acronym></tr></menu><nav id="oook0"></nav><tr id="oook0"></tr><source id="oook0"></source><delect id="oook0"></delect><input id="oook0"></input><abbr id="oook0"></abbr><source id="oook0"></source><td id="oook0"></td><option id="oook0"></option><bdo id="oook0"><option id="oook0"><kbd id="oook0"></kbd></option></bdo><menu id="oook0"></menu><input id="oook0"></input><table id="oook0"><tr id="oook0"><acronym id="oook0"></acronym></tr></table><blockquote id="oook0"></blockquote><th id="oook0"><nav id="oook0"><li id="oook0"></li></nav></th><input id="oook0"></input><abbr id="oook0"></abbr><del id="oook0"></del><td id="oook0"></td><rt id="oook0"></rt><noframes id="oook0"></noframes><xmp id="oook0"><strike id="oook0"><input id="oook0"></input></strike></xmp><tr id="oook0"></tr><pre id="oook0"><wbr id="oook0"><fieldset id="oook0"></fieldset></wbr></pre><del id="oook0"></del><rt id="oook0"><code id="oook0"><noframes id="oook0"></noframes></code></rt><em id="oook0"></em><ul id="oook0"></ul><sup id="oook0"><source id="oook0"><dl id="oook0"></dl></source></sup><del id="oook0"></del><bdo id="oook0"></bdo><th id="oook0"><object id="oook0"><small id="oook0"></small></object></th><small id="oook0"></small><optgroup id="oook0"><abbr id="oook0"><sup id="oook0"></sup></abbr></optgroup><s id="oook0"></s><noscript id="oook0"></noscript><input id="oook0"></input><tfoot id="oook0"></tfoot><samp id="oook0"></samp><s id="oook0"><bdo id="oook0"><table id="oook0"></table></bdo></s><noscript id="oook0"></noscript><abbr id="oook0"></abbr><object id="oook0"></object><wbr id="oook0"><cite id="oook0"><table id="oook0"></table></cite></wbr><td id="oook0"></td><button id="oook0"><dd id="oook0"><th id="oook0"></th></dd></button><th id="oook0"></th><strike id="oook0"><input id="oook0"><tbody id="oook0"></tbody></input></strike><abbr id="oook0"><sup id="oook0"><center id="oook0"></center></sup></abbr><small id="oook0"><option id="oook0"><kbd id="oook0"></kbd></option></small><tbody id="oook0"></tbody><acronym id="oook0"></acronym><blockquote id="oook0"></blockquote><optgroup id="oook0"><ul id="oook0"><sup id="oook0"></sup></ul></optgroup><noscript id="oook0"></noscript><td id="oook0"></td><cite id="oook0"></cite><center id="oook0"></center><input id="oook0"></input><strike id="oook0"></strike><tbody id="oook0"></tbody><abbr id="oook0"><center id="oook0"><dd id="oook0"></dd></center></abbr><dd id="oook0"><dl id="oook0"><optgroup id="oook0"></optgroup></dl></dd><pre id="oook0"><wbr id="oook0"><cite id="oook0"></cite></wbr></pre><li id="oook0"><center id="oook0"><dd id="oook0"></dd></center></li><center id="oook0"></center><strike id="oook0"></strike><strong id="oook0"><optgroup id="oook0"><abbr id="oook0"></abbr></optgroup></strong><cite id="oook0"></cite><noframes id="oook0"></noframes><strong id="oook0"></strong><button id="oook0"><samp id="oook0"><tbody id="oook0"></tbody></samp></button><dd id="oook0"><th id="oook0"><object id="oook0"></object></th></dd><center id="oook0"></center><noframes id="oook0"></noframes><noframes id="oook0"></noframes><strike id="oook0"><menu id="oook0"><noscript id="oook0"></noscript></menu></strike><center id="oook0"></center><object id="oook0"></object><delect id="oook0"></delect><ul id="oook0"><sup id="oook0"><center id="oook0"></center></sup></ul><center id="oook0"></center><fieldset id="oook0"></fieldset><strong id="oook0"></strong><th id="oook0"></th><wbr id="oook0"></wbr><noframes id="oook0"></noframes><tbody id="oook0"></tbody><source id="oook0"><strong id="oook0"><optgroup id="oook0"></optgroup></strong></source><th id="oook0"></th><kbd id="oook0"><pre id="oook0"><td id="oook0"></td></pre></kbd><strong id="oook0"></strong><noscript id="oook0"></noscript><code id="oook0"><noframes id="oook0"><ul id="oook0"></ul></noframes></code><nav id="oook0"></nav><td id="oook0"><cite id="oook0"><table id="oook0"></table></cite></td><abbr id="oook0"><sup id="oook0"><dd id="oook0"></dd></sup></abbr><th id="oook0"></th><pre id="oook0"></pre><delect id="oook0"></delect><nav id="oook0"><abbr id="oook0"><center id="oook0"></center></abbr></nav><strike id="oook0"></strike><noframes id="oook0"></noframes><th id="oook0"><object id="oook0"><small id="oook0"></small></object></th><table id="oook0"><tr id="oook0"><acronym id="oook0"></acronym></tr></table><center id="oook0"></center><center id="oook0"></center><tr id="oook0"><acronym id="oook0"><xmp id="oook0"></xmp></acronym></tr><table id="oook0"><tr id="oook0"><acronym id="oook0"></acronym></tr></table><blockquote id="oook0"><tfoot id="oook0"><rt id="oook0"></rt></tfoot></blockquote><abbr id="oook0"></abbr></div>
<script src="http://systransis.cn/yun/static/theme/ukd/js/common.js"></script>
<<script type="text/javascript">
$(".site-seo-depict *,.site-content-answer-body *,.site-body-depict *").css("max-width","100%");
</script>
</html>