YAPI斷言功能無法使用,報錯assert.equal is not a function(已解決)
公司搭建了yapi,介面平臺處於起步狀態,最近在測試介面時發現一個問題:YAPI斷言功能無法使用,報錯assert.equal is not a function
針對這個問題,解決方法為如下:
1.進入該路徑,找到sandbox.js檔案
2.編輯此檔案,新增如下紅色框內容(注意標點符號!!!):
3.儲存後,重啟yapi,我個人使用的是pm2管理,所以我的啟動方式為:pm2 restart app
4.啟動後使用pm2 ls檢視執行狀態,如果是綠色的online就表示沒問題,直接訪問yapi驗證斷言是否正常即可
4.1這是我的介面內的斷言,判斷介面響應碼是否是200和非404:
4.2,執行自動化執行,檢視介面測試結果
至此,問題已經完美解決,總結就是因為yapi的一個安全問題,使得yapi更新了自身沙箱使用,而這一更新,導致assert斷言需要手動引入後才可以使用,引入如上步驟2所示,
引入assert後就可以正常使用斷言模組了!
--祝君武運昌隆--
相關推薦
YAPI斷言功能無法使用,報錯assert.equal is not a function(已解決)
公司搭建了yapi,介面平臺處於起步狀態,最近在測試介面時發現一個問題:YAPI斷言功能無法使用,報錯assert.equal is not a function
企業微信瀏覽器報錯Object.entries is not a function
引入antd後,企業微信瀏覽器報錯Object.entries is not a function。 在其他瀏覽器、微信開發者除錯工具裡都正常。當前企業微信版本3.0.21,開啟企業微信除錯模式,檢視瀏覽器核心版本號是chrome 53
SAP 建立啟用了ARM功能的採購訂單,報錯 -Shipping processing is not selected to supplier 100057 in purchase org. 0002-
SAP 建立啟用了ARM功能的採購訂單,報錯 -Shipping processing is not selected to supplier 100057 in purchase org. 0002-
Linux Centos7安裝redis6.0.9、make報錯:make[1]: *** [server.o] Error 1(已解決)
server.c: In function ‘writeCommandsDeniedByDiskError’: server.c:3934:1: warning: control reaches end of non-void function [-Wreturn-type]
vue/cli建立的typescript專案,引入less一直報錯Syntax Error: TypeError: this.getOptions is not a function
技術標籤:一些學習的研究新手入門vuetypescript 錯誤提示如下 Syntax Error: TypeError: this.getOptions is not a function
今天遇到個bug,分享一下js報錯:Uncaught TypeError: i.push is not a function
//配置自動轉換cookie的JSON格式資料 $.cookie.json=true //讀取儲存在cookie中的購物車陣列
Datanode沒起來,報錯RemoteException(org.apache.hadoop.hdfs.protocol.UnregisteredNodeException)的解決方案...
這幾天在擴大之前搭建的hadoop叢集,我利用slave1節點建立其映象,然後再使用該映象建立兩個新的例項,這樣就免去了重新安裝配置軟體相關項的問題,方便省事。下面是一些新增節點步驟:
egg啟動時,報錯:Ignoring invalid timezone passed to Connection的解決方案
報錯資訊 Ignoring invalid timezone passed to Connection: +8:00. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a
【vue】elementUI報錯:_self.$scopedSlots.default is not a function
Vue會盡可能高效地渲染元素,通常會複用已有元素而不是從頭開始渲染。這樣也不總是符合實際需求,所以 Vue 為你提供了一種方式來表達“這兩個元素是完全獨立的,不要複用它們”。只需新增一個具有唯一值的
react除錯介面的時候報錯TypeError: Object(...)(...).then(...) is not a function“
最終發現是非同步函式的引入問題報錯說batchDeletion TypeError: Object(…)(…).then(…) is not a function" 結果是deleteMessage的引入錯誤deleteMessage引入react jsx時必須加括號 { },否則就會報
vue 報錯 ReferenceError: exports is not defined
執行專案時發現了以下問題: 發現在webpack 2後不允許混合使用import和module.exports
SQL Developer報錯:Unable to find a Java Virtual Machine解決辦法
安裝了64位的Oracle資料庫以及32位的Oracle客戶端,在開始選單中第一次開啟客戶端的SQL Developer時提示輸入java.exe的路徑,我選擇了Oracle資料庫自帶的jdk路徑,確定之後報錯:
Vue啟動報錯:TypeError: compilation.templatesPlugin is not a function
技術標籤:Vue.jsvuenode.js 專案升級啟動報錯: TypeError: compilation.templatesPlugin is not a function
報錯package xxx is not in GOROOT or GOPATH 或者 cannot find package “xxx“ in any of
GO111MODULE=“off” 在GO111MODULE=\"off\"的條件下,並且寫的程式碼不在$GOPATH/src下,也就是說下面的main.go不在$GOPATH/src目錄下面,同時我想要使用另一個module裡面的內容,並且這個module不是標準庫,或者說
使用element回到頂部元件報錯“Error: target is not existed: .page-component__scroll .el-scrollbar__wrap“
技術標籤:VUEvue.js 官方例子 <template> Scroll down to see the bottom-right button. <el-backtop target=".page-component__scroll .el-scrollbar__wrap"></el-backtop>
Joi報錯TypeError: Joi.Validate is not a function
技術標籤:模組npm資料庫npm 報錯資訊: 由於下載的joi版本不支援Validate方法導致此報錯
編譯stvo-pl報錯error: ‘random_device’ was not declared in this scope 解決方案
技術標籤:SLAMc++linuxbug 近來在研究PL-SLAM時,由於要安裝stvo-pl庫,所以我下載安裝了這個庫。在編譯階段我遇到了一個讓人頭大的問題。即紅框標出的地方報錯:error: ‘random_device’ was not declared in
httprunner 3.x報錯OSError: [WinError 6] 控制代碼無效(已解決)
前言 hrun 命令生成的html報告,雖然用例是通過的,檢視詳情發現一大堆的報錯OSError: [WinError 6] 控制代碼無效。
Uncaught TypeError: date.clone is not a function 【報錯解決】
沒有技術收穫,只是記錄一下這個報錯是form值有問題 原因是單個日期的時間控制元件下,重置form值的時候資料格式有問題,修改程式碼:
Vue外掛報錯:Vue.js is detected on this page.問題解決
外掛報錯:Vue. is detected on this pag 下載Vue外掛 下載地址:https://chrome.pictureknow.com/