mediacurrent / ci-tests
Scripts helpful for testing a Drupal site on a Continuous-Integration server, or locally.
Requires
- dev-main
- dev-feature/MCT-2064--report-improvements
- dev-bugfix/MCT-2068--playwright-install
- dev-feature/MCT-2064--process-end-detection
- dev-feature/MCT-2065-update-component-streaming
- dev-bugfix/MCT-2060--env-vaar-fix
- dev-MCT-2048-phpunit
- dev-feature/MCT-2055-hackathon-playwright-ui
- dev-Casey-Wilson/readmemd-edited-online-with-bitbucket-1746805300715
- dev-mct/playwright-baseline
- dev-master
- dev-feature/qa-webdriver-chromedriver
- dev-ignite-cypress
- dev-test-behat-firefox
- dev-feature/MCIT-406--phpcs-warnings
- dev-feature/MCIT-180--behat-chrome
- dev-feature/MCT-627--self-signed-ssl
- dev-feature/behat-improvements
- dev-feature/pa11y-update
- dev-feature/update-bdd-mis-profile
This package is auto-updated.
Last update: 2025-06-11 12:30:46 UTC
README
This package provides a collection of helpful scripts for testing a Drupal site on a Continuous Integration (CI) server or locally.
Features ✨
This package includes the following example tests:
code-fixer.sh
: PHP Code Beautifier and Fixer (PHP CS Fixer)code-sniffer.sh
: PHP CodeSniffer (PHPCS)cypress/
: Cypress End-to-End Testingpa11y/pa11y-review.sh
: Pa11y Accessibility Testingphpunit.sh
: PHPUnit (Unit & Kernel tests)playwright/
: Playwright End-to-End and Visual Regression Testing
Installation 💻
Require the package using Composer:
composer require mediacurrent/ci-tests
Repository Configuration (if necessary):
If the package is not found, you might need to add it to the
repositories
section of yourcomposer.json
:"repositories": [ { "type": "vcs", "url": "git@bitbucket.org:mediacurrent/ci-tests.git" } ]
Initialize Tests:
Run the following script from your project's root directory to copy the example tests into your project:
./vendor/mediacurrent/ci-tests/scripts/tests-init.sh
📝 Note: This script copies the
./vendor/mediacurrent/ci-tests/tests
directory to./tests
. It will not overwrite any existing files in your./tests
directory.
Playwright UI Setup and Launch 🎭
To simplify setting up and launching the Playwright test runner UI, a helper script is provided. This script automates Node.js version management (via NVM), dependency installation (via pnpm), and launching the UI.
Prerequisites
- NVM (Node Version Manager): Must be installed.
- Git: Often used by NVM to install Node.js versions.
- The
tests-init.sh
script (mentioned above) must have been run to copy thetests
directory, includingtests/playwright
.
Running the Setup Script
Execute the script from your project's root directory:
./vendor/mediacurrent/ci-tests/scripts/setup-and-launch.sh
Alternatively, if you are already inside your project's tests/playwright
directory:
../../vendor/mediacurrent/ci-tests/scripts/setup-and-launch.sh
The script will perform the following steps:
- Ensure you are using the correct Node.js version (as defined in
tests/playwright/.nvmrc
). - Install project dependencies using
pnpm
insidetests/playwright
. - Launch the Playwright UI development server.
Follow the on-screen prompts. The UI will typically be available at the address shown in the terminal (e.g., http://localhost:9323
or similar, Playwright's default show-report port).
Credits 🙏
- Thanks to the Doobie project for example Behat configuration.
- Thanks to Jonathan Daggerhart for Cypress examples and supporting setup code. See: daggerhartlab/cypress-drupal.