天天看點

python+pytest+jenkins 接口測試

  • 1.python優點
    • 1、java語句比較嚴謹,python比較靈活;
    • 2、python有衆多可用的子產品庫,類似 java的開源jar包
    • 3、python學習成本低
    • 共同點:
      • 1、都是解釋性語言,編譯型or解釋型
  • 2.pytest優勢
    • 1、簡單易上手,适合單元測試
    • 2、pytest的fixture支援函數活類參數化,參考文檔
    • 3、pytest具有很多第三方插件,并且可以自定義擴充,比較好用的如pytest-selenium(內建selenium)、pytest-html(完美html測試報告生成)、pytest-rerunfailures(失敗case重複執行)等;
  • 3.jenkins核心配置
    • 1、安裝與配置(自行🔍)
    • 2、shell腳本配置
    • shell代碼:
source /data/program/venv3/bin/activate
cd /data/program/venv3/project/auto
rm -rf asset-http-automation/
git clone [email protected]:finance-qa/ass