Skip to content

Commit

Permalink
configured lando to run codeception tests with chromedriver
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Jul 21, 2021
1 parent 4e217c7 commit 3faf7c1
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lando/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
54 changes: 54 additions & 0 deletions lando/default.codeception.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 12 additions & 3 deletions lando/default.lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit 3faf7c1

Please sign in to comment.