Skip to content

Commit

Permalink
Add support for Chromium driver (#417)
Browse files Browse the repository at this point in the history
* Add support for Chromium driver

* Allow setting default driver
  • Loading branch information
mnocon authored and lserwatka committed Jul 10, 2019
1 parent 7c8d8e4 commit d6bd764
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ PHP_IMAGE_DEV=ezsystems/php:7.3-v1-dev
NGINX_IMAGE=nginx:stable
MYSQL_IMAGE=healthcheck/mariadb
SELENIUM_IMAGE=selenium/standalone-chrome-debug:3.141.59-oxygen
CHROMIUM_IMAGE=registry.gitlab.com/dmore/docker-chrome-headless:7.1
REDIS_IMAGE=healthcheck/redis

SESSION_HANDLER_ID=session.handler.native_file
Expand All @@ -24,7 +25,9 @@ DATASET_VARDIR=my-ez-app
# Behat / Selenium config
## web host refer to the tip of the setup, so varnish if that is used.
WEB_HOST=web
MINK_DEFAULT_SESSION=selenium
SELENIUM_HOST=selenium
CHROMIUM_HOST=chromium

# Enable recommendations by setting valid id, key and uri
#RECOMMENDATIONS_CUSTOMER_ID=""
Expand Down
27 changes: 17 additions & 10 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ default:
Behat\MinkExtension:
base_url: 'http://localhost'
goutte: ~
javascript_session: selenium2
selenium2:
browser: chrome
wd_host: 'http://localhost:4444/wd/hub'
capabilities:
extra_capabilities:
chromeOptions:
args:
- "--window-size=1440,1080"
- "--no-sandbox"
javascript_session: selenium
sessions:
selenium:
selenium2:
browser: chrome
wd_host: 'http://localhost:4444/wd/hub'
capabilities:
extra_capabilities:
chromeOptions:
args:
- "--window-size=1440,1080"
- "--no-sandbox"
chrome:
chrome:
api_url: "http://localhost:9222"

DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~

Behat\Symfony2Extension:
kernel:
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
"behat/mink-selenium2-driver": "^1.3",
"behat/symfony2-extension": "^2.1",
"bex/behat-screenshot": "^1.2",
"dmore/behat-chrome-extension": "^1.3",
"dmore/chrome-mink-driver": "^2.7",
"ezsystems/behat-screenshot-image-driver-cloudinary": "^1.1@dev",
"ezsystems/behatbundle": "^7.0@dev",
"liuggio/fastest": "^1.6",
Expand Down
7 changes: 7 additions & 0 deletions doc/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The current Docker Compose files are made to be mixed and matched together for Q
- varnish.yml _(optional, adds varnish service and appends config to app)_
- solr.yml _(optional, add solr service and configure app for it)_
- selenium.yml _(optional, always needs to be last, adds selenium service and appends config to app)_
- chromium.yml _(alternative to `selenium.yml`, adds headless Chrome service, same applies here if used. Experimental)_


These can be used with `-f` argument on docker-compose, like:
Expand Down Expand Up @@ -133,6 +134,12 @@ docker-compose exec --user www-data app sh -c "php /scripts/wait_for_db.php; php
docker-compose exec --user www-data app composer ezplatform-install
```

Note: if you want to use the Chromium driver, use
```
export COMPOSE_FILE=doc/docker/base-prod.yml:doc/docker/chromium.yml
```
This driver is not fully supported in our test suite and is in experimental state.

### DFS

If you want to use the DFS cluster handler, you'll need to run the migration script manually, after starting the
Expand Down
20 changes: 20 additions & 0 deletions doc/docker/chromium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.3'
# Appends services to prod.yml, prod+dev, prod+redis, ..., always latest

services:
chromium:
image: ${CHROMIUM_IMAGE}
ports:
- "9222:9222"
networks:
- backend
command: tail -f /dev/null

app:
depends_on:
- chromium
environment:
- EZP_TEST_REST_HOST=$WEB_HOST
- BEHAT_CHROMIUM_HOST=$CHROMIUM_HOST
- BEHAT_WEB_HOST=$WEB_HOST
- MINK_DEFAULT_SESSION=chrome

0 comments on commit d6bd764

Please sign in to comment.