diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2078e8c..44af3c8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,29 +2,36 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu { "name": "Mobile Wallet Test Dev", - //"workspaceMount": "source=${localWorkspaceFolder}/aries-mobile-tests,target=/aries-mobile-tests,type=bind", - //"workspaceFolder": "/aries-mobile-tests", - // Use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "build": { - // Path is relative to the devcontainer.json file. + // Path is relative to the devcontainer.json file. "context": "../aries-mobile-tests", "dockerfile": "../aries-mobile-tests/Dockerfile.dev-harness" }, "appPort": ["49160:49160"], - // Features to add to the dev container. More info: https://containers.dev/features. + // Features to add to the dev container. + // More info: https://containers.dev/features. "features": { "docker-from-docker": "latest" }, - // If using a local android device/emulator you will need to mount to the location of the app apk so that it can be installed. - // Change this to your absolute path to the location of the android apk you want to test with + // If using a local android device/emulator you will need to mount to the + // location of the app apk so that it can be installed. + // Change this to your absolute path to the location of the android + // apk you want to test with "mounts": [ - { "source": "/Users/Shel/Projects/BC.gov/apps/bc-wallet", "target": "/bc-wallet/app", "type": "bind" }, - { "source": "/Users/Shel/Library/Developer/Xamarin/android-sdk-macosx/emulator/resources","target": "/qrcodes", "type": "bind" } + { + "source": "FULL_PATH_TO_MOBILE_WALLET", + "target": "/bifold-wallet/app", + "type": "bind" }, + { + "source": "/PATH_TO_ANDROID_SDK/Android/sdk/emulator/resources", + "target": "/qrcodes", + "type": "bind" } ], - // Use 'forwardPorts' to make a list of ports inside the container available locally. + // Use 'forwardPorts' to make a list of ports inside the + // container available locally. "forwardPorts": [4723, 5037, 8554, 49160], "initializeCommand": "docker network inspect aath_network >/dev/null 2>&1 || docker network create aath_network", @@ -62,6 +69,7 @@ } }, - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // Uncomment to connect as root instead. + // More info: https://aka.ms/dev-containers-non-root. "remoteUser": "root" } diff --git a/aries-mobile-tests/Dockerfile.dev-harness b/aries-mobile-tests/Dockerfile.dev-harness index 14565ed..b2914f0 100644 --- a/aries-mobile-tests/Dockerfile.dev-harness +++ b/aries-mobile-tests/Dockerfile.dev-harness @@ -1,20 +1,21 @@ -FROM python:3.9-bullseye +FROM python:3.9-bullseye AS base + +ARG TARGETARCH # Install sudo -RUN apt-get update && apt-get install -y sudo +RUN apt-get update && \ + apt-get install -y sudo chromium wget unzip openjdk-11-jdk && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN apt update && apt install -y chromium +FROM base # workaround for chromium crash reports warning RUN mkdir -p "/root/.config/chromium/Crash Reports/pending" -#Setup Android SDK -# Install necessary tools -RUN apt-get update && apt-get install -y wget unzip openjdk-11-jdk - # Set JAVA_HOME environment variable -ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64 -ENV PATH $PATH:$JAVA_HOME/bin +ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-${TARGETARCH} +ENV PATH=$PATH:$JAVA_HOME/bin # Download and unzip Android SDK command line tools RUN mkdir -p /usr/local/android-sdk && \ @@ -29,15 +30,11 @@ RUN mv /usr/local/android-sdk/cmdline-tools /usr/local/android-sdk/cmdline-tools rm -r /usr/local/android-sdk/cmdline-tools-temp # Set environment variable -ENV ANDROID_HOME /usr/local/android-sdk -ENV PATH $PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools +ENV ANDROID_HOME=/usr/local/android-sdk +ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools # Accept Android SDK licenses -RUN yes | sdkmanager --licenses - -# Install platform tools that includes adb -RUN sdkmanager "platform-tools" -# Install Android Build Tools -RUN yes | sdkmanager --install "build-tools;30.0.3" - +RUN yes | sdkmanager --licenses && \ + sdkmanager "platform-tools" && \ + yes | sdkmanager --install "build-tools;30.0.3" diff --git a/aries-mobile-tests/config.json b/aries-mobile-tests/config.json index 3cd25ac..e5800be 100644 --- a/aries-mobile-tests/config.json +++ b/aries-mobile-tests/config.json @@ -1,20 +1,20 @@ { - "capabilities": { - "firstMatch": [ - { - "platformName": "Android", - "appium:options": { - "app": "storage:filename=BCWallet-1459.aab", - "autoGrantPermissions": true, - "automationName": "UiAutomator2" - }, - "sauce:options": { - "appiumVersion": "latest", - "fullReset": true, - "sauceLabsImageInjectionEnabled": true, - "sessionCreationRetry": "3" - } - } - ] - } + "capabilities": { + "firstMatch": [ + { + "platformName": "Android", + "appium:options": { + "app": "storage:filename=BCWallet-2124.aab", + "autoGrantPermissions": true, + "automationName": "UiAutomator2" + }, + "sauce:options": { + "appiumVersion": "latest", + "fullReset": true, + "sauceLabsImageInjectionEnabled": true, + "sessionCreationRetry": "3" + } + } + ] + } } \ No newline at end of file