Using Selenium Hub to support different browsers

This commit is contained in:
Alexey Pustovalov 2024-06-10 16:32:50 +09:00
parent 1ba43e5924
commit 4ac13431b3
19 changed files with 357 additions and 141 deletions

8
.env
View File

@ -32,8 +32,12 @@ POSTGRESQL_IMAGE_TAG=16-alpine
ELASTICSEARCH_IMAGE=elasticsearch
ELASTICSEARCH_IMAGE_TAG=latest
WEBDRIVER_IMAGE=selenium/standalone-chrome
WEBDRIVER_IMAGE_TAG=latest
WEBDRIVER_IMAGE=selenium/hub
WEBDRIVER_IMAGE_TAG=4.21.0
WEBDRIVER_CHROME_IMAGE=selenium/node-chrome
WEBDRIVER_CHROME_IMAGE_TAG=125.0
WEBDRIVER_FIREFOX_IMAGE=selenium/node-firefox
WEBDRIVER_FIREFOX_IMAGE_TAG=126.0
# Expose ports per service
ZABBIX_SERVER_PORT=10051

View File

@ -1,18 +1,55 @@
services:
selenium:
image: "${WEBDRIVER_IMAGE}:${WEBDRIVER_IMAGE_TAG}"
restart: "${RESTART_POLICY}"
attach: false
scale: 4
profiles:
- full
- all
shm_size: "2gb"
env_file:
- path: ${ENV_VARS_DIRECTORY}/.env_selenium
required: false
- selenium
- selenium-chrome
- selenium-firefox
networks:
tools_frontend:
aliases:
- webdriver
- selenium-hub
- selenium
selenium-chrome:
image: "${WEBDRIVER_CHROME_IMAGE}:${WEBDRIVER_CHROME_IMAGE_TAG}"
restart: "${RESTART_POLICY}"
attach: false
scale: 2
depends_on:
- selenium
profiles:
- selenium
- selenium-chrome
shm_size: "2gb"
env_file:
- path: ${ENV_VARS_DIRECTORY}/.env_selenium_chrome
required: false
environment:
- SE_EVENT_BUS_HOST=selenium
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
networks:
tools_frontend:
selenium-firefox:
image: "${WEBDRIVER_FIREFOX_IMAGE}:${WEBDRIVER_FIREFOX_IMAGE_TAG}"
restart: "${RESTART_POLICY}"
attach: false
scale: 2
depends_on:
- selenium
profiles:
- selenium
- selenium-firefox
shm_size: "2gb"
env_file:
- path: ${ENV_VARS_DIRECTORY}/.env_selenium_firefox
required: false
environment:
- SE_EVENT_BUS_HOST=selenium
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
networks:
tools_frontend:

View File

@ -77,8 +77,7 @@ services:
restart: "${RESTART_POLICY}"
attach: false
profiles:
- full
- all
- elasticsearch
environment:
- transport.host=0.0.0.0
- discovery.zen.minimum_master_nodes=1

View File

@ -101,15 +101,26 @@ services:
file: compose_databases.yaml
service: db-data-mysql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -201,15 +201,26 @@ services:
file: compose_databases.yaml
service: db-data-mysql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -111,15 +111,26 @@ services:
file: compose_databases.yaml
service: db-data-pgsql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -225,15 +225,26 @@ services:
file: compose_databases.yaml
service: db-data-pgsql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -101,15 +101,26 @@ services:
file: compose_databases.yaml
service: db-data-mysql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -202,15 +202,26 @@ services:
file: compose_databases.yaml
service: db-data-mysql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -111,15 +111,26 @@ services:
file: compose_databases.yaml
service: db-data-pgsql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -225,15 +225,26 @@ services:
file: compose_databases.yaml
service: db-data-pgsql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -101,15 +101,26 @@ services:
file: compose_databases.yaml
service: db-data-mysql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -202,15 +202,26 @@ services:
file: compose_databases.yaml
service: db-data-mysql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -111,15 +111,26 @@ services:
file: compose_databases.yaml
service: db-data-pgsql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -225,15 +225,26 @@ services:
file: compose_databases.yaml
service: db-data-pgsql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -89,15 +89,26 @@ services:
file: compose_databases.yaml
service: db-data-mysql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -190,15 +190,26 @@ services:
file: compose_databases.yaml
service: db-data-mysql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -99,15 +99,26 @@ services:
file: compose_databases.yaml
service: db-data-pgsql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend:

View File

@ -213,15 +213,26 @@ services:
file: compose_databases.yaml
service: db-data-pgsql
# elasticsearch:
# extends:
# file: compose_databases.yaml
# service: elasticsearch
elasticsearch:
extends:
file: compose_databases.yaml
service: elasticsearch
# selenium:
# extends:
# file: compose_additional_components.yaml
# service: selenium
selenium:
extends:
file: compose_additional_components.yaml
service: selenium
selenium-chrome:
platform: linux/amd64
extends:
file: compose_additional_components.yaml
service: selenium-chrome
selenium-firefox:
extends:
file: compose_additional_components.yaml
service: selenium-firefox
networks:
frontend: