consensus/behat-drupal-context
最新稳定版本:1.0.4
Composer 安装命令:
composer require consensus/behat-drupal-context
包简介
Behat Drupal Context
README 文档
README
Extended support for creating content in a Drupal site.
See: https://packagist.org/packages/consensus/behat-drupal-context
Installation and setup
composer require consensus/behat-drupal-context
behat.yml
default:
suites:
default:
contexts:
- Consensus\BehatDrupalContext\Context\DrupalTestContentContext
- Consensus\BehatDrupalContext\Context\DrupalDemoContentContext
- Drupal\DrupalExtension\Context\DrupalContext
DrupalTestContentContext
This package extends the DrupalExtension Behat step definitions for a number of variations of content creation in a Drupal 8+ site:
- Create Paragraphs
Given a "part_1_paragraph" paragraph named "example_part_1_paragraph":
| id | 100 |
| field_part_1_text | Lorem ipsum |
- Create entities (users, nodes, paragraphs) from a
.table.txtfile:
Given users from "features/entities/users.table.txt"
Given "page" content from "features/entities/node-pages.table.txt"
Where .table.txt is a markdown-formatted table like this:
| title | status | created | author | body |
| Example Basic Page | 1 | 2023-02-02 09:00am | user101 | This is the BODY |
- Create paragraphs in 2 formats, or from a file:
Given a "simple_paragraph" paragraph named "example_paragraph_1":
| field_paragraph_title | Paragraph Title |
| field_paragraph_desc | Paragraph Desc |
Given "simple_paragraph" paragraphs:
| paragraph_name | field_simple_paragraph_title | field_simple_paragraph_desc |
| example_paragraph | Title goes here | Decription goes here |
Given "simple_paragraph" paragraphs from "features/entities/paragraphs.table.txt"
Where .table.txt is a markdown-formatted table like this:
| paragraph_name | field_simple_paragraph_title | field_simple_paragraph_desc |
| example_paragraph | Title goes here | Decription goes here |
DrupalDemoContentContext
Create entities (users, nodes, paragraphs) that persist after the Scenario completes (eg. for demo content).
- Users that persist:
Given persistent users:
| uid | name | pass | email | roles |
| 101 | user101 | pwd | user101@example.com | |
- Nodes that persist:
Given persistent "page" content:
| title | status | created | author | body |
| Example Basic Page | 1 | 2023-02-02 09:00am | user101 | This is the BODY |
Given persistent "page" content from "features/entities/node-page.table.txt"
- Paragraphs that persist:
Given a "simple_paragraph" persistent paragraph named "example_paragraph_1":
| field_paragraph_title | Paragraph Title |
| field_paragraph_desc | Paragraph Desc |
Given persistent "simple_paragraph" paragraphs:
| paragraph_name | field_simple_paragraph_title | field_simple_paragraph_desc |
| example_paragraph | Title goes here | Decription goes here |
Given persistent "simple_paragraph" paragraphs from "features/entities/paragraphs-simple.table.txt"
统计信息
- 总下载量: 7.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2023-03-07