Download the PHP package droptica/drupal-codeception without Composer
On this page you can find all versions of the php package droptica/drupal-codeception. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download droptica/drupal-codeception
More information about droptica/drupal-codeception
Files in droptica/drupal-codeception
Package drupal-codeception
Short Description Codeception toolset for Drupal testing.
License GPL-2.0
Informations about the package drupal-codeception
Drupal Codeception
Overview
Sets of codeception modules and utilities to test drupal cms. Includes:
- Drupal Bootstrap
- Drupal Entity
- Drupal User
- Drupal Watchdog
- Drupal Drush
- Drupal Acceptance
Installation
Require package:
If codeception was not previously set up:
If you require only one suite for now (e.g. acceptance):
Drupal Bootstrap
Provides full bootstrapping in to Drupal before test. Allows using drupal API in test cases.
Configuration
- server: Server and execution environment information.
- root: Drupal root. Uses DrupalFinder to detect the Drupal root. Falls back to codeception root +
/web
. (optional)
Drupal Drush
Provides drush (runDrush
) command.
Configuration
- working_directory: Working directory where drush should be executed. Defaults to codeception root.
- drush: Drush executable. Defaults to
drush
.
Usage
Run drush config import and store output.
$output = $i->runDrush('cim -y');
Get one-time login url.
$uri = $i->getLoginUri('userName');
Drupal Entity
Provides better interaction with drupal entities and test entity cleanup service.
Configuration
- cleanup_test: Indicator if test entities should be deleted after each test.
- cleanup_failed: Indicator if test entities should be deleted after test fails.
- cleanup_suite: Indicator if test entities should be deleted after suite.
- route_entities: Entity list that can be retrieved by url.
Usage
Create entities.
$node = $i->createEntity(['title => 'My node', 'type' => 'page']);
$term = $i->createEntity(['name => 'My term', 'vid' => 'tag'], 'taxonomy_term');
Delete all stored test entities.
$i->doEntityCleanup();
Register test entity.
$i->registerTestEntity('node', '99');
Register test entity by url.
$i->registerTestEntityByUrl($i->grabFromCurrentUrl());
Get entity by url.
$entity = $i->getEntityFromUrl($i->grabFromCurrentUrl());
Drupal User
Provides better interaction with drupal user and test user setup and cleanup service.
Configuration
- default_role: Default user role if no specified. Defaults to 'authenticated'
- driver: Driver used for interacting with site. Defaults to WebDriver.
- drush: Drush executable. Defaults to
drush
. - cleanup_entities: Entities to delete when test user gets deleted.
- cleanup_test: Indicator if test entities should be deleted after each test.
- cleanup_failed: Indicator if test entities should be deleted after test fails.
- cleanup_suite: Indicator if test entities should be deleted after suite.
Usage
Create test user with specified roles.
$user = $i->createUserWithRoles(['editor', 'authenticated'], 'password');
Log in user by username.
$i->loginAs('userName');
Create new user with certain role and login.
$i->logInWithRole('administrator');
Drupal Watchdog
Provides log checking while testing.
Configuration
- enabled: Wheather automatic check is enabled after suite. Defaults to
TRUE
- level: Global log level that would produce fail. Defaults to 'ERROR'.
- channels: Individual log channel settings.
Usage
Clean logs.
$i->prepareLogWatch();
Check logs.
$i->checkLogs();
Drupal Acceptance
Provides helper methods to interact with drupal via webdriver.
Usage
Drupal Fields Utility
Provides xpath builder object for drupal specific form field xpath retrieval.
Includes:
- FormField: Fields that can be set to cardinality unlimited
- MTOFormField: Single value fields.
- ParagraphFormField: Paragraph form fields.
Usage
Create paragraph field with machine name field_page_elements.
$page_elements = ParagraphFormField::field_page_elements();
Get next paragraph.
$page_elements->next();
Fill title field value from field page elements.
$i->fillField(FormField::title($page_elements)->value);
Add new paragraph of type liftup_element.
All versions of drupal-codeception with dependencies
codeception/module-webdriver Version ^3
webflo/drupal-finder Version ^1.2
fakerphp/faker Version ^1.19