Skip to content

Commit

Permalink
E2E & Storybook Testing docker-compose improvements (#3482)
Browse files Browse the repository at this point in the history
* use standalone chrome, remove container and host ports, use backend network
  • Loading branch information
patthiel committed Jun 29, 2018
1 parent 2cf7a28 commit 82c95bd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 31 deletions.
7 changes: 4 additions & 3 deletions e2e/config/wdio.conf.js
Expand Up @@ -27,7 +27,7 @@ if (argv.log) {

exports.config = {
// Selenium Host/Port
host: process.env.DOCKER ? 'selenium-hub' : 'localhost',
host: process.env.DOCKER ? 'selenium-standalone' : 'localhost',
port: 4444,
//
// ==================
Expand Down Expand Up @@ -201,6 +201,7 @@ exports.config = {
require('babel-register');

browserCommands();

browser.timeouts('page load', 20000);
login(username, password);
},
Expand Down Expand Up @@ -268,8 +269,8 @@ exports.config = {
* @param {Array.<Object>} capabilities list of capabilities details
* @param {Array.<String>} specs List of spec file paths that ran
*/
// after: function (result, capabilities, specs) {
// },
after: function (result, capabilities, specs) {
},
/**
* Gets executed right after terminating the webdriver session.
* @param {Object} config wdio configuration object
Expand Down
27 changes: 13 additions & 14 deletions integration-test.yml
@@ -1,22 +1,13 @@
version: '3.1'
services:
selenium-hub:
image: selenium/hub:3.4.0-francium
ports:
- "4444:4444"
chrome:
image: selenium/node-chrome:3.4.0-francium
depends_on:
- selenium-hub
selenium-standalone:
image: selenium/standalone-chrome:3.4.0-francium
volumes:
- /dev/shm:/dev/shm #Mitigates the Chromium issue described at https://code.google.com/p/chromium/issues/detail?id=519952
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-hub
- HUB_PORT_4444_TCP_PORT=4444
networks:
- backend
manager-local:
container_name: manager_local
ports:
- "3000:3000"
environment:
- HTTPS=true
- REACT_APP_APP_ROOT=https://manager-local:3000
Expand All @@ -29,6 +20,10 @@ services:
volumes:
- ./src:/src/src
entrypoint: ["/src/scripts/start_manager.sh"]
depends_on:
- selenium-standalone
networks:
- backend
manager-e2e:
container_name: manager_e2e
environment:
Expand All @@ -44,4 +39,8 @@ services:
- ./e2e:/src/e2e
entrypoint: ["./scripts/wait-for-it.sh", "-t", "250", "-s", "manager-local:3000", "--", "yarn","e2e", "--log"]
depends_on:
- chrome
- manager-local
networks:
- backend
networks:
backend:
25 changes: 11 additions & 14 deletions storybook-test.yml
@@ -1,30 +1,23 @@
version: '3.1'
services:
selenium-hub:
image: selenium/hub:3.11.0-bismuth
ports:
- "4444:4444"
chrome:
image: selenium/node-chrome:3.11.0-bismuth
depends_on:
- selenium-hub
selenium-standalone:
image: selenium/standalone-chrome:3.4.0-francium
volumes:
- /dev/shm:/dev/shm #Mitigates the Chromium issue described at https://code.google.com/p/chromium/issues/detail?id=519952
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-hub
- HUB_PORT_4444_TCP_PORT=4444
networks:
- backend
manager-storybook:
container_name: manager_storybook
ports:
- "6006:6006"
build:
context: .
dockerfile: Dockerfile
volumes:
- ./src:/src/src
entrypoint: yarn storybook
depends_on:
- chrome
- selenium-standalone
networks:
- backend
storybook-test:
container_name: storybook_test
environment:
Expand All @@ -41,3 +34,7 @@ services:
entrypoint: ["./scripts/storybook_entrypoint.sh"]
depends_on:
- manager-storybook
networks:
- backend
networks:
backend:

0 comments on commit 82c95bd

Please sign in to comment.