diff --git a/README.md b/README.md index 9a0ba9a..256303e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,24 @@ [![tests](https://github.com/weitzman/ddev-selenium-standalone-chrome/actions/workflows/tests.yml/badge.svg)](https://github.com/drud/ddev-addon-template/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2022.svg) -## Install +## Introduction In ddev v1.19+, run `ddev get weitzman/ddev-selenium-standalone-chrome` to fetch this service into your local DDEV installation. You may then check it into your source control if desired. +This service can be used with any project type. The examples below are Drupal-specific. Contributions for docs and tests that show this service working with other project types are appreciated. + ## Use -- Your project is now ready to run FunctionalJavascript and Nightwatch tests from Drupal core, or [Drupal Test Traits](https://gitlab.com/weitzman/drupal-test-traits) (DTT). All these types are tested in this repo. +- Your project is now ready to run FunctionalJavascript and [Nightwatch](https://www.drupal.org/docs/automated-testing/javascript-testing-using-nightwatch) tests from Drupal core, or [Drupal Test Traits](https://gitlab.com/weitzman/drupal-test-traits) (DTT). All these types are tested in this repo. Some examples to try: + - FunctionalJavascript: + - Ensure you have the `drupal/core-dev` Composer package or equivalent. + - `ddev exec -d /var/www/html/web "../vendor/bin/phpunit -v -c ./core/phpunit.xml.dist ./core/modules/system/tests/src/FunctionalJavascript/FrameworkTest.php"` + - Nightwatch + - `ddev exec -d /var/www/html/web/core yarn install` (do this once) + - `ddev exec -d /var/www/html/web/core touch .env` ((do this once)) + - `ddev exec -d /var/www/html/web/core yarn test:nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js` + - Drupal Test Traits + - Ensure you have a working site that has the `weitzman/drupal-test-traits` Composer package. + - `ddev exec -d /var/www/html/web "../vendor/bin/phpunit --bootstrap=../vendor/weitzman/drupal-test-traits/src/bootstrap-fast.php --printer '\Drupal\Tests\Listeners\HtmlOutputPrinter' ../vendor/weitzman/drupal-test-traits/tests/ExampleSelenium2DriverTest.php"` - On your host, browse to https://[DDEV SITE URL]:7910 (password: `secret`) to watch tests run (neat!). ## Contribute