Python HTMLTestRunner測試報告view按鈕失效解決方案
背景
HTMLTestRunner 生成測試報告后,發現點擊 view 這個按鈕一直沒有反應
通過 F12 開發人員工具檢查,發現是 jQuery 文件沒有加載出來
解決方法
我采用的解決方法是直接修改源代碼
1.打開Python的安裝環境
2.進入 lib 文件夾
3.進入 site-packages 文件夾
4.進入 HtmlTestRunner 文件夾
5.進入 template 文件夾
6.進入記事本等編輯工具打開 report_template.html 文件
7.在文件的 142 行,找到這句代碼,并修改 src 源 ,替換掉這個jQuery庫就可以了
<!-- 修改前 --><script src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'></script><!-- 修改后 --><script src='https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'>
替換方案
Staticfile CDN <script src='https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js'> 百度 CDN <script src='https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'> 又拍云 CDN <script src='https://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.2.min.js'> 新浪 CDN <script src='https://lib.sinaapp.com/js/jquery/2.0.2/jquery-2.0.2.min.js'> Google CDN <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'>
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。
相關文章:
