Skip to content

Commit a7c8e2d

Browse files
authored
Move to a config file. (#7)
* Move to a config file. * Add #ddev-generated * Use install.yaml to copy * Escape quotes * Elaborate install instructions
1 parent 20b8429 commit a7c8e2d

File tree

4 files changed

+41
-25
lines changed

4 files changed

+41
-25
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22

33
## Introduction
44

5-
In ddev v1.19+, run `ddev get drud/ddev-selenium-standalone-chrome` to fetch this service into your local DDEV installation. You may then check it into your source control if desired.
6-
75
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.
86

7+
## Install/Update
8+
9+
1. `ddev get drud/ddev-selenium-standalone-chrome`
10+
2. Optional. Update the provided .ddev/config.selenium-standalone-chrome.yaml as you see fit(and remove the #ddev-generated line). You can also just override lines in your .ddev/config.yaml
11+
3. Optional. Check config.selenium-standalone-chrome.yaml and docker-compose.selenium-chrome.yaml into your source control.
12+
4. Update by re-running `ddev get drud/ddev-selenium-standalone-chrome`.
13+
914
## Use
1015

1116
- 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:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#ddev-generated
2+
# Remove the line above if you don't want this file to be overwritten when you run
3+
# ddev get drud/ddev-selenium-standalone-chrome
4+
#
5+
# This file comes from https://github.com/drud/ddev-selenium-standalone-chrome
6+
#
7+
web_environment:
8+
- BROWSERTEST_OUTPUT_DIRECTORY=/tmp
9+
- BROWSERTEST_OUTPUT_BASE_URL=${DDEV_PRIMARY_URL}
10+
- SIMPLETEST_BASE_URL=http://web
11+
- SIMPLETEST_DB=mysql://db:db@db/db
12+
# Use disable-dev-shm-usage instead of setting shm_usage
13+
# https://developers.google.com/web/tools/puppeteer/troubleshooting#tips
14+
# The format of chromeOptions is defined at https://chromedriver.chromium.org/capabilities
15+
- MINK_DRIVER_ARGS_WEBDRIVER=[\"chrome\", {\"browserName\":\"chrome\",\"chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]
16+
# Nightwatch
17+
- DRUPAL_TEST_BASE_URL=http://web
18+
- DRUPAL_TEST_DB_URL=mysql://db:db@db/db
19+
- DRUPAL_TEST_WEBDRIVER_HOSTNAME=selenium-chrome
20+
- DRUPAL_TEST_WEBDRIVER_PORT=4444
21+
- DRUPAL_TEST_WEBDRIVER_PATH_PREFIX=/wd/hub
22+
- DRUPAL_TEST_CHROMEDRIVER_AUTOSTART=false
23+
- DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY=../
24+
- DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES=node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
25+
- DRUPAL_NIGHTWATCH_OUTPUT=reports/nightwatch
26+
- DTT_BASE_URL=http://web
27+
- DTT_MINK_DRIVER_ARGS=[\"chrome\", {\"browserName\":\"chrome\",\"chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]

docker-compose.selenium-chrome.yaml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# This file comes from https://github.com/drud/ddev-selenium-standalone-chrome.
1+
#ddev-generated
2+
# Remove the line above if you don't want this file to be overwritten when you run
3+
# ddev get drud/ddev-selenium-standalone-chrome
4+
#
5+
# This file comes from https://github.com/drud/ddev-selenium-standalone-chrome
26
#
37
version: '3.6'
48
services:
@@ -26,25 +30,4 @@ services:
2630

2731
web:
2832
links:
29-
- selenium-chrome
30-
environment:
31-
- BROWSERTEST_OUTPUT_DIRECTORY=/tmp
32-
- BROWSERTEST_OUTPUT_BASE_URL=${DDEV_PRIMARY_URL}
33-
- SIMPLETEST_BASE_URL=http://web
34-
- SIMPLETEST_DB=mysql://db:db@db/db
35-
# Use disable-dev-shm-usage instead of setting shm_usage
36-
# https://developers.google.com/web/tools/puppeteer/troubleshooting#tips
37-
# The format of chromeOptions is defined at https://chromedriver.chromium.org/capabilities
38-
- 'MINK_DRIVER_ARGS_WEBDRIVER=["chrome", {"browserName":"chrome","chromeOptions":{"w3c":false,"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://selenium-chrome:4444/wd/hub"]'
39-
# Nightwatch
40-
- DRUPAL_TEST_BASE_URL=http://web
41-
- DRUPAL_TEST_DB_URL=mysql://db:db@db/db
42-
- DRUPAL_TEST_WEBDRIVER_HOSTNAME=selenium-chrome
43-
- DRUPAL_TEST_WEBDRIVER_PORT=4444
44-
- DRUPAL_TEST_WEBDRIVER_PATH_PREFIX=/wd/hub
45-
- DRUPAL_TEST_CHROMEDRIVER_AUTOSTART=false
46-
- DRUPAL_NIGHTWATCH_SEARCH_DIRECTORY=../
47-
- DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES=node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
48-
- DRUPAL_NIGHTWATCH_OUTPUT=reports/nightwatch
49-
- DTT_BASE_URL=http://web
50-
- 'DTT_MINK_DRIVER_ARGS=["chrome", {"browserName":"chrome","chromeOptions":{"w3c":false,"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://selenium-chrome:4444/wd/hub"]'
33+
- selenium-chrome

install.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: addon-template
22
pre_install_actions:
33
project_files:
44
- docker-compose.selenium-chrome.yaml
5+
- config.selenium-standalone-chrome.yaml
56
global_files:
67
post_install_actions:
78
yaml_read_files:

0 commit comments

Comments
 (0)