From 93a488d7b0e4ad3524cb457b9e92d75c6a376f50 Mon Sep 17 00:00:00 2001 From: jeremie-code <53209556+jeremie-code@users.noreply.github.com> Date: Wed, 16 Aug 2023 09:40:09 +0300 Subject: [PATCH 1/2] Fix: Update entrypoint.sh for appium 2 --- selenium/android/entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selenium/android/entrypoint.sh b/selenium/android/entrypoint.sh index 30fc8e0d8..3081d6110 100755 --- a/selenium/android/entrypoint.sh +++ b/selenium/android/entrypoint.sh @@ -70,7 +70,8 @@ fi while [ "$(adb shell getprop sys.boot_completed | tr -d '\r')" != "1" ] && [ -z "$STOP" ] ; do sleep 1; done if [ -n "$STOP" ]; then exit 0; fi -DEFAULT_CAPABILITIES='"androidNaturalOrientation": true, "deviceName": "android", "platformName": "Android", "noReset": true, "udid":"'$EMULATOR'"' +DEFAULT_CAPABILITIES='"appium:androidNaturalOrientation": true, "appium:deviceName": "android", "platformName": "Android", "appium:automationName": "UiAutomator2", "appium:noReset": true, "appium:udid": "'$EMULATOR'", "appium:systemPort": '$BOOTSTRAP_PORT', "appium:newCommandTimeout": 90' + if [ -n "@CHROME_MOBILE@" ]; then while ip addr | grep inet | grep -q tentative > /dev/null; do sleep 0.1; done DEFAULT_CAPABILITIES=$DEFAULT_CAPABILITIES', "chromedriverPort": '$CHROMEDRIVER_PORT @@ -82,7 +83,7 @@ if [ -x "/usr/bin/chromedriver" ]; then DEFAULT_CAPABILITIES=$DEFAULT_CAPABILITIES',"chromedriverExecutable": "/usr/bin/chromedriver"' fi -/opt/node_modules/.bin/appium -a 0.0.0.0 -p "$PORT" -bp "$BOOTSTRAP_PORT" --log-timestamp --log-no-colors --command-timeout 90 --no-reset ${APPIUM_ARGS} --default-capabilities "{$DEFAULT_CAPABILITIES}" & +/opt/node_modules/.bin/appium -a 0.0.0.0 -p "$PORT" --log-timestamp --log-no-colors ${APPIUM_ARGS} --base-path "/wd/hub" --default-capabilities "{$DEFAULT_CAPABILITIES}" & APPIUM_PID=$! wait From 4159ac927c8ca4fb5970979a77c30ed81ee4f1f4 Mon Sep 17 00:00:00 2001 From: jeremie-code <53209556+jeremie-code@users.noreply.github.com> Date: Wed, 16 Aug 2023 09:43:52 +0300 Subject: [PATCH 2/2] fix: Update Dockerfile to appium 2 --- selenium/android/Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/selenium/android/Dockerfile b/selenium/android/Dockerfile index 73a933320..27de950e7 100644 --- a/selenium/android/Dockerfile +++ b/selenium/android/Dockerfile @@ -4,7 +4,9 @@ COPY tmp/devtools /devtools RUN \ apt-get update && \ - apt-get install -y upx-ucl libx11-dev && \ + wget -c http://ftp.us.debian.org/debian/pool/main/u/upx-ucl/upx-ucl_3.95-1_amd64.deb && \ + apt-get install -y ./upx-ucl_3.95-1_amd64.deb && \ + apt-get install -y libx11-dev && \ cd /devtools && \ GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" && \ upx /devtools/devtools @@ -38,7 +40,10 @@ RUN \ apt-get clean && \ rm -Rf /tmp/* && rm -Rf /var/lib/apt/lists/* -RUN cd / && npm install --prefix ./opt/ appium@$APPIUM_VERSION +RUN \ + cd / && \ + npm install --prefix ./opt/ appium@$APPIUM_VERSION && \ + /opt/node_modules/.bin/appium driver install uiautomator2 COPY android.conf /etc/ld.so.conf.d/ COPY fluxbox/aerokube /usr/share/fluxbox/styles/