You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1128ff9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: features/block-search.feature
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Feature: Search posts by block usage
5
5
Given a WP install
6
6
7
7
Scenario: Search posts by block type usage
8
-
When I run `wp post create --post_title='Quote Post' --post_status=publish --post_type=post --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Hello world</p></blockquote><!-- /wp:quote -->' --porcelain`
8
+
When I run `wp post --post_type=post create --post_title='Quote Post' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Hello world</p></blockquote><!-- /wp:quote -->' --porcelain`
9
9
Then STDOUT should be a number
10
10
And save STDOUT as {QUOTE_POST_ID}
11
11
@@ -16,7 +16,7 @@ Feature: Search posts by block usage
16
16
"""
17
17
18
18
Scenario: Search posts by block namespace
19
-
When I run `wp post create --post_title='Core Namespace Post' --post_status=publish --post_type=post --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Hello core</p></blockquote><!-- /wp:quote -->' --porcelain`
19
+
When I run `wp post --post_type=post create --post_title='Core Namespace Post' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Hello core</p></blockquote><!-- /wp:quote -->' --porcelain`
20
20
Then STDOUT should be a number
21
21
And save STDOUT as {CORE_NAMESPACE_POST_ID}
22
22
@@ -27,7 +27,7 @@ Feature: Search posts by block usage
27
27
"""
28
28
29
29
Scenario: Search nested block usage
30
-
When I run `wp post create --post_title='Nested Image Post' --post_status=publish --post_type=page --post_content='<!-- wp:group --><div class="wp-block-group"><!-- wp:image {"sizeSlug":"large"} --><figure class="wp-block-image size-large"><img alt="" /></figure><!-- /wp:image --></div><!-- /wp:group -->' --porcelain`
30
+
When I run `wp post --post_type=page create --post_title='Nested Image Post' --post_status=publish --post_content='<!-- wp:group --><div class="wp-block-group"><!-- wp:image {"sizeSlug":"large"} --><figure class="wp-block-image size-large"><img alt="" /></figure><!-- /wp:image --></div><!-- /wp:group -->' --porcelain`
31
31
Then STDOUT should be a number
32
32
And save STDOUT as {NESTED_POST_ID}
33
33
@@ -38,14 +38,14 @@ Feature: Search posts by block usage
38
38
"""
39
39
40
40
Scenario: Search block usage by style
41
-
When I run `wp post create --post_title='Rounded Image Post' --post_status=publish --post_type=post --post_content='<!-- wp:image {"className":"is-style-rounded"} --><figure class="wp-block-image is-style-rounded"><img alt="" /></figure><!-- /wp:image -->' --porcelain`
41
+
When I run `wp post --post_type=post create --post_title='Rounded Image Post' --post_status=publish --post_content='<!-- wp:image {"className":"is-style-rounded"} --><figure class="wp-block-image is-style-rounded"><img alt="" /></figure><!-- /wp:image -->' --porcelain`
42
42
Then STDOUT should be a number
43
43
And save STDOUT as {ROUNDED_IMAGE_POST_ID}
44
44
45
-
When I run `wp post create --post_title='Plain Image Post' --post_status=publish --post_type=post --post_content='<!-- wp:image --><figure class="wp-block-image"><img alt="" /></figure><!-- /wp:image -->' --porcelain`
45
+
When I run `wp post --post_type=post create --post_title='Plain Image Post' --post_status=publish --post_content='<!-- wp:image --><figure class="wp-block-image"><img alt="" /></figure><!-- /wp:image -->' --porcelain`
46
46
Then STDOUT should be a number
47
47
48
-
When I run `wp post create --post_title='Rounded Quote Post' --post_status=publish --post_type=post --post_content='<!-- wp:quote {"className":"is-style-rounded"} --><blockquote class="wp-block-quote is-style-rounded"><p>Hello quote</p></blockquote><!-- /wp:quote -->' --porcelain`
48
+
When I run `wp post --post_type=post create --post_title='Rounded Quote Post' --post_status=publish --post_content='<!-- wp:quote {"className":"is-style-rounded"} --><blockquote class="wp-block-quote is-style-rounded"><p>Hello quote</p></blockquote><!-- /wp:quote -->' --porcelain`
49
49
Then STDOUT should be a number
50
50
And save STDOUT as {ROUNDED_QUOTE_POST_ID}
51
51
@@ -67,11 +67,11 @@ Feature: Search posts by block usage
67
67
"""
68
68
69
69
Scenario: Search block usage count
70
-
When I run `wp post create --post_title='Counted Quote One' --post_status=publish --post_type=post --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>One</p></blockquote><!-- /wp:quote -->' --porcelain`
70
+
When I run `wp post --post_type=post create --post_title='Counted Quote One' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>One</p></blockquote><!-- /wp:quote -->' --porcelain`
71
71
Then STDOUT should be a number
72
72
And save STDOUT as {COUNTED_QUOTE_ONE_ID}
73
73
74
-
When I run `wp post create --post_title='Counted Quote Two' --post_status=publish --post_type=post --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Two</p></blockquote><!-- /wp:quote -->' --porcelain`
74
+
When I run `wp post --post_type=post create --post_title='Counted Quote Two' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Two</p></blockquote><!-- /wp:quote -->' --porcelain`
75
75
Then STDOUT should be a number
76
76
And save STDOUT as {COUNTED_QUOTE_TWO_ID}
77
77
@@ -93,7 +93,7 @@ Feature: Search posts by block usage
93
93
"""
94
94
95
95
Scenario: Search block usage with selected fields in JSON
96
-
When I run `wp post create --post_title='Double Quote Post' --post_status=publish --post_type=post --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>One</p></blockquote><!-- /wp:quote --><!-- wp:quote --><blockquote class="wp-block-quote"><p>Two</p></blockquote><!-- /wp:quote -->' --porcelain`
96
+
When I run `wp post --post_type=post create --post_title='Double Quote Post' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>One</p></blockquote><!-- /wp:quote --><!-- wp:quote --><blockquote class="wp-block-quote"><p>Two</p></blockquote><!-- /wp:quote -->' --porcelain`
97
97
Then STDOUT should be a number
98
98
And save STDOUT as {DOUBLE_QUOTE_POST_ID}
99
99
@@ -104,11 +104,11 @@ Feature: Search posts by block usage
104
104
"""
105
105
106
106
Scenario: Search blocks embedded from a specific pattern
107
-
When I run `wp post create --post_title='Pattern RSVP Post' --post_status=publish --post_type=post --post_content='<!-- wp:group {"metadata":{"categories":["call-to-action"],"patternName":"twentytwentyfive/event-rsvp","name":"Event RSVP"}} --><div class="wp-block-group"><!-- wp:paragraph --><p>RSVP now</p><!-- /wp:paragraph --></div><!-- /wp:group -->' --porcelain`
107
+
When I run `wp post --post_type=post create --post_title='Pattern RSVP Post' --post_status=publish --post_content='<!-- wp:group {"metadata":{"categories":["call-to-action"],"patternName":"twentytwentyfive/event-rsvp","name":"Event RSVP"}} --><div class="wp-block-group"><!-- wp:paragraph --><p>RSVP now</p><!-- /wp:paragraph --></div><!-- /wp:group -->' --porcelain`
108
108
Then STDOUT should be a number
109
109
And save STDOUT as {PATTERN_RSVP_POST_ID}
110
110
111
-
When I run `wp post create --post_title='Pattern Header Post' --post_status=publish --post_type=post --post_content='<!-- wp:group {"metadata":{"categories":["header"],"patternName":"twentytwentyfive/site-header","name":"Site Header"}} --><div class="wp-block-group"><!-- wp:paragraph --><p>Header block</p><!-- /wp:paragraph --></div><!-- /wp:group -->' --porcelain`
111
+
When I run `wp post --post_type=post create --post_title='Pattern Header Post' --post_status=publish --post_content='<!-- wp:group {"metadata":{"categories":["header"],"patternName":"twentytwentyfive/site-header","name":"Site Header"}} --><div class="wp-block-group"><!-- wp:paragraph --><p>Header block</p><!-- /wp:paragraph --></div><!-- /wp:group -->' --porcelain`
112
112
Then STDOUT should be a number
113
113
And save STDOUT as {PATTERN_HEADER_POST_ID}
114
114
@@ -136,7 +136,7 @@ Feature: Search posts by block usage
136
136
"""
137
137
138
138
Scenario: Search pattern blocks with an additional block filter
139
-
When I run `wp post create --post_title='Patterned Image Post' --post_status=publish --post_type=post --post_content='<!-- wp:group {"metadata":{"categories":["media"],"patternName":"twentytwentyfive/media-highlight","name":"Media Highlight"}} --><div class="wp-block-group"><!-- wp:image --><figure class="wp-block-image"><img alt="" /></figure><!-- /wp:image --></div><!-- /wp:group -->' --porcelain`
139
+
When I run `wp post --post_type=post create --post_title='Patterned Image Post' --post_status=publish --post_content='<!-- wp:group {"metadata":{"categories":["media"],"patternName":"twentytwentyfive/media-highlight","name":"Media Highlight"}} --><div class="wp-block-group"><!-- wp:image --><figure class="wp-block-image"><img alt="" /></figure><!-- /wp:image --></div><!-- /wp:group -->' --porcelain`
140
140
Then STDOUT should be a number
141
141
And save STDOUT as {PATTERN_IMAGE_POST_ID}
142
142
@@ -147,7 +147,7 @@ Feature: Search posts by block usage
147
147
"""
148
148
149
149
Scenario: Search uses the nearest pattern ancestor for nested patterns
150
-
When I run `wp post create --post_title='Nested Pattern Image Post' --post_status=publish --post_type=post --post_content='<!-- wp:group {"metadata":{"categories":["outer"],"patternName":"twentytwentyfive/outer-shell","name":"Outer Shell"}} --><div class="wp-block-group"><!-- wp:group {"metadata":{"categories":["inner"],"patternName":"twentytwentyfive/inner-media","name":"Inner Media"}} --><div class="wp-block-group"><!-- wp:image --><figure class="wp-block-image"><img alt="" /></figure><!-- /wp:image --></div><!-- /wp:group --></div><!-- /wp:group -->' --porcelain`
150
+
When I run `wp post --post_type=post create --post_title='Nested Pattern Image Post' --post_status=publish --post_content='<!-- wp:group {"metadata":{"categories":["outer"],"patternName":"twentytwentyfive/outer-shell","name":"Outer Shell"}} --><div class="wp-block-group"><!-- wp:group {"metadata":{"categories":["inner"],"patternName":"twentytwentyfive/inner-media","name":"Inner Media"}} --><div class="wp-block-group"><!-- wp:image --><figure class="wp-block-image"><img alt="" /></figure><!-- /wp:image --></div><!-- /wp:group --></div><!-- /wp:group -->' --porcelain`
151
151
Then STDOUT should be a number
152
152
And save STDOUT as {NESTED_PATTERN_IMAGE_POST_ID}
153
153
@@ -172,11 +172,11 @@ Feature: Search posts by block usage
172
172
Then STDOUT should be a number
173
173
And save STDOUT as {SYNCED_PATTERN_ID}
174
174
175
-
When I run `wp post create --post_title='Reusable Pattern Post' --post_status=publish --post_type=post --post_content='<!-- wp:block {"ref":{SYNCED_PATTERN_ID}} /-->' --porcelain`
175
+
When I run `wp post --post_type=post create --post_title='Reusable Pattern Post' --post_status=publish --post_content='<!-- wp:block {"ref":{SYNCED_PATTERN_ID}} /-->' --porcelain`
176
176
Then STDOUT should be a number
177
177
And save STDOUT as {SYNCED_PATTERN_POST_ID}
178
178
179
-
When I run `wp post create --post_title='Different Reusable Pattern Post' --post_status=publish --post_type=post --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Not reusable</p></blockquote><!-- /wp:quote -->' --porcelain`
179
+
When I run `wp post --post_type=post create --post_title='Different Reusable Pattern Post' --post_status=publish --post_content='<!-- wp:quote --><blockquote class="wp-block-quote"><p>Not reusable</p></blockquote><!-- /wp:quote -->' --porcelain`
180
180
Then STDOUT should be a number
181
181
182
182
When I run `wp block search --synced-pattern={SYNCED_PATTERN_ID} --field=ID`
0 commit comments