diff --git a/features/export.feature b/features/export.feature index aa3818f2..4e69ae59 100644 --- a/features/export.feature +++ b/features/export.feature @@ -1001,7 +1001,7 @@ Feature: Export content. Then STDOUT should be a number And save STDOUT as {EXPORT_SUBCATEGORY_ID} - When I run `wp term create post_tag Tech --description="Technology-related" --porcelain` + When I run `wp term create post_tag Tech --slug=tech --description="Technology-related" --porcelain` Then STDOUT should be a number And save STDOUT as {EXPORT_TAG_ID} @@ -1009,7 +1009,7 @@ Feature: Export content. Then STDOUT should be a number And save STDOUT as {EXPORT_TERM_ID} - When I run `wp post create --post_title='Breaking News' --post_category={EXPORT_CATEGORY_ID} --tags_input={EXPORT_TAG_ID} --porcelain` + When I run `wp post create --post_title='Breaking News' --post_category={EXPORT_CATEGORY_ID} --tags_input=tech --porcelain` Then STDOUT should be a number And save STDOUT as {EXPORT_POST_ID} @@ -1291,3 +1291,65 @@ Feature: Export content. """ 2 """ + + @require-wp-5.2 + Scenario: Export posts by ID should include post tags + Given a WP install + And I run `wp plugin install wordpress-importer --activate` + And I run `wp site empty --yes` + + When I run `wp term create post_tag featured --slug=featured-2 --porcelain` + Then STDOUT should be a number + And save STDOUT as {TAG_ID} + + When I run `wp post create --post_title='Tagged Post' --tags_input=featured-2 --porcelain` + Then STDOUT should be a number + And save STDOUT as {POST_ID} + + When I run `wp export --post__in={POST_ID}` + Then save STDOUT 'Writing to file %s' as {EXPORT_FILE} + And the {EXPORT_FILE} file should contain: + """ + + """ + And the {EXPORT_FILE} file should contain: + """ + featured-2 + """ + And the {EXPORT_FILE} file should contain: + """ + + """ + And the {EXPORT_FILE} file should contain: + """ + {POST_ID} + """ + And the {EXPORT_FILE} file should contain: + """ + + """ + + When I run `wp site empty --yes` + Then STDOUT should not be empty + + When I run `wp import {EXPORT_FILE} --authors=skip` + Then STDOUT should contain: + """ + Success: + """ + + When I run `wp post list --format=count` + Then STDOUT should be: + """ + 1 + """ + + When I run `wp post list --format=ids` + Then STDOUT should be a number + And save STDOUT as {IMPORTED_POST_ID} + + When I run `wp post term list {IMPORTED_POST_ID} post_tag --field=slug` + Then STDOUT should be: + """ + featured-2 + """