phenaproxima / starshot-prototype

Prototype of a new kind of Drupal, based on recipes and loaded up with contrib's best modules and themes. Not a fork or a distribution.
https://drupal.org/starshot
106 stars 36 forks source link

Add Behat tests #63

Closed AlexSkrypnyk closed 1 month ago

AlexSkrypnyk commented 2 months ago

I suggest adding behat tests to tests the high-level functionality.

This will also allow to quickly see what business requirements this project fulfils.

It will also allow to make sure that whatever is shipped is actually working.

Maybe this is not for right now, when Starshot is a prototype, but when it becomes more mature.

--

If this is accepted, I'm happy to dedicate time to write these tests. I'm the author of Behat Steps and have experience in writing Behat tests fast :)

TravisCarden commented 1 month ago

Thanks for the suggestion, @AlexSkrypnyk. And thanks for your generous offer to help with testing! I don't think Behat will probably be a good fit for us, though.

I've found that Behat only works well under very specific conditions that we don't have--namely, comprehensive, clearly defined requirements in the form of user stories, proficiency with Behat and a strong grasp of BDD across the development team, and mature tooling. Without all of those, you tend to end up with expensive, brittle tests expressed in clumsy, unhelpful Gherkin, providing little value in return for their high cost. I know that @phenaproxima (project lead) has a similar opinion.

We do have broad proficiency with PHPUnit. Perhaps there would be a way to bring some of the value of BDD and executable specifications into that context without requiring a whole paradigm shift for the community. Something like PHPUnitBehat would surely go too far. Specify might, too. But the latter, in particular, illustrates the point that there are possibilities for less disruptive innovation.

In any case, I think you're right to intuit that it's too early to undertake something like this, but as far as I'm concerned, it doesn't hurt to hear people's opinions in the meantime. 🙂

AlexSkrypnyk commented 1 month ago

Thanks for responding, @TravisCarden

This project could have benefited from human-readable tests, because it does not actually provide custom functionality, but rather compiles functionalities of already tested pieces. Testing UI using human-readable language would be fast and clear.

Here is an example on how we test user behaviour in CivicTheme project https://github.com/civictheme/monorepo-drupal/tree/develop/tests/behat/features