- Introduction - webinar
- Scope of Cypress - comparison with PHPUnit
- Minimal setup - for local test and CI integration
- Basic commands
- PHPStorm integration
- Documentation
- Agile practices > Development practices > TDD
- BDD
- Test a site from the configuration
- Fixtures for the content (PHPUnit @dataProvider)
- Just as PHPUnit functional, setup a Drupal site
- Can be wrapped in a module / custom modules or the project
- Covers shadow DOM so works with progressive or full decoupling
- E2E: what the user interacts with, so includes any kind of hooks or alteration
Valid setup for Travis, CircleCI, ... In this case, the site can be installed from the configuration and cached.
Get Drupal
composer create-project drupal/recommended-project drupal
Require development packages and Cypress module
composer require --dev drupal/core-dev
composer require --dev drupal/cypress
cd web/modules/contrib/cypress
nvm use 14
yarn
Install the minimal profile and Cypress module
php web/core/scripts/drupal install minimal
drush en cypress -y
Start and run a test server
drush serve
drush cypress:run
drush cypress:[command]
- run: run with the CLI
- open: run with the GUI
- list: list test suites
- clear: clear Cypress caches
Limit run
by
- test suite: mytestsuite
- directory, feature: mytestsuite:sub/folder, mytestsuite:sub/folder/Example.feature
- tag: --tags "@COMPLETED and @WIP"
Plugins: Cucumber.js, Gherkin