Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Update the theme in feature tests
  • Loading branch information
tfirdaus committed Apr 17, 2024
commit 402d758b658f950101af2190f257d4fb07be4a84
2 changes: 1 addition & 1 deletion features/theme-delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Delete WordPress themes

Background:
Given a WP install
And I run `wp theme install p2`
And I run `wp theme install twentytwelve`

Scenario: Delete an installed theme
When I run `wp theme delete p2`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When I run `wp theme delete p2`
When I run `wp theme delete twentytwelve`

Because we're now installing twentytwelve in Background

Expand Down
10 changes: 5 additions & 5 deletions features/theme-install.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Install WordPress themes
Scenario: Return code is 1 when one or more theme installations fail
Given a WP install

When I try `wp theme install p2 p2-not-a-theme`
When I try `wp theme install twentytwelve p2-not-a-theme`
Then STDERR should contain:
"""
Warning:
Expand All @@ -26,7 +26,7 @@ Feature: Install WordPress themes
"""
And the return code should be 1

When I try `wp theme install p2`
When I try `wp theme install twentytwelve`
Then STDOUT should be:
"""
Success: Theme already installed.
Expand All @@ -37,7 +37,7 @@ Feature: Install WordPress themes
"""
And the return code should be 0

When I try `wp theme install p2-not-a-theme`
When I try `wp theme install twentytwelve-not-a-theme`
Then STDERR should contain:
"""
Warning:
Expand Down Expand Up @@ -90,10 +90,10 @@ Feature: Install WordPress themes
Scenario: Verify installed theme activation
Given a WP install

When I run `wp theme install p2`
When I run `wp theme install twentytwelve`
Then STDOUT should not be empty

When I try `wp theme install p2 --activate`
When I try `wp theme install twentytwelve --activate`
Then STDERR should contain:
"""
Warning: p2: Theme already installed.
Expand Down
8 changes: 4 additions & 4 deletions features/theme-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: Update WordPress themes
Scenario: Install a theme, then update to a specific version of that theme
Given a WP install

When I run `wp theme install p2 --version=1.4.1`
When I run `wp theme install twentytwelve --version=1.4.1`
Then STDOUT should not be empty

When I run `wp theme update p2 --version=1.4.2`
Expand Down Expand Up @@ -51,7 +51,7 @@ Feature: Update WordPress themes
"""

# One theme installed.
Given I run `wp theme install p2 --version=1.4.2`
Given I run `wp theme install twentytwelve --version=1.4.2`

When I try `wp theme update`
Then the return code should be 1
Expand Down Expand Up @@ -113,7 +113,7 @@ Feature: Update WordPress themes
"""
Error: Can't find the requested theme's version 1.4.2 in the WordPress.org theme repository (HTTP code 404).
"""

Scenario: Error when both --minor and --patch are provided
Given a WP install

Expand All @@ -139,7 +139,7 @@ Feature: Update WordPress themes
"""
3.9
"""

Scenario: Update a theme to its latest patch release
Given a WP install
And I run `wp theme install --force twentytwelve --version=1.1`
Expand Down
24 changes: 12 additions & 12 deletions features/theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Manage WordPress themes
Scenario: Installing and deleting theme
Given a WP install

When I run `wp theme install p2`
When I run `wp theme install twentytwelve`
Then STDOUT should not be empty

When I run `wp theme status p2`
Expand Down Expand Up @@ -74,7 +74,7 @@ Feature: Manage WordPress themes
Scenario: Install a theme, activate, then force install an older version of the theme
Given a WP install

When I run `wp theme install p2 --version=1.4.2`
When I run `wp theme install twentytwelve --version=1.4.2`
Then STDOUT should not be empty

When I run `wp theme list --name=p2 --field=update_version`
Expand All @@ -96,7 +96,7 @@ Feature: Manage WordPress themes
Success: Deleted
"""

When I run `wp theme install p2 --version=1.4.1 --force`
When I run `wp theme install twentytwelve --version=1.4.1 --force`
Then STDOUT should not be empty

When I run `wp theme list`
Expand All @@ -117,7 +117,7 @@ Feature: Manage WordPress themes
P2 updated successfully from version 1.4.1 to version
"""

When I run `wp theme install p2 --version=1.4.1 --force`
When I run `wp theme install twentytwelve --version=1.4.1 --force`
Then STDOUT should not be empty

When I run `wp theme update --all`
Expand All @@ -129,7 +129,7 @@ Feature: Manage WordPress themes
Scenario: Exclude theme from bulk updates.
Given a WP install

When I run `wp theme install p2 --version=1.4.1 --force`
When I run `wp theme install twentytwelve --version=1.4.1 --force`
Then STDOUT should contain:
"""
Downloading install
Expand Down Expand Up @@ -170,7 +170,7 @@ Feature: Manage WordPress themes
Scenario: Get the path of an installed theme
Given a WP install

When I run `wp theme install p2`
When I run `wp theme install twentytwelve`
Then STDOUT should not be empty

When I run `wp theme path p2 --dir`
Expand All @@ -182,7 +182,7 @@ Feature: Manage WordPress themes
Scenario: Activate an already active theme
Given a WP install

When I run `wp theme install p2`
When I run `wp theme install twentytwelve`
Then STDOUT should not be empty

When I run `wp theme activate p2`
Expand Down Expand Up @@ -231,7 +231,7 @@ Feature: Manage WordPress themes
And I run `if test -d wp-content/themes; then echo "fail"; fi`
Then STDOUT should be empty

When I run `wp theme install p2 --activate`
When I run `wp theme install twentytwelve --activate`
Then STDOUT should not be empty

When I run `wp theme list --fields=name,status`
Expand Down Expand Up @@ -486,7 +486,7 @@ Feature: Manage WordPress themes
Scenario: Get status field in theme detail
Given a WP install

When I run `wp theme install p2`
When I run `wp theme install twentytwelve`
Then STDOUT should not be empty

When I run `wp theme get p2`
Expand All @@ -512,7 +512,7 @@ Feature: Manage WordPress themes
Scenario: Theme activation fails when slug does not match exactly
Given a WP install

When I run `wp theme install p2`
When I run `wp theme install twentytwelve`
Then the return code should be 0

When I try `wp theme activate P2`
Expand Down Expand Up @@ -569,7 +569,7 @@ Feature: Manage WordPress themes

Scenario: Parent theme is active when its child is active
Given a WP install
And I run `wp theme install p2`
And I run `wp theme install twentytwelve`
And I run `wp theme install moina-blog --activate`

When I run `wp theme is-active moina-blog`
Expand All @@ -584,7 +584,7 @@ Feature: Manage WordPress themes
Scenario: Excluding a missing theme should not throw an error
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install p2 --version=1.5.5 --activate`
And I run `wp theme install twentytwelve --version=1.5.5 --activate`
And I run `wp theme update --all --exclude=missing-theme`
Then STDERR should be empty
And STDOUT should contain:
Expand Down