drunomics/playwright-drupal-utils

Provides commands and helpers for testing with playwright.

Installs: 5 415

Dependents: 1

Suggesters: 0

Security: 0

Stars: 3

Watchers: 7

Forks: 1

Type:playwright-helper

1.2.11 2024-02-20 09:44 UTC

This package is auto-updated.

Last update: 2024-03-20 09:55:55 UTC


README

Dependencies:

  • Drush

Overview:

The package provides:

  • Various drush commands in the PlaywrightDrushCommands class useful for testing with playwright. The class is autoloaded and ready to use when package is installed.

  • Test helpers and commands

    • The functions in ./tests/helpers/drupal-commands are reusable helpers for communicating with drupal API in tests.

    • ./tests/helpers/ldp-test holds a fixture, an extension of playwright test which carries additional variables suitable for testing decoupled projects with diverse origins.

    • ./tests/helpers/test-methods is a collection of reusable and often used helper functions, for example logging in and out of the site, headers check etc.

    • ./tests/helpers/a11y-helper is a helper for running accessibility checks using axe-core.

Setup

  • Add this package to your project's dev dependencies.
  • Add package type "playwright-helper" to "installer-types" section of your composer.json
  • Adjust the package installation location by adjusting installer-paths in your composer.json. The package needs to be installed in the directory with your playwright installation (location of your package.json).
  • Require the helpers in your test files e.g. const helpers = require("../playwright-drupal-utils/tests/helpers/test-methods");

License

  • Drush Extension is licensed under GPLv3 or later
  • JavaScript code is licensed under MIT

Credits

developed by drunomics GmbH, hello@drunomics.com Please refer to the commit log individual contributors.