feat: update headless config

This commit is contained in:
defnngj 2022-09-19 22:55:54 +08:00
parent 9c3a124dd0
commit 9fa529d7ab
2 changed files with 6 additions and 6 deletions

View File

@ -12,8 +12,8 @@ class RunConfig:
# 配置浏览器驱动类型(chromium, firefox, webkit)。
browser = "chromium"
# 运行模式(headless, headful
mode = "headless"
# 运行模式(True/False
headless = False
# 配置运行的 URL
url = "https://www.baidu.com"

8
run.py
View File

@ -32,16 +32,16 @@ def run_tests():
init_env(RunConfig.NEW_REPORT)
html_report = os.path.join(RunConfig.NEW_REPORT, "report.html")
xml_report = os.path.join(RunConfig.NEW_REPORT, "junit-xml.xml")
if RunConfig.mode == "headless":
pytest.main(["-s", "-v", RunConfig.cases_path,
if RunConfig.headless is True:
pytest.main(["-s", "-v", "--headed", RunConfig.cases_path,
"--browser=" + RunConfig.browser,
"--html=" + html_report,
"--junit-xml=" + xml_report,
"--self-contained-html",
"--maxfail", RunConfig.max_fail,
"--reruns", RunConfig.rerun])
if RunConfig.mode == "headful":
pytest.main(["-s", "-v", "--headful", RunConfig.cases_path,
if RunConfig.headless is False:
pytest.main(["-s", "-v", RunConfig.cases_path,
"--browser=" + RunConfig.browser,
"--html=" + html_report,
"--junit-xml=" + xml_report,