-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat][test]: add env vars to generate config for Relay in node-base
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
- Loading branch information
Showing
16 changed files
with
260 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
if [[ -z "$CONFIG_FILE" ]]; then | ||
FILENAME="/opt/selenium/config.toml" | ||
else | ||
FILENAME="$CONFIG_FILE" | ||
fi | ||
|
||
if [[ -n "${SE_NODE_RELAY_URL}" ]]; then | ||
echo "[relay]" >> "$FILENAME" | ||
echo "url = \"${SE_NODE_RELAY_URL}\"" >> "$FILENAME" | ||
if [[ -z "${SE_NODE_RELAY_STATUS_ENDPOINT}" ]]; then | ||
echo "status-endpoint = \"/status\"" >> "$FILENAME" | ||
else | ||
echo "status-endpoint = \"${SE_NODE_RELAY_STATUS_ENDPOINT}\"" >> "$FILENAME" | ||
fi | ||
if [[ -n "${SE_NODE_RELAY_PROTOCOL_VERSION}" ]]; then | ||
echo "protocol-version = \"${SE_NODE_RELAY_PROTOCOL_VERSION}\"" >> "$FILENAME" | ||
fi | ||
echo "configs = [ | ||
\"${SE_NODE_RELAY_MAX_SESSIONS}\", \"{\\\"browserName\\\": \\\"${SE_NODE_RELAY_BROWSER_NAME}\\\", \\\"platformName\\\": \\\"${SE_NODE_RELAY_PLATFORM_NAME}\\\", \\\"appium:platformVersion\\\": \\\"${SE_NODE_RELAY_PLATFORM_VERSION}\\\"}\" | ||
] | ||
" >> "$FILENAME" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ARG ANDROID_BASED_NAME | ||
ARG ANDROID_BASED_IMAGE | ||
ARG ANDROID_BASED_TAG | ||
FROM ${ANDROID_BASED_NAME}/${ANDROID_BASED_IMAGE}:${ANDROID_BASED_TAG} AS android_based | ||
|
||
ARG CHROME_DRIVER_URL | ||
# Download appium chromedriver | ||
RUN curl ${CHROME_DRIVER_URL} -o /tmp/chromedriver.zip \ | ||
&& rm -rf ~/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/linux \ | ||
&& mkdir -p ~/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/linux \ | ||
&& unzip /tmp/chromedriver.zip -d ~/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/linux \ | ||
&& ~/.appium/node_modules/appium-uiautomator2-driver/node_modules/appium-chromedriver/chromedriver/linux/chromedriver --version \ | ||
&& rm -rf /tmp/chromedriver.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
version: "3" | ||
services: | ||
node-relay-emulator: | ||
image: selenium/node-base:${TAG} | ||
shm_size: 2gb | ||
depends_on: | ||
- selenium-hub | ||
- appium-emulator | ||
environment: | ||
- SE_EVENT_BUS_HOST=selenium-hub | ||
- SE_EVENT_BUS_PUBLISH_PORT=4442 | ||
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443 | ||
- SE_LOG_LEVEL=${LOG_LEVEL} | ||
- SE_NODE_SESSION_TIMEOUT=${SESSION_TIMEOUT} | ||
- SE_NODE_RELAY_URL=http://appium-emulator:4723 | ||
- SE_NODE_RELAY_PROTOCOL_VERSION=HTTP/1.1 | ||
- SE_NODE_RELAY_MAX_SESSIONS=1 | ||
- SE_NODE_RELAY_PLATFORM_NAME=Android | ||
- SE_NODE_RELAY_PLATFORM_VERSION=${ANDROID_PLATFORM_API} | ||
- SE_NODE_RELAY_BROWSER_NAME=chrome | ||
- SE_NODE_RELAY_WEB_VNC=ws://appium-emulator:6080/websockify | ||
|
||
node-relay-standalone: | ||
image: selenium/node-base:${TAG} | ||
shm_size: 2gb | ||
depends_on: | ||
- selenium-hub | ||
- firefox-receiver | ||
volumes: | ||
- ./relay_config.toml:/opt/selenium/config.toml | ||
environment: | ||
- SE_EVENT_BUS_HOST=selenium-hub | ||
- SE_EVENT_BUS_PUBLISH_PORT=4442 | ||
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443 | ||
- SE_LOG_LEVEL=${LOG_LEVEL} | ||
- GENERATE_CONFIG=false | ||
|
||
selenium-hub: | ||
image: selenium/hub:${TAG} | ||
container_name: selenium-hub | ||
environment: | ||
- SE_LOG_LEVEL=${LOG_LEVEL} | ||
- SE_SESSION_REQUEST_TIMEOUT=${REQUEST_TIMEOUT} | ||
ports: | ||
- "4442:4442" | ||
- "4443:4443" | ||
- "4444:4444" | ||
|
||
tests: | ||
image: docker-selenium-tests:latest | ||
build: | ||
context: ./ | ||
dockerfile: ./Dockerfile | ||
depends_on: | ||
- selenium-hub | ||
environment: | ||
- RUN_IN_DOCKER_COMPOSE=true | ||
- SELENIUM_GRID_HOST=selenium-hub | ||
- BINDING_VERSION=${BINDING_VERSION} | ||
- SELENIUM_ENABLE_MANAGED_DOWNLOADS=false | ||
- TEST_NODE_RELAY=${TEST_NODE_RELAY} | ||
- ANDROID_PLATFORM_API=${ANDROID_PLATFORM_API} | ||
- TEST_DELAY_AFTER_TEST=${TEST_DELAY_AFTER_TEST} | ||
command: ["./bootstrap.sh", "${NODE}"] | ||
|
||
firefox-receiver: | ||
image: selenium/standalone-firefox:${TAG} | ||
shm_size: 2gb | ||
container_name: firefox-receiver | ||
|
||
appium-emulator: | ||
image: ${ANDROID_BASED_NAME}/${ANDROID_BASED_IMAGE}:latest | ||
shm_size: 2gb | ||
build: | ||
args: | ||
ANDROID_BASED_NAME: ${ANDROID_BASED_NAME} | ||
ANDROID_BASED_IMAGE: ${ANDROID_BASED_IMAGE} | ||
ANDROID_BASED_TAG: ${ANDROID_BASED_TAG} | ||
CHROME_DRIVER_URL: https://chromedriver.storage.googleapis.com/113.0.5672.63/chromedriver_linux64.zip | ||
dockerfile: ./Dockerfile.emulator | ||
container_name: appium-emulator | ||
environment: | ||
- EMULATOR_DEVICE=Nexus 5 | ||
- WEB_VNC=true | ||
- APPIUM=true | ||
- WEB_LOG=true | ||
- WEB_LOG_PORT=9001 | ||
- EMULATOR_NO_SKIN=true | ||
- EMULATOR_NAME=emulator-5554 | ||
devices: | ||
- /dev/kvm | ||
ports: | ||
- "6080:6080" | ||
- "4723:4723" |
Oops, something went wrong.