behat-wordpress-extension
behat-wordpress-extension copied to clipboard
Documentation: explain how to add WordHat to a WordPress project.
@johnbillion suggested to me that the project should have documentation that explains how to add WordHat to an existing or new WordPress project/site. It would help developers unfamiliar with Behat, by helping them get started and having something useable they can play about with immediately.
I like the idea in principle and I think it's important for 1.0, because I want to make it easy for people to experiment with using WordHat.
We either add a new page under "Getting Started", which would mean somehow modifying the installation instructions on https://wordhat.info/getting-started/installation/index.html to avoid duplication, or use that page for the new instructions.
Or replace the "Your firsts tests" block on https://wordhat.info/getting-started/wordhat-intro/index.html
I'd say for a developer, the steps here: https://wordhat.info/getting-started/installation/index.html is not that difficult. I got it working in less than 5 minutes on a Windows computer, using VVV.
I believe @johnbillion is thinking of non-developers or maybe more visual instructions of how to get it working.
Reading this issue and https://wordhat.info/getting-started/installation/index.html WordHat is not added to a Wordpress site. The documentation starts with mkdir project
which is independent of the Wordpress site used.
This page or even the welcome page could have an intro like
With Behat you can test against your website independently using a browser or dependently using
WP CLI
Testing independently Behat behaves like a webbrowser clicking through the site. Testing dependently could still use a webbrowser but can also do more advanced stuff like resetting the database content created during a test.
OTOH it would be great to know how to add this to a plugin or theme. I did
cd my-plugin-dir
mkdir -p tests/behat
which feels OK but I'm a noob regarding Wordpress testing.
👍🏻 Understood and thanks for feedback. I’m going to work on this next and i’ll reach out to you for your feedback of it when I have a draft ready.
I can make a PR if you have some pointers?