|
| 1 | +Feature: Check for plugin updates |
| 2 | + |
| 3 | + @require-wp-5.2 |
| 4 | + Scenario: Check for plugin updates with no updates available |
| 5 | + Given a WP install |
| 6 | + |
| 7 | + When I run `wp plugin install wordpress-importer --activate` |
| 8 | + Then STDOUT should not be empty |
| 9 | + |
| 10 | + When I run `wp plugin check-update` |
| 11 | + Then STDOUT should contain: |
| 12 | + """ |
| 13 | + Success: All plugins are up to date. |
| 14 | + """ |
| 15 | + And the return code should be 0 |
| 16 | + |
| 17 | + @require-wp-5.2 |
| 18 | + Scenario: Check for plugin updates with updates available |
| 19 | + Given a WP install |
| 20 | + |
| 21 | + When I run `wp plugin install wordpress-importer --version=0.5 --activate` |
| 22 | + Then STDOUT should not be empty |
| 23 | + |
| 24 | + When I run `wp plugin check-update` |
| 25 | + Then STDOUT should be a table containing rows: |
| 26 | + | name | status | version | |
| 27 | + | wordpress-importer | active | 0.5 | |
| 28 | + And STDOUT should contain: |
| 29 | + """ |
| 30 | + update_version |
| 31 | + """ |
| 32 | + And the return code should be 0 |
| 33 | + |
| 34 | + @require-wp-5.2 |
| 35 | + Scenario: Check for specific plugin updates |
| 36 | + Given a WP install |
| 37 | + |
| 38 | + When I run `wp plugin install wordpress-importer --version=0.5` |
| 39 | + Then STDOUT should not be empty |
| 40 | + |
| 41 | + When I run `wp plugin install akismet` |
| 42 | + Then STDOUT should not be empty |
| 43 | + |
| 44 | + When I run `wp plugin check-update wordpress-importer` |
| 45 | + Then STDOUT should be a table containing rows: |
| 46 | + | name | status | version | |
| 47 | + | wordpress-importer | inactive | 0.5 | |
| 48 | + And STDOUT should contain: |
| 49 | + """ |
| 50 | + update_version |
| 51 | + """ |
| 52 | + And the return code should be 0 |
| 53 | + |
| 54 | + @require-wp-5.2 |
| 55 | + Scenario: Check for all plugin updates with --all flag |
| 56 | + Given a WP install |
| 57 | + |
| 58 | + When I run `wp plugin install wordpress-importer --version=0.5 --activate` |
| 59 | + Then STDOUT should not be empty |
| 60 | + |
| 61 | + When I run `wp plugin check-update --all` |
| 62 | + Then STDOUT should be a table containing rows: |
| 63 | + | name | status | version | |
| 64 | + | wordpress-importer | active | 0.5 | |
| 65 | + And STDOUT should contain: |
| 66 | + """ |
| 67 | + update_version |
| 68 | + """ |
| 69 | + And the return code should be 0 |
| 70 | + |
| 71 | + @require-wp-5.2 |
| 72 | + Scenario: Check for plugin updates in different output formats |
| 73 | + Given a WP install |
| 74 | + |
| 75 | + When I run `wp plugin install wordpress-importer --version=0.5` |
| 76 | + Then STDOUT should not be empty |
| 77 | + |
| 78 | + When I run `wp plugin check-update --format=json` |
| 79 | + Then STDOUT should be JSON containing: |
| 80 | + """ |
| 81 | + [{"name":"wordpress-importer","status":"inactive","version":"0.5"}] |
| 82 | + """ |
| 83 | + And the return code should be 0 |
| 84 | + |
| 85 | + When I run `wp plugin check-update --format=csv` |
| 86 | + Then STDOUT should contain: |
| 87 | + """ |
| 88 | + name,status,version,update_version |
| 89 | + """ |
| 90 | + And STDOUT should contain: |
| 91 | + """ |
| 92 | + wordpress-importer,inactive,0.5 |
| 93 | + """ |
| 94 | + And the return code should be 0 |
| 95 | + |
| 96 | + @require-wp-5.2 |
| 97 | + Scenario: Check for plugin updates with custom fields |
| 98 | + Given a WP install |
| 99 | + |
| 100 | + When I run `wp plugin install wordpress-importer --version=0.5` |
| 101 | + Then STDOUT should not be empty |
| 102 | + |
| 103 | + When I run `wp plugin check-update --fields=name,version` |
| 104 | + Then STDOUT should be a table containing rows: |
| 105 | + | name | version | |
| 106 | + | wordpress-importer | 0.5 | |
| 107 | + And the return code should be 0 |
| 108 | + |
| 109 | + @require-wp-5.2 |
| 110 | + Scenario: Check for plugin updates when no specific plugin has updates |
| 111 | + Given a WP install |
| 112 | + |
| 113 | + When I run `wp plugin install wordpress-importer` |
| 114 | + Then STDOUT should not be empty |
| 115 | + |
| 116 | + When I run `wp plugin check-update wordpress-importer` |
| 117 | + Then STDOUT should contain: |
| 118 | + """ |
| 119 | + Success: All plugins are up to date. |
| 120 | + """ |
| 121 | + And the return code should be 0 |
0 commit comments