Closed greylabel closed 4 years ago
@greylabel currently the BLT testing for frontend frameworks assumes that you are using gulp (or npm, or whatever other framework) as a runner from inside a module or theme, and uses the frontend-test
hook https://github.com/acquia/blt/blob/10.x/src/Robo/Commands/Frontend/FrontendCommand.php#L49.
I'm familiar with Nightwatch, but haven't used it yet. Could you perhaps outline how supporting Nightwatch itself might be different than supporting pa11y, jest, etc. via the frontend hooks I mentioned above?
Thanks!
@mikemadison13 It's very similar. yarn
is recommended by Drupal core, rather than npm
and it is really easy to get up and running with Nightwatch testing and BLT/DrupalVM locally:
cd docroot/core && yarn install
cp .env.example .env
and configureyarn test:nightwatch
All of this can be done using BLT's front end hooks, as you mentioned. So there are a few of options:
frontend-test
— really just yarn
and selenium
or chromedriver
(the latter already are)blt tests:
command that wraps the above steps and makes the experience more seamlessI think option 2. is probably sufficient to start. (I am happy to take this task.)
At the same time that we're deprecating run-tests.sh (#3917) in BLT 11, I'd like to get Nightwatch fully supported. It's not exactly a replacement, but it is complementary to core phpunit tests so I think it deserves its own command.
Drupal core supports JavaScript testing using Nightwatch. BLT should support Nightwatch, similar to how it supports Drupal core's other testing frameworks.