- Issue created by @aangel
- Status changed to Closed: won't fix
over 1 year ago 11:57am 27 July 2023 - 🇺🇸United States thejimbirch Cape Cod, Massachusetts
Updating as this was discussed in Slack.
https://drupal.slack.com/archives/C2THUBAVA/p1686243538206249
André Angelantoni
Just watched the video. Nice work and the strategic designs decisions seems solid to me. Here is a use case I have.Once I get v1.0 of Automated Testing Kit released, I’m going to add E2E tests to Campaign Kit. When that’s done, I’d like try out Recipes. Looking ahead, now that E2E testing is so much easier, let’s assume that E2E tests (written in Cypress, Playwright, ) will increasingly be bundled with modules or distributions.
Right now I have a setup script that copies or links the bundled support files and tests into their proper location for Cypress or Playwright to see them. The destination directories are typically in the root of the project (i.e. above web/docroot). BTW, the tests are not just for developers as there is nothing stopping DevOps from running them regularly when the site is live, too.
This seems to be a prime candidate for a recipe.
However, this should be optional. That means I’ll need two recipes: one to install the module and configure it and another that installs the tests and configures those. The user will need to run one then the other sequentially.
It seems to me that two features would be excellent to make this easier: the ability to accept user input/accept an argument and conditional logic. It still makes sense to have two recipes but the first one would check the argument/user input before calling the second one.
Would you like to install the end-to-end tests for Cypress? (y/N)
Poking around, it seems others have introduced conditionals in yml files:
https://stackoverflow.com/questions/54194104/if-condition-possible-in-ya...
Thoughts?thejimbirch
Hi André,
The current idea, in order to keep recipes as simple as possible, would be to create dependent recipes.
Recipe that has tests
Recipe that has module install/configuration
Recipe that installs both.bircher
or simply make the test one appl the one with the modules first...André Angelantoni
Sorry, just seeing that you responded.
That will definitely work for version 1. I suspect that eventually more people will request an If/then structure so that people aren’t maintaining multiple recipes. (It seems to me to be the next logical progression.)
Either way, looking forward to playing with it :-)