feat: 修改ui用例的报告路径

This commit is contained in:
2026-05-13 17:22:54 +08:00
parent 15bbbeeae9
commit 9b8c187344
36 changed files with 5091 additions and 192 deletions

View File

@@ -0,0 +1,230 @@
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\logging\__init__.py", line 1154, in emit
stream.write(msg + self.terminator)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 6] 句柄无效。
Call stack:
File "c:\Users\a\PyCharmMiscProject\smart-management-auto-test\Joyhub_ui_auto_test\tests\test_my_order.py", line 132, in <module>
raise SystemExit(pytest.main([str(Path(__file__))]))
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\config\__init__.py", line 199, in main
ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 365, in pytest_cmdline_main
return wrap_session(config, _main)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 318, in wrap_session
session.exitstatus = doit(config, session) or 0
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 372, in _main
config.hook.pytest_runtestloop(session=session)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 396, in pytest_runtestloop
item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 118, in pytest_runtest_protocol
runtestprotocol(item, nextitem=nextitem)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 131, in runtestprotocol
rep = call_and_report(item, "setup", log)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 244, in call_and_report
call = CallInfo.from_call(
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 353, in from_call
result: TResult | None = func()
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 245, in <lambda>
lambda: runtest_hook(item=item, **kwds),
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 165, in pytest_runtest_setup
item.session._setupstate.setup(item)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 523, in setup
col.setup()
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\python.py", line 1723, in setup
self._request._fillfixtures()
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\fixtures.py", line 707, in _fillfixtures
item.funcargs[argname] = self.getfixturevalue(argname)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\fixtures.py", line 539, in getfixturevalue
fixturedef = self._get_active_fixturedef(argname)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\fixtures.py", line 627, in _get_active_fixturedef
fixturedef.execute(request=subrequest)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\fixtures.py", line 1110, in execute
result: FixtureValue = ihook.pytest_fixture_setup(
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\fixtures.py", line 1202, in pytest_fixture_setup
result = call_fixture_func(fixturefunc, request, kwargs)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\fixtures.py", line 908, in call_fixture_func
fixture_result = next(generator)
File "C:\Users\a\PyCharmMiscProject\smart-management-auto-test\Joyhub_ui_auto_test\tests\conftest.py", line 207, in test_run_logger
logger.info("用例开始: %s", case_name)
Message: '用例开始: %s'
Arguments: ('tests/test_my_order.py::test_home_my_order_first_order_detail_after_login[chromium]',)
2026-05-13 15:00:58,144 [INFO] tests.test_my_order - 登录用户从首页进入 My Order 并查看第一笔订单详情
2026-05-13 15:00:58,145 [INFO] tests.test_my_order - 打开链接地址: https://joyhub-website-frontend-test.best-envision.com/
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\logging\__init__.py", line 1154, in emit
stream.write(msg + self.terminator)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 6] 句柄无效。
Call stack:
File "c:\Users\a\PyCharmMiscProject\smart-management-auto-test\Joyhub_ui_auto_test\tests\test_my_order.py", line 132, in <module>
raise SystemExit(pytest.main([str(Path(__file__))]))
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\config\__init__.py", line 199, in main
ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 365, in pytest_cmdline_main
return wrap_session(config, _main)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 318, in wrap_session
session.exitstatus = doit(config, session) or 0
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 372, in _main
config.hook.pytest_runtestloop(session=session)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 396, in pytest_runtestloop
item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 118, in pytest_runtest_protocol
runtestprotocol(item, nextitem=nextitem)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 137, in runtestprotocol
reports.append(call_and_report(item, "call", log))
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 244, in call_and_report
call = CallInfo.from_call(
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 353, in from_call
result: TResult | None = func()
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 245, in <lambda>
lambda: runtest_hook(item=item, **kwds),
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 179, in pytest_runtest_call
item.runtest()
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\python.py", line 1720, in runtest
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\python.py", line 166, in pytest_pyfunc_call
result = testfunction(**testargs)
File "C:\Users\a\PyCharmMiscProject\smart-management-auto-test\Joyhub_ui_auto_test\tests\test_my_order.py", line 124, in test_home_my_order_first_order_detail_after_login
ensure_logged_in_user()
File "C:\Users\a\PyCharmMiscProject\smart-management-auto-test\Joyhub_ui_auto_test\tests\conftest.py", line 114, in _ensure_logged_in_user
login_as_configured_user_if_needed(page)
File "C:\Users\a\PyCharmMiscProject\smart-management-auto-test\Joyhub_ui_auto_test\tests\conftest.py", line 67, in login_as_configured_user_if_needed
logger.info("当前未登录,执行配置用户登录")
Message: '当前未登录,执行配置用户登录'
Arguments: ()
2026-05-13 15:01:01,382 [INFO] tests.test_my_order - 等待登录完成并展示用户菜单入口
2026-05-13 15:01:01,413 [INFO] tests.test_my_order - 从首页查找 My Order 入口
2026-05-13 15:01:01,481 [INFO] tests.test_my_order - 已通过首页可见入口进入 My Order: a[href*="order" i]
2026-05-13 15:01:01,481 [INFO] tests.test_my_order - 等待进入订单列表页
2026-05-13 15:01:02,386 [INFO] tests.test_my_order - 点击第一笔订单详情入口
2026-05-13 15:01:02,551 [INFO] tests.test_my_order - 已点击订单详情入口: a[href*="order" i]
2026-05-13 15:01:32,567 [INFO] tests.test_my_order - 点击第一笔订单后 URL 未变化,继续校验当前页面是否展示详情内容
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\logging\__init__.py", line 1154, in emit
stream.write(msg + self.terminator)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 6] 句柄无效。
Call stack:
File "c:\Users\a\PyCharmMiscProject\smart-management-auto-test\Joyhub_ui_auto_test\tests\test_my_order.py", line 132, in <module>
raise SystemExit(pytest.main([str(Path(__file__))]))
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\config\__init__.py", line 199, in main
ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 365, in pytest_cmdline_main
return wrap_session(config, _main)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 318, in wrap_session
session.exitstatus = doit(config, session) or 0
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 372, in _main
config.hook.pytest_runtestloop(session=session)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\main.py", line 396, in pytest_runtestloop
item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 118, in pytest_runtest_protocol
runtestprotocol(item, nextitem=nextitem)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 142, in runtestprotocol
reports.append(call_and_report(item, "teardown", log, nextitem=nextitem))
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 244, in call_and_report
call = CallInfo.from_call(
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 353, in from_call
result: TResult | None = func()
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 245, in <lambda>
lambda: runtest_hook(item=item, **kwds),
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_hooks.py", line 512, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pluggy\_callers.py", line 121, in _multicall
res = hook_impl.function(*args)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 194, in pytest_runtest_teardown
item.session._setupstate.teardown_exact(nextitem)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\runner.py", line 555, in teardown_exact
fin()
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\fixtures.py", line 1042, in finish
fin()
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\allure_commons\_allure.py", line 274, in __call__
return self._fixture_function(*args, **kwargs)
File "C:\Users\a\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\_pytest\fixtures.py", line 924, in _teardown_yield_fixture
next(it)
File "C:\Users\a\PyCharmMiscProject\smart-management-auto-test\Joyhub_ui_auto_test\tests\conftest.py", line 217, in test_run_logger
logger.info("用例通过: %s, 耗时: %.2fs", case_name, elapsed)
Message: '用例通过: %s, 耗时: %.2fs'
Arguments: ('tests/test_my_order.py::test_home_my_order_first_order_detail_after_login[chromium]', 34.6412463998422)