drunomics/playwright-drupal-utils

提供用于 playwright 测试的命令和辅助工具。

安装量: 7,052

依赖者: 1

建议者: 0

安全性: 0

星级: 3

关注者: 9

分支: 1

类型:playwright 辅助工具

1.2.12 2024-07-24 16:09 UTC

README

依赖关系

  • Drush

概览

该包提供

  • PlaywrightDrushCommands 类中的各种 drush 命令,这些命令对于使用 playwright 进行测试非常有用。该类在包安装时自动加载并准备就绪。

  • 测试辅助工具和命令

    • ./tests/helpers/drupal-commands 中的函数是测试中用于与 Drupal API 通信的可重用辅助工具。

    • ./tests/helpers/ldp-test 包含了一个示例,它是对 playwright 测试的扩展,包含适合测试来自不同来源的解耦项目的额外变量。

    • ./tests/helpers/test-methods 是一组可重用且常用的辅助函数集合,例如登录和退出网站、检查头等。

    • ./tests/helpers/a11y-helper 是一个辅助工具,用于使用 axe-core 运行无障碍性检查。

设置

  • 将此包添加到您项目的开发依赖项中。
  • 将包类型 "playwright-helper" 添加到 composer.json 的 "installer-types" 部分
  • 通过调整 composer.json 中的 installer-paths 调整包的安装位置。该包需要安装在包含您的 playwright 安装(package.json 位置)的目录中。
  • 在测试文件中引入辅助工具,例如 const helpers = require("../playwright-drupal-utils/tests/helpers/test-methods");

许可证

致谢

由 drunomics GmbH 开发,hello@drunomics.com 请参考提交日志以了解个别贡献者。