diff --git a/lando/README.md b/lando/README.md index f43fbb523c..4ae4922176 100644 --- a/lando/README.md +++ b/lando/README.md @@ -5,7 +5,8 @@ If you want to use [Lando](https://lando.dev/) for local development, here are s _Prerequisite: Make sure you have added your SSH key in Acquia cloud, and that it's saved in your `~/.ssh folder._ 1. [Install Lando](https://lando.dev/download/). -2. Copy `/lando/default.lando.yml` to `/.lando.yml`. +2. Copy `lando/default.lando.yml` to `.lando.yml`. + a. If running acceptance tests, copy `lando/default.codeception.yml` to `tests/codeception.yml`. 3. Take the `.loc` domains in the `.lando.yml` file and add them to your `/etc/hosts` file, as shown below: ``` 127.0.0.1 swshumsci.suhumsci.loc @@ -39,6 +40,7 @@ _Prerequisite: Make sure you have added your SSH key in Acquia cloud, and that i 8. Run `lando blt drupal:sync --site=default --sync-files --partial` to pull down a copy of the database, files for the default multisite, and the custom views and blocks that have been built out. If you **DO NOT** want to get the custom views built out on on the database you are pulling from, you can just use: `lando blt drupal:sync --site=default --sync-files`. 9. Run `lando info`, and browse to the url for your multisite. For the default site, you should be able to pull up http://swshumsci.suhumsci.loc/ in your browser. 10. Depending on the local domains you've set up, you may need to add a `docroot/sites/local.sites.php` file, and use it to add your local domains to the `$sites` array. Otherwise, requests to your local multisite domains may get sent to the default site. +11. To run codeception tests run `lando blt codeception --group=install`. Or if you wish to run a single class/method add the annotation in the docblock `@group testme` and then run `lando blt codeception --group=testme`. # Switching between local sites 1. In your `.lando.yml` file, uncomment the service for the site you want to run locally. diff --git a/lando/default.codeception.yml b/lando/default.codeception.yml new file mode 100644 index 0000000000..fcba79d240 --- /dev/null +++ b/lando/default.codeception.yml @@ -0,0 +1,54 @@ +paths: + tests: codeception + output: ../artifacts + data: codeception/_data + support: codeception/_support + envs: codeception/_envs +actor_suffix: Tester +settings: + shuffle: true +extensions: + enabled: + - Codeception\Extension\RunFailed +modules: + enabled: + - Codeception\Module\Asserts + - StanfordCaravan\Codeception\Drupal\DrupalBootstrap: + root: '/app/docroot' + server: + HTTP_HOST: 'localhost' + - StanfordCaravan\Codeception\Drupal\DrupalDrush: + drush: '/app/vendor/bin/drush' + options: + uri: 'appserver' + - PhpBrowser: + url: 'http://appserver/' + - WebDriver: + browser: chrome + url: 'http://appserver/' + host: 'chromedriver' + capabilities: + browser: "chrome" + version: "*" + extra_capabilities: + chromeOptions: + w3c: false + - StanfordCaravan\Codeception\Drupal\DrupalEntity: + cleanup_test: true + cleanup_failed: false + cleanup_suite: true + route_entities: + - node + - taxonomy_term + - media + - StanfordCaravan\Codeception\Drupal\DrupalUser: + drush: '/app/vendor/bin/drush' + default_role: 'authenticated' + driver: 'WebDriver' + cleanup_entities: + - node + - media + - file + cleanup_test: true + cleanup_failed: false + cleanup_suite: true diff --git a/lando/default.lando.yml b/lando/default.lando.yml index e425f2e6b3..19af008a2e 100644 --- a/lando/default.lando.yml +++ b/lando/default.lando.yml @@ -33,6 +33,18 @@ services: user: drupal password: drupal database: swshumsci + chromedriver: + type: compose + services: + image: robcherry/docker-chromedriver:latest + expose: + - "4444" + environment: + CHROMEDRIVER_WHITELISTED_IPS: "" + CHROMEDRIVER_URL_BASE: "/wd/hub" + security_opt: + - seccomp:unconfined + command: ["/usr/local/bin/supervisord", "-c", "/etc/supervisord.conf"] # archaeology: # type: mysql:5.7 # creds: @@ -139,8 +151,5 @@ tooling: blt: service: appserver cmd: /app/vendor/bin/blt - behat: - service: appserver - cmd: "/app/vendor/bin/behat -c /app/tests/behat/local.yml" git: service: appserver