automated_testing_kit
Almost 3-dozen useful tests, two-dozen useful utility functions, pre-flight checks, accessibility test support and performance test support for Cypress.io and Playwright.
Quick Start
- Install a local demo with the Automated Testing Kit Demonstration Recipe written instructions
- Install a local demo with the Automated Testing Kit Demonstration Recipe video tutorial
- Watch an Introduction (42 min)
Introducing Automated Testing Kit
Version 2.0 is ready! The module and tests have been upgraded for Drupal 11. Use version 1.3 if you want to add testing to a Drupal 10 site.
Version 2.1 is being prepared. 2.1 will have the first FedRAMP tests, Feed tests and more.
See this blog post for an introduction and the philosophy of the kit.
Join the #automated_testing_kit channel in the Drupal Slack workspace to get support.
Get a demo running quickly on your own machine with the Demo Recipe.
Some tests you'll find are:
- logging in, logging out and registering new users
- reset password
- Contact Us form
- 404, 403 tests
- Caching
- Entity creation, update and deletion tests (node, media, taxonomy, user)
- Sitemap testing (using the XML Sitemap module)
- Menus and
- Search
- FedRAMP compliance
You'll also find:
- loads of convenience functions (i.e. getting usernames, Drupal UIDs, etc.)
- integration with the QA Accounts module
- executing Drush commands via aliases or to Pantheon via Terminus
- pre-flight verification (checking that the target site is ready for testing)
- multi-level debugging
- accessibility testing support with the AXE library
- performance testing support with Google Lighthouse
- and hooks that make specifying selectors easy.
NOTE: We don’t recommend running Cypress or Playwright in a container, as accessing their GUIs is challenging. Instead, install them on the host OS, while using tools like DDEV, Lando, or Docksal for your Drupal installation. The demo recipe shows a typical installation.
We're always adding more tests; consider contributing if you have a great test others will find useful. The goal is to get a standard test for each key part of Drupal so that:
- lots of the basics are already done for you
- testers have examples they can modify quickly.
Bugs and New Features
Have you discovered a bug? Do you have a test or utility you can contribute? First check if there is already an issue; if there isn't, create one.
Check back for planned, new FedRAMP tests.
Getting Started with Automated Testing
Are you about to start a testing program on Drupal? Check out this 54-minute overview and best practices video from Stanford Web Camp 2023 called Setting up a Comprehensive Automated Testing Regime for Drupal using Cypress and Playwright (André Angelantoni, May, 2023).
Or watch Kickstarting End-to-End Testing at Stanford Neuroscience with Automated Testing Kit.
Unsure whether to use Cypress or Playwright? Watch Should I Choose Cypress or Playwright? from BADCamp 2024.
Additional videos:
H/t to these Drupalists from whom I got some functions for the module:
- Cypress Testing for Drupal Websites (Jordan Graham, June, 2022)
- End to end testing with Playwright (Petar Basic, DrupalCon 2022)
- Test-driven development with Drupal and Cypress.io (Philipp Melab, DrupalCon Global 2020)
- Make the Robots Do It! Practical Continuous Integration and Automated Testing (Shawn DeArmond, Mark Miller, BADCamp 2019)
Ready to start your testing program?
We can help you set up your testing program with mentoring, test-writing and ongoing test maintenance for you in Cypress or Playwright. Learn what we offer.
Tools We Use
Thanks to the following companies:
- Diffy for providing a free account of their Visual Regression tool (an excellent complement to your end-to-end user-journey/functional tests in Cypress or Playwright)
- Testery.io for providing a free account of their capable test grid (for fast parallel testing)
- Testiny.io for providing a free account of their sleek test case management system (part of their open-source program)
- Tugboat QA for providing a free account of their time-saving preview platform.