Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 32 additions & 23 deletions features/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -275,38 +275,43 @@ 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}
Then the {EXPORT_FILE} file should contain:
"""
<category domain="category" nicename="apple"><![CDATA[Apple]]></category>
"""
And the {EXPORT_FILE} file should contain:
"""
<![CDATA[Apple Post]]>
"""
And the {EXPORT_FILE} file should not contain:
"""
<category domain="category" nicename="pear"><![CDATA[Pear]]></category>
"""
And the {EXPORT_FILE} file should not contain:
"""
<![CDATA[Pear Post]]>
"""

When I run `wp site empty --yes`
Then STDOUT should not be empty
Expand All @@ -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
Expand Down