Taxonomy
DrevOps\BehatSteps\Steps\Drupal\TaxonomyTrait - Source, Example, Helpers
Manage Drupal taxonomy terms with vocabulary organization.
- Create terms in an existing vocabulary, with field values.
- Navigate to term pages.
- Verify vocabulary configurations.
Prerequisites
| Prerequisite | Capability |
|---|---|
| A backend in the scenario's list provides "TermCapabilityInterface" | TermCapabilityInterface |
| The core "taxonomy" module is enabled | ModuleCapabilityInterface |
Steps
@Given the following :vocabulary terms with fields exist:
Create taxonomy terms with vertical field format
Given the following tags terms with fields exist:
| name | [TEST] Behat | [TEST] Testing |
| description | Testing tag | QA tag |
@Given the following :vocabulary terms exist:
Create taxonomy terms in a vocabulary from a table of field values
Given the following tags terms exist:
| name | description |
| [TEST] Behat | Testing tag |
@Given the following :vocabulary terms do not exist:
Remove terms from a specified vocabulary
Given the following "fruits" terms do not exist:
| Apple |
| Pear |
@When I visit the :vocabulary term page with the name :name
Visit specified vocabulary term page
When I visit the "fruits" term page with the name "Apple"
@When I visit the :vocabulary term edit page with the name :name
Visit specified vocabulary term edit page
When I visit the "fruits" term edit page with the name "Apple"
@When I visit the :vocabulary term delete page with the name :name
Visit specified vocabulary term delete page
When I visit the "tags" term delete page with the name "[TEST] Remove"
@Then the vocabulary :vocabulary with the name :name should exist
Assert that a vocabulary with a specific name exists
Then the vocabulary "topics" with the name "Topics" should exist
@Then the vocabulary :vocabulary should not exist
Assert that a vocabulary does not exist by machine name
Then the vocabulary "topics" should not exist
@Then the :vocabulary term with the name :name should exist
Assert that a taxonomy term exists by name
Then the "Fruits" term with the name "Apple" should exist
@Then the :vocabulary term with the name :name should not exist
Assert that a taxonomy term does not exist by name
Then the "Fruits" term with the name "Apple" should not exist