1、自動化測試的目錄結構
2、測試套件和報告run_suite.py
"""
目標:1、搜尋組裝測試套件
2、指定報告存放路徑及檔名稱
3、執行測試套件並生成測試報告(使用htmltestrunner)
"""import unittest
import time
from tools.htmltestrunner import htmltestrunner
#組裝測試套件
suite=unittest.defaulttestloader.discover(
"./case"
,pattern=
"test*.py"
)#指定報告存放路徑及檔名稱
file_path=
"./report/{}.html"
.format
(time.strftime(
"%y_%m_%d %h_%m_%s"))
#執行測試套件並生成測試報告
with
open
(file_path,
"wb"
)as f:
htmltestrunner(stream=f)
.run(suite)
頭條專案介面自動化測試 二 之測試用例設計
1 用例設計 模版 id 模組 介面名稱 請求url 用例名稱 請求方法 請求引數型別 請求引數 預期結果 實際結果 備註。注意 單介面顆粒度放的比較小 以測試資料為顆粒度 2 實踐 請求登陸介面 響應 設計用例 1 用例設計 模版 id 模組 介面名稱 請求url 用例名稱 請求方法 請求引數型別...
自動化測試之六 自動化測試模型
from selenium import webdriver chrome driver path r c users administrator envs selenuimautotest lib site packages selenium webdriver chrome chromedriv...
介面測試 介面自動化測試
1 介面自動化到底關注哪些點?a.關注函式 類 方法 所提供的介面的可靠性 b.關注介面之間銜接的可靠性 c.關注介面引數的校驗 2 介面有哪幾種型別?a.http協議中 get post put delete input方法 b.目前自動化工具提供的有get和post兩種方法 3 用介面實現自動化...