Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force plugin reactivation after tests #8

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

circlecube
Copy link
Member

@circlecube circlecube commented Feb 5, 2024

Add and after statement that runs a cli command to activate the plugin - in case there was an issue with the test and the plugin wasn't reactivated via the test. So the remaining tests don't all fail.

This command requires plugin cypress config to add a pluginSlug env var so the command can know which plugin to activate. So we'll need to add that to each plugin.

Edit - to force tests to run again after adding PluginSlug to Bluehost and Hostgator plugins.

…ith the test

requires plugin cypress config to add a pluginSlug env var.
@circlecube circlecube self-assigned this Feb 5, 2024
@wpscholar
Copy link
Member

In the near future, I'd like to replace the npx commands with REST API calls.

@circlecube
Copy link
Member Author

Would we be able to use an API call if the plugin is disabled though?

OOh, I hadn't realized that plugins had been added to the API. I agree, we should get it using this method, since it'd likely be much faster.

https://developer.wordpress.org/rest-api/reference/plugins/#update-a-plugin

@BrianHenryIE
Copy link

There are a few NPM packages that have it already written, e.g. https://github.com/tschortsch/cypress-wp-test-utils

@wpscholar
Copy link
Member

It looks like that test utility visits the plugin page and activates/deactivates plugins. The REST API would allow us to avoid waiting on extra page loads.

@circlecube circlecube changed the title Force plugin activation after tests Force plugin reactivation after tests Feb 7, 2024
@circlecube
Copy link
Member Author

I've added pluginSlug to all the plugin cypres configs. Then retriggered these tests to make sure they pass now. If all deactivation tests pass here I'll merge and tag a minor release on this module. (I believe BH and HG have some other unrelated tests that fail still but hopefully we can get them fixed elsewhere soon.)

@circlecube circlecube merged commit 6706a53 into main Feb 8, 2024
4 of 6 checks passed
@circlecube circlecube deleted the update/test-to-activate-after branch February 8, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants