From b9c5276ec40e2e80d4958a126c377b171b5baa43 Mon Sep 17 00:00:00 2001 From: 阳洁 <2077506045@qq.com> Date: 星期四, 13 七月 2023 15:32:41 +0800 Subject: [PATCH] 测评系统自动测试 --- main.py | 2 ++ testcase/test_smoking.py | 2 +- report/report.html | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index c5d920f..4647a64 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,5 @@ +import time + import pytest import pytest_html diff --git a/report/report.html b/report/report.html index 40651a1..9ea0dc7 100644 --- a/report/report.html +++ b/report/report.html @@ -253,10 +253,10 @@ } </script> <h1>report.html</h1> - <p>Report generated on 13-Jul-2023 at 14:10:29 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> v3.2.0</p> + <p>Report generated on 13-Jul-2023 at 15:20:12 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> v3.2.0</p> <h2>Summary</h2> - <p>4 tests ran in 5.98 seconds. </p> - <p class="filter" hidden="true">(Un)check the boxes to filter the results.</p><input checked="true" class="filter" data-test-result="passed" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="passed">1 passed</span>, <input checked="true" class="filter" data-test-result="skipped" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="skipped">0 skipped</span>, <input checked="true" class="filter" data-test-result="failed" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="failed">3 failed</span>, <input checked="true" class="filter" data-test-result="error" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="error">0 errors</span>, <input checked="true" class="filter" data-test-result="xfailed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xfailed">0 expected failures</span>, <input checked="true" class="filter" data-test-result="xpassed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xpassed">0 unexpected passes</span> + <p>4 tests ran in 25.54 seconds. </p> + <p class="filter" hidden="true">(Un)check the boxes to filter the results.</p><input checked="true" class="filter" data-test-result="passed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="passed">0 passed</span>, <input checked="true" class="filter" data-test-result="skipped" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="skipped">0 skipped</span>, <input checked="true" class="filter" data-test-result="failed" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="failed">4 failed</span>, <input checked="true" class="filter" data-test-result="error" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="error">0 errors</span>, <input checked="true" class="filter" data-test-result="xfailed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xfailed">0 expected failures</span>, <input checked="true" class="filter" data-test-result="xpassed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xpassed">0 unexpected passes</span> <h2>Results</h2> <table id="results-table"> <thead id="results-table-head"> @@ -271,7 +271,7 @@ <tr> <td class="col-result">Failed</td> <td class="col-name">testcase/test_smoking.py::TestSmoking::test_login</td> - <td class="col-duration">4.36</td> + <td class="col-duration">12.07</td> <td class="col-links"></td></tr> <tr> <td class="extra" colspan="4"> @@ -289,16 +289,16 @@ <tr> <td class="col-result">Failed</td> <td class="col-name">testcase/test_smoking.py::TestSmoking::test_open_url</td> - <td class="col-duration">0.00</td> + <td class="col-duration">0.02</td> <td class="col-links"></td></tr> <tr> <td class="extra" colspan="4"> <div class="empty log">No log output captured.</div></td></tr></tbody> - <tbody class="passed results-table-row"> + <tbody class="failed results-table-row"> <tr> - <td class="col-result">Passed</td> + <td class="col-result">Failed</td> <td class="col-name">testcase/test_smoking.py::TestSmoking::test_answer</td> - <td class="col-duration">8.81</td> + <td class="col-duration">13.11</td> <td class="col-links"></td></tr> <tr> <td class="extra" colspan="4"> diff --git a/testcase/test_smoking.py b/testcase/test_smoking.py index cfb667f..506d68b 100644 --- a/testcase/test_smoking.py +++ b/testcase/test_smoking.py @@ -46,7 +46,7 @@ # 鍑虹幇寮傚父琛ㄧず涓嶅瓨鍦ㄥ埛鏂版寜閽�,閫�鍑哄惊鐜� break - login_page.login("admin", "HyNc#jp0z#N7Y5ih", "ots") + login_page.login("admin", "ots@2021!!", "ots") time.sleep(2) assert login_page.is_login_success() -- Gitblit v1.9.1