分享

playwright-pytest-example - 使用 Python、Playwright 和 Pytest 进行 e2e 网络测试 ptoject 和 Allure 报告并将视频文件附加到 a

 wenxuefeng360 2022-07-05 发布于四川

 

运行测试

进入

test
目录

在 1 个线程中运行测试

pytest login_tests.py --headful

并行运行测试

pipenv install pytest-xdist
cd test
pytest login_tests.py registration_tests.py article_tests.py --headful -n 3

与 Allure Report 并行运行

cd test
pytest login_tests.py article_tests.py registration_tests.py --headful --alluredir=./allure-results -n 3
allure generate
allure serve allure-results

在所有浏览器引擎(chromium、firefox、webkit)上运行测试

# Note!!!!
# Make sure that "@pytest.mark.only_browser" decorators are commented under the tests

pytest article_tests.py --browser chromium --browser firefox --browser webkit --headful -n 3

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多