From 2dd10ce613986f0856767db42f9c684bf790dd9d Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Sun, 25 Jul 2021 15:28:00 +0200 Subject: [PATCH] Adapt tests --- features/export.feature | 55 ++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/features/export.feature b/features/export.feature index 12de631b..d2f12301 100644 --- a/features/export.feature +++ b/features/export.feature @@ -275,31 +275,24 @@ Feature: Export content. Scenario: Export posts from a given category Given a WP install - - When I run `wp plugin install wordpress-importer --activate` - Then STDERR should not contain: - """ - Warning: - """ + And I run `wp site empty --yes` + And I run `wp plugin install wordpress-importer --activate` When I run `wp term create category Apple --porcelain` Then STDOUT should be a number - And save STDOUT as {TERM_ID} + And save STDOUT as {APPLE_TERM_ID} - When I run `wp site empty --yes` - And I run `wp post generate --post_type=post --count=10` - And I run `wp post list --post_type=post --format=count` - Then STDOUT should be: - """ - 10 - """ + When I run `wp term create category Pear --porcelain` + Then STDOUT should be a number + And save STDOUT as {PEAR_TERM_ID} - When I run `for id in $(wp post list --posts_per_page=5 --ids); do wp post term add $id category Apple; done` - And I run `wp post list --post_type=post --cat={TERM_ID} --format=count` - Then STDOUT should be: - """ - 5 - """ + When I run `wp post create --post_type=post --post_title='Apple Post' --post_category={APPLE_TERM_ID} --porcelain` + Then STDOUT should be a number + And save STDOUT as {APPLE_POST_ID} + + When I run `wp post create --post_type=post --post_title='Pear Post' --post_category={PEAR_TERM_ID} --porcelain` + Then STDOUT should be a number + And save STDOUT as {PEAR_POST_ID} When I run `wp export --post_type=post --category=apple` And save STDOUT 'Writing to file %s' as {EXPORT_FILE} @@ -307,6 +300,18 @@ Feature: Export content. """ """ + And the {EXPORT_FILE} file should contain: + """ + + """ + And the {EXPORT_FILE} file should not contain: + """ + + """ + And the {EXPORT_FILE} file should not contain: + """ + + """ When I run `wp site empty --yes` Then STDOUT should not be empty @@ -320,10 +325,14 @@ Feature: Export content. When I run `wp import {EXPORT_FILE} --authors=skip` Then STDOUT should not be empty - When I run `wp post list --post_type=post --format=count` - Then STDOUT should be: + When I run `wp post list --post_type=post` + Then STDOUT should contain: """ - 5 + Apple Post + """ + And STDOUT should not contain: + """ + Pear Post """ Scenario: Export posts should include user information