Skip to content

Commit

Permalink
Merge pull request #639 from jeremie-code/master
Browse files Browse the repository at this point in the history
Fix: Update file to support Appium 2 when building new image
  • Loading branch information
vania-pooh authored Aug 17, 2023
2 parents 80dd68b + 4159ac9 commit 46e11ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 7 additions & 2 deletions selenium/android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand Down
5 changes: 3 additions & 2 deletions selenium/android/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 46e11ff

Please sign in to comment.