Skip to content

Commit

Permalink
#67 Add selenium-hub support. Extend documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
lbajsarowicz authored and davidalger committed Jan 24, 2020
1 parent c634e5b commit 6f34433
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
5 changes: 5 additions & 0 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ if [[ ${WARDEN_SELENIUM} -eq 1 && -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TY
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.selenium.base.yml")
fi

if [[ ${WARDEN_SELENIUM_DEBUG} -eq 1 && -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.selenium.debug.yml" ]]; then
DOCKER_COMPOSE_ARGS+=("-f")
DOCKER_COMPOSE_ARGS+=("${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.selenium.debug.yml")
fi

## lookup internal (warden docker network) IP address of traefik container (do not fail if traefik is stopped)
export TRAEFIK_ADDRESS="$(docker container inspect traefik \
--format '{{.NetworkSettings.Networks.warden.IPAddress}}' 2>/dev/null || true)"
Expand Down
12 changes: 11 additions & 1 deletion docs/configuration/mftf.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ WARDEN_SELENIUM=1
After generating MFTF configuration files (`dev/tests/acceptance/.env` generated by `vendor/bin/mftf setup:env` command), you need to provide selenium hostname:

```
SELENIUM_HOST=selenium
SELENIUM_HOST=selenium-hub
BROWSER=chrome
```

### Debugging MFTF Tests

By default Warden uses headless Chrome browser. If you want to preview the tests - you need to extend `.env` file and recreate environment (`warden env down && warden env up`)

```
WARDEN_SELENIUM_DEBUG=1
```

**Default password for VNC session is `secret`**

To preview the process of testing, you need any **VLC** client that provides **SSH Tunnel** support (eg. [Remmina](https://remmina.org/how-to-install-remmina/)). To preview the process of testing, you need to use `tunnel.warden.test:2222` (login: `user`):

### Remote Desktop Viewer
Expand Down
19 changes: 16 additions & 3 deletions environments/magento2.selenium.base.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
version: "3.5"
services:
selenium:
hostname: selenium
image: selenium/standalone-chrome-debug:3.8.1
selenium-hub:
container_name: ${WARDEN_ENV_NAME}_selenium-hub
hostname: selenium-hub
image: selenium/hub:3.8.1
networks:
- warden
- default
selenium-chrome:
hostname: ${WARDEN_ENV_NAME}_selenium-chrome
image: selenium/node-chrome:3.8.1
extra_hosts:
- ${TRAEFIK_SUBDOMAIN:-app}.${TRAEFIK_DOMAIN}:${TRAEFIK_ADDRESS:-0.0.0.0}
depends_on:
- selenium-hub
environment:
- HUB_HOST=selenium-hub
- HUB_PORT=4444
- START_XVFB=false
networks:
- warden
- default
4 changes: 4 additions & 0 deletions environments/magento2.selenium.debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: "3.5"
services:
selenium-chrome:
image: selenium/node-chrome-debug:3.8.1

0 comments on commit 6f34433

Please sign in to comment.