mediacurrent/ci-tests
Composer 安装命令:
composer require mediacurrent/ci-tests
包简介
Scripts helpful for testing a Drupal site on a Continuous-Integration server, or locally.
README 文档
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-testsRepository Configuration (if necessary):
If the package is not found, you might need to add it to the
repositoriessection 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/testsdirectory to./tests. It will not overwrite any existing files in your./testsdirectory.
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.shscript (mentioned above) must have been run to copy thetestsdirectory, 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
pnpminsidetests/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.
统计信息
- 总下载量: 90.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2018-10-25