基于Playwright和pytest的Web自动化测试框架的设计与实现
DOI:
CSTR:
作者:
作者单位:

中国电子科技集团公司第十五研究所

作者简介:

通讯作者:

中图分类号:

TP311.56

基金项目:


Design and Implementation of Web Automation Test Framework Based on Playwright and pytest
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    手工测试效率较低,为有效降低人力成本,解决以Selenium为基础的传统框架普遍存在的稳定性差、测试用例执行效率低等问题,对Playwright自动化测试工具进行了深入研究;利用其智能等待、多浏览器原生支持等优势,将其与Pytest测试框架深度结合,并采用分层设计思想,实现了代码的复用与维护便捷性;设计并实现了一套基于Playwright和Pytest的自动化测试框架,同时针对局域网环境下依赖包安装、环境配置繁琐的痛点,梳理出一套可落地的局域网环境下框架搭建方法;经项目实际应用验证,有效实现了测试执行效率与稳定性的显著提升,大幅降低了测试成本。

    Abstract:

    Manual testing is inefficient. To effectively reduce labor costs and address the common problems of poor stability and low test case execution efficiency in traditional Selenium-based frameworks, in-depth research was conducted on the Playwright automated testing tool. By leveraging its advantages such as intelligent waiting and native support for multiple browsers, it was deeply integrated with the Pytest testing framework, and a layered design approach was adopted to achieve code reusability and ease of maintenance. A set of automated testing framework based on Playwright and Pytest was designed and implemented. Additionally, to address the pain points of complex dependency package installation and environment configuration in a local area network environment, a practical method for framework setup in such an environment was developed. Project application verification has demonstrated significant improvements in test execution efficiency and stability, as well as a substantial reduction in testing costs.

    参考文献
    相似文献
    引证文献
引用本文
分享
相关视频

文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2026-03-09
  • 最后修改日期:2026-04-18
  • 录用日期:2026-04-21
  • 在线发布日期:
  • 出版日期:
文章二维码