@@ -4,11 +4,18 @@ Feature: Convert classic post content to blocks
44 # https://github.com/WordPress/gutenberg/pull/82013 (branch
55 # `try/13163-php-block-conversion`), which no released Gutenberg build
66 # provides yet. The scenarios tagged @broken below need a Gutenberg build
7- # of that PR. To run them locally, build the plugin ZIP from that branch,
8- # remove the @broken tags, and add the following step after the
9- # `Given a WP install` step in each scenario:
7+ # of that PR, which CI cannot install, so `composer behat` skips them.
8+ # To run them locally:
109 #
11- # And I run `wp plugin install /path/to/gutenberg.zip --activate`
10+ # 1. Build the plugin zip from that branch
11+ # (`npm run build:plugin-zip` in a Gutenberg checkout).
12+ # 2. Copy it to `gutenberg.zip` in the root of this package. Git ignores it.
13+ # 3. Prepare the test database once with `composer prepare-tests`.
14+ # 4. Run the scenarios by tag, bypassing the @broken exclusion:
15+ #
16+ # vendor/bin/behat --tags=@broken features/post-convert-to-blocks.feature
17+ #
18+ # Each scenario installs the zip with `wp plugin install gutenberg.zip --activate`.
1219
1320 Scenario : Conversion requires the Gutenberg build with server-side block conversion
1421 Given a WP install
@@ -55,6 +62,7 @@ Feature: Convert classic post content to blocks
5562 @broken
5663 Scenario : Convert a classic post to blocks
5764 Given a WP install
65+ And I run `wp plugin install {PROJECT_DIR}/gutenberg.zip --activate`
5866
5967 When I run `wp post create --post_title='Classic post' --post_content='<h2>Title</h2><p>Text</p>' --porcelain`
6068 Then save STDOUT as {POST_ID}
@@ -86,6 +94,7 @@ Feature: Convert classic post content to blocks
8694 @broken
8795 Scenario : Preview a conversion with --dry-run
8896 Given a WP install
97+ And I run `wp plugin install {PROJECT_DIR}/gutenberg.zip --activate`
8998
9099 When I run `wp post create --post_title='Classic post' --post_content='<h2>Title</h2><p>Text</p>' --porcelain`
91100 Then save STDOUT as {POST_ID}
@@ -107,6 +116,7 @@ Feature: Convert classic post content to blocks
107116 @broken
108117 Scenario : Skip posts that already contain blocks
109118 Given a WP install
119+ And I run `wp plugin install {PROJECT_DIR}/gutenberg.zip --activate`
110120
111121 When I run `wp post create --post_title='Block post' --post_content='<!-- wp:paragraph --><p>Text</p><!-- /wp:paragraph -->' --porcelain`
112122 Then save STDOUT as {POST_ID}
@@ -125,6 +135,7 @@ Feature: Convert classic post content to blocks
125135 @broken
126136 Scenario : Skip posts without content
127137 Given a WP install
138+ And I run `wp plugin install {PROJECT_DIR}/gutenberg.zip --activate`
128139
129140 When I run `wp post create --post_title='Empty post' --post_content='' --porcelain`
130141 Then save STDOUT as {POST_ID}
@@ -143,6 +154,7 @@ Feature: Convert classic post content to blocks
143154 @broken
144155 Scenario : Report missing posts as failures
145156 Given a WP install
157+ And I run `wp plugin install {PROJECT_DIR}/gutenberg.zip --activate`
146158
147159 When I run `wp post create --post_title='Classic post' --post_content='<p>Text</p>' --porcelain`
148160 Then save STDOUT as {POST_ID}
0 commit comments