WP-NOW: add plugin update tests #266
Open
+224
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
We won't merge this PR until the plugin update error is fixed
What?
Add tests to validate the WordPress Plugin Update flow.
Why?
Currently that flow fails and after fixing the underlaying error, these tests will confirm it works.
How?
It uses WordPress functions to trigger a plugin update.
Testing Instructions
Run:
nvm use
npm install
npx nx run wp-now:test
Manual testing
This test introduces an automatic verification of the plugin update.
Here is a screencast of the manual testing where it fails:
wp-now-plugin-update-manual-testing.mp4
You can observe that after updating the plugin, the folder is "removed":
The filesystem returns that the folder and its files does not exist.
While php function
$wp_filesystem->exists
returns true for the folder and its files.