|
| 1 | +Feature: List recently active WordPress plugins |
| 2 | + |
| 3 | + Scenario: Verify plugin installation, activation, deactivation and confirm listing recently active plugins list is correct |
| 4 | + Given a WP install |
| 5 | + |
| 6 | + When I run `wp plugin install site-secrets debug-bar p2-by-email --activate` |
| 7 | + Then STDOUT should contain: |
| 8 | + """ |
| 9 | + Plugin 'site-secrets' activated. |
| 10 | + """ |
| 11 | + And STDOUT should contain: |
| 12 | + """ |
| 13 | + Plugin 'debug-bar' activated. |
| 14 | + """ |
| 15 | + And STDOUT should contain: |
| 16 | + """ |
| 17 | + Plugin 'p2-by-email' activated. |
| 18 | + """ |
| 19 | + |
| 20 | + When I run `wp plugin list --recently-active --field=name --format=json` |
| 21 | + Then STDOUT should be: |
| 22 | + """ |
| 23 | + [] |
| 24 | + """ |
| 25 | + |
| 26 | + When I run `wp plugin activate akismet` |
| 27 | + Then STDOUT should contain: |
| 28 | + """ |
| 29 | + Plugin 'akismet' activated. |
| 30 | + """ |
| 31 | + |
| 32 | + When I run `wp plugin deactivate site-secrets debug-bar` |
| 33 | + Then STDOUT should contain: |
| 34 | + """ |
| 35 | + Plugin 'site-secrets' deactivated. |
| 36 | + Plugin 'debug-bar' deactivated. |
| 37 | + Success: Deactivated 2 of 2 plugins. |
| 38 | + """ |
| 39 | + |
| 40 | + When I run `wp plugin list --recently-active --field=name` |
| 41 | + Then STDOUT should be a table containing rows: |
| 42 | + | debug-bar | |
| 43 | + | site-secrets | |
| 44 | + |
| 45 | + Scenario: Use recently active plugin to activate plugins |
| 46 | + Given a WP install |
| 47 | + |
| 48 | + When I run `wp plugin install site-secrets debug-bar --activate` |
| 49 | + Then STDOUT should contain: |
| 50 | + """ |
| 51 | + Plugin 'site-secrets' activated. |
| 52 | + """ |
| 53 | + And STDOUT should contain: |
| 54 | + """ |
| 55 | + Plugin 'debug-bar' activated. |
| 56 | + """ |
| 57 | + |
| 58 | + When I run `wp plugin deactivate site-secrets debug-bar` |
| 59 | + Then STDOUT should be: |
| 60 | + """ |
| 61 | + Plugin 'site-secrets' deactivated. |
| 62 | + Plugin 'debug-bar' deactivated. |
| 63 | + Success: Deactivated 2 of 2 plugins. |
| 64 | + """ |
| 65 | + |
| 66 | + When I run `wp plugin activate $(wp plugin list --recently-active --field=name)` |
| 67 | + Then STDOUT should contain: |
| 68 | + """ |
| 69 | + Plugin 'debug-bar' activated. |
| 70 | + """ |
| 71 | + And STDOUT should contain: |
| 72 | + """ |
| 73 | + Plugin 'site-secrets' activated. |
| 74 | + """ |
| 75 | + |
| 76 | + Scenario: For a MU site, verify plugin installation, activation, deactivation and confirm listing recently active plugins list is correct |
| 77 | + Given a WP multisite install |
| 78 | + |
| 79 | + When I run `wp plugin install site-secrets debug-bar p2-by-email --activate-network` |
| 80 | + Then STDOUT should contain: |
| 81 | + """ |
| 82 | + Plugin 'site-secrets' network activated. |
| 83 | + """ |
| 84 | + And STDOUT should contain: |
| 85 | + """ |
| 86 | + Plugin 'debug-bar' network activated. |
| 87 | + """ |
| 88 | + And STDOUT should contain: |
| 89 | + """ |
| 90 | + Plugin 'p2-by-email' network activated. |
| 91 | + """ |
| 92 | + |
| 93 | + When I run `wp plugin activate akismet --network` |
| 94 | + Then STDOUT should contain: |
| 95 | + """ |
| 96 | + Plugin 'akismet' network activated. |
| 97 | + """ |
| 98 | + |
| 99 | + When I run `wp plugin list --recently-active --field=name --format=json` |
| 100 | + Then STDOUT should be: |
| 101 | + """ |
| 102 | + [] |
| 103 | + """ |
| 104 | + When I run `wp plugin deactivate site-secrets debug-bar --network` |
| 105 | + Then STDOUT should be: |
| 106 | + """ |
| 107 | + Plugin 'site-secrets' network deactivated. |
| 108 | + Plugin 'debug-bar' network deactivated. |
| 109 | + Success: Network deactivated 2 of 2 plugins. |
| 110 | + """ |
| 111 | + |
| 112 | + When I run `wp plugin list --recently-active --field=name` |
| 113 | + Then STDOUT should be a table containing rows: |
| 114 | + | debug-bar | |
| 115 | + | site-secrets | |
| 116 | + |
| 117 | + Scenario: For a MU site, use recently active plugin to activate plugins |
| 118 | + Given a WP multisite install |
| 119 | + |
| 120 | + When I run `wp plugin install site-secrets debug-bar --activate-network` |
| 121 | + Then STDOUT should contain: |
| 122 | + """ |
| 123 | + Plugin 'site-secrets' network activated. |
| 124 | + """ |
| 125 | + And STDOUT should contain: |
| 126 | + """ |
| 127 | + Plugin 'debug-bar' network activated. |
| 128 | + """ |
| 129 | + |
| 130 | + When I run `wp plugin deactivate site-secrets debug-bar --network` |
| 131 | + Then STDOUT should be: |
| 132 | + """ |
| 133 | + Plugin 'site-secrets' network deactivated. |
| 134 | + Plugin 'debug-bar' network deactivated. |
| 135 | + Success: Network deactivated 2 of 2 plugins. |
| 136 | + """ |
| 137 | + |
| 138 | + When I run `wp plugin activate $(wp plugin list --recently-active --field=name) --network` |
| 139 | + Then STDOUT should contain: |
| 140 | + """ |
| 141 | + Plugin 'site-secrets' network activated. |
| 142 | + """ |
| 143 | + And STDOUT should contain: |
| 144 | + """ |
| 145 | + Plugin 'debug-bar' network activated. |
| 146 | + """ |
0 commit comments