So I have a project which has BDD tests with Behat/Mink. The scenarios which I have use mink, and so require the testable code to be deployed so that Mink can actually test the pages.
I'm wondering how these tests would fit into a CI/CD pipeline/workflow. Currently our workflow is as simple as push, deploy, manually test on staging, manually release, manually test on production.
In my head I have the following workflow in mind for a regular pipeline:
- Push to repo
- Post receive hook to CI service or our own CI server (Jenkins?)
- CI service/server runs composer install and runs behat tests
- If they pass it deploys
I don't see how step 3 can happen before deployment though, given that mink needs a url to test the pages, and the new code isn't on the server yet as it hasn't passed it's tests.
Can anyone recommend a sequence of events which is best for behat, where the tests are run before deployment to production.