ATK Installation
When to Use
Initial install of ATK on a Drupal 11 site.
Pattern: install with the demo recipe (fresh site)
Test sites only. Never enable ATK or
qa_accountson a production site. See ATK Overview for why.
The recipe requires performant-labs/qa_accounts: dev-main. Packagist serves it, from github.com/Performant-Labs/qa_accounts. A dev-main requirement needs minimum-stability dev (or @dev) in your root composer.json.
composer config minimum-stability dev
composer require 'drupal/automated_testing_kit:2.1.0-beta5' 'drupal/automated_testing_kit_demo_recipe:^2.1@beta'
drush recipe ../recipes/automated_testing_kit_demo_recipe
The drush recipe path is the vendor docs' form. The recipe is type: drupal-recipe, so Composer installs it under recipes/, not modules/contrib/. The 2.1 recipe:
- Installs ATK,
automated_testing_kit_demo,qa_accounts,webform,xmlsitemap,feeds,pathauto,redirect,token,admin_toolbar,autologout,session_management,login_securityandcontact_block - Imports demo nodes, a
contactwebform and aprivate_file_testcontent type - Sets 403/404 pages to
/403-error-pageand/404-error-page, and lets visitors register
On RecipeAppliedEvent, the demo submodule then:
- Runs
atk_setup playwrightwithATK_HOME=.. - Sets
drushCmdtoddev drushandbaseURLto the current host - Creates
../privateand pointsfile_private_pathat it - Rebuilds caches and runs cron
It assumes DDEV and Playwright (RecipeEventSubscriber.php).
Pattern: install on an existing site
ATK's composer.json requires only PHP, so require qa_accounts yourself. The drupal.org package drupal/qa_accounts 8.x-1.1 (2026-01-26) supports core ^9.5 || ^10 || ^11. It creates one qa_<role> account per role, with the password equal to the username. That matches qaUsers.json.
composer require 'drupal/automated_testing_kit:2.1.0-beta5' 'drupal/qa_accounts:^1.1'
drush en automated_testing_kit qa_accounts
web/modules/contrib/automated_testing_kit/module_support/atk_setup playwright # or: cypress
npm install
npx playwright install
Run atk_setup from the project root. Its second argument is link to symlink instead of copy, or back to copy tests back into the module. ATK_HOME sets the target directory (default .).
Resulting Layout (Playwright)
<ATK_HOME>/
├── package.json # from module_support/development/playwright.package.json
├── playwright.config.js # testDir './tests', setup project, atk_reporter
├── playwright.atk.config.js # drushCmd, routes, email, pantheon, targetSite, tugboat
└── tests/
├── atk_*/ # the catalog
├── data/ # qaUsers.json, preflightTests.yml, fixtures
└── support/ # atk_commands.js, atk_utilities.js, atk_reporter.js
For Cypress, the tests go to cypress/e2e/, data to cypress/data/ and support to cypress/support/. The config files still land at ATK_HOME.
Individual tests need more modules; enable only those for the suites you run (see Test Catalog).
Common Mistakes
- Running
drush recipe modules/contrib/...— the recipe lives inrecipes/ - Leaving
minimum-stabilityatstablefor the recipe — Composer rejectsperformant-labs/qa_accounts: dev-main - Installing both
drupal/qa_accountsandperformant-labs/qa_accounts— they share the module machine nameqa_accounts; pick one - Installing on production — never; see ATK Overview
- Skipping the target URL —
baseURLinplaywright.config.jsis hardcoded to ATK's own dev host until you change it - Assuming host-only runs — the README supports native, host-against-container and in-container runs
See Also
- Versions & Compatibility
- Runner Configuration
- Playwright for Visual Regression — Setup
- Reference: https://www.drupal.org/project/automated_testing_kit_demo_recipe