joshuadavidnelson / disable-blog

All the power of WordPress, without a blog. This plugin removes blog related functionality.
https://wordpress.org/plugins/disable-blog/
GNU General Public License v2.0
52 stars 6 forks source link

Acceptance Tests with Cypress #64

Open claytoncollie opened 1 year ago

claytoncollie commented 1 year ago

hey @joshuadavidnelson ! Hope all is well with you. These updates came up on my timeline and I thought I'd share what I've done with my plugin to include acceptance tests using Cypress and some packages built by 10up. The tests are run with GitHub Actions and uses wp-env.json to spin up a new install.. The test directory holds all of the tests and config. I've copied all of this from open-source 10up plugins so I suggest looking at Elasticpress, Distributor, and Classifi for advanced usage.

One thing I learned is that you can create plugins in your test directory and then activate and deactivate them during certain tests runs. This is good to test certain filters and actions.

Hope this sparks some interest!

joshuadavidnelson commented 1 year ago

Hey Clayton, thanks for reaching out, good to hear from you. I'm doing well, I hope you are too!

I have been toying around with adding integration tests to my plugins, so this is well timed - and some cool looking tools, thanks for sharing those resources! I'll get my head into these in my next round of work, it would be great to have it all in Github.

Cheers!