diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..2078e8c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,67 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// 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. + "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": { + "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 + "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" } + ], + + // 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", + + "runArgs": [ + "--network=aath_network", + "--name=amth_test_dev" + ], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "pip install --upgrade pip && \ + // pip install --no-cache-dir aiohttp behave allure-behave python-decouple", + "postCreateCommand": "pip install --upgrade pip && \ + pip install -r aries-mobile-tests/requirements.txt && \ + pip install --no-cache-dir python-decouple && \ + curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \ + sudo apt-get install -y nodejs && \ + npm install -g appium && \ + appium driver install uiautomator2", + + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + "settings": { + "extensions.verifySignature": false + }, + "extensions": [ + "ms-python.python", + "ms-python.debugpy", + "ms-python.vscode-pylance", + "alexkrechik.cucumberautocomplete", + "zainchen.json" + ] + } + }, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root" +} diff --git a/.gitignore b/.gitignore index 4f4e122..4d009b8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ __pycache__ .logs .build *.log -.vscode/ all_steps.py aries-mobile-tests/features/steps/all_steps.py aries-mobile-tests/allure/allure-results/environment.properties diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..232292b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,188 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + { + "name": "Python: Current File", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal" + }, + { + "name": "Python: Behave current file", + "type": "debugpy", + "request": "launch", + "module": "behave", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}/aries-mobile-tests", + "env": { + "SAUCE_USERNAME": "", + "SAUCE_ACCESS_KEY": "", + "SL_REGION": "us-west-1", + "DEVICE_CLOUD": "SauceLabs" + }, + "args": [ + "${file}", + "--tags=@T002-Proof", + "-k", + "-D", + "Issuer=AATH;http://acme_agent:9020", + "-D", + "Verifier=AATH;http://bob_agent:9030" + ] + }, + { + "name": "Python: Behave current file LocalAndroid", + "type": "debugpy", + "request": "launch", + "module": "behave", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}/aries-mobile-tests", + "env": { + "SAUCE_USERNAME": "", + "SAUCE_ACCESS_KEY": "", + "SL_REGION": "us-west-1", + "DEVICE_CLOUD": "LocalAndroid" + }, + "args": [ + "${file}", + "--tags=@T002-Proof", + "-k", + "-D", + "Issuer=AATH;http://host.docker.internal:9020", + "-D", + "Verifier=AATH;http://host.docker.internal:9030" + ] + }, + { + "name": "Python: Behave current file Sauce Labs non-AATH Agents", + "type": "debugpy", + "request": "launch", + "module": "behave", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}/aries-mobile-tests", + "env": { + "SAUCE_USERNAME": "", + "SAUCE_ACCESS_KEY": "", + "SL_REGION": "us-west-1", + "DEVICE_CLOUD": "SauceLabs", + "TEST_RETRY_ATTEMPTS_OVERRIDE": "1" + }, + "args": [ + "${file}", + "--tags=@T009-Proof", + "-k", + "-D", + "Issuer=CANdy_UVP;https://openvp-candy-issuer-test.apps.silver.devops.gov.bc.ca/", + "-D", + "Verifier=PCFT_Chat;https://pctftest-test.vonx.io/" + ] + }, + { + "name": "Python: Behave current file Sauce Labs Connectionless", + "type": "debugpy", + "request": "launch", + "module": "behave", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}/aries-mobile-tests", + "env": { + "SAUCE_USERNAME": "", + "SAUCE_ACCESS_KEY": "", + "SL_REGION": "us-west-1", + "DEVICE_CLOUD": "SauceLabs", + "TEST_RETRY_ATTEMPTS_OVERRIDE": "1" + }, + "args": [ + "${file}", + "--tags=@T009.1-Proof", + "-k", + "-D", + "Issuer=CANdy_UVP;https://openvp-candy-issuer-test.apps.silver.devops.gov.bc.ca/", + "-D", + "Verifier=AATH;http://bob_agent:9030" + ] + }, + { + "name": "Python: Behave current file Sauce Labs BCSC", + "type": "debugpy", + "request": "launch", + "module": "behave", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}/aries-mobile-tests", + "env": { + "SAUCE_USERNAME": "", + "SAUCE_ACCESS_KEY": "", + "SL_REGION": "us-west-1", + "DEVICE_CLOUD": "SauceLabs", + "BC_VP_USERNAME": "", + "BC_VP_PASSWORD": "", + "BC_VP_HOLDER_EMAIL": "", + "BC_VP_HOLDER_EMAIL_PASSWORD": "", + "BCSC_ACCOUNT_USER": "", + "BCSC_ACCOUNT_PASSWORD": "", + "GOOGLE_API_TOKEN": "", + "GOOGLE_API_CREDENTIALS": "" + }, + "args": [ + "${file}", + "--tags=@T001-BCSC", + "-k", + "-D", + "Issuer=BC_VP;https://bcvcpilot-issuer-admin-test.apps.silver.devops.gov.bc.ca", + "-D", + "Verifier=BC_Person_Showcase;https://bc-wallet-demo-agent-admin-test.apps.silver.devops.gov.bc.ca" + ] + }, + { + "name": "Python: Behave current file Mobile Verifier", + "type": "debugpy", + "request": "launch", + "module": "behave", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}/aries-mobile-tests", + "env": { + "SAUCE_USERNAME": "", + "SAUCE_ACCESS_KEY": "", + "SL_REGION": "us-west-1", + "DEVICE_CLOUD": "SauceLabs" + }, + "args": [ + "${file}", + "--tags=@T001.2-MobileVerifier", + "-k", + "-D", + "Issuer=CANdy_UVP;https://openvp-candy-issuer-test.apps.silver.devops.gov.bc.ca/", + "-D", + "Holder=AATH;http://bob_agent:9030" + ] + }, + { + "name": "Python: Behave current file Sauce Labs BC Showcase", + "type": "debugpy", + "request": "launch", + "module": "behave", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}/aries-mobile-tests", + "env": { + "SAUCE_USERNAME": "", + "SAUCE_ACCESS_KEY": "", + "SL_REGION": "us-west-1", + "DEVICE_CLOUD": "SauceLabs", + "TEST_RETRY_ATTEMPTS_OVERRIDE": "1" + }, + "args": [ + "${file}", + "--tags=@T002-BCShowcase", + "-k", + "-D", + "Issuer=BCShowcaseIssuer;https://bc-wallet-demo.apps.silver.devops.gov.bc.ca/", + "-D", + "Verifier=BCShowcaseVerifier;https://bc-wallet-demo.apps.silver.devops.gov.bc.ca/" + ] + }, + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..c451c13 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,47 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Start Aries Agents", + "type": "shell", + "command": "cd ~/Projects/BC.gov/aries-agent-test-harness && LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io TAILS_SERVER_URL_CONFIG=https://tails.vonx.io AGENT_CONFIG_FILE=/aries-backchannels/acapy/auto_issuer_config.yaml ./manage start -a acapy-main -b acapy-main -n" + }, + { + "label": "Stop Aries Agents", + "type": "shell", + "command": "cd ~/Projects/BC.gov/aries-agent-test-harness && ./manage stop" + }, + { + "label": "Start Appium Server in Dev Container", + "type": "shell", + "command": "appium --base-path /wd/hub --allow-cors", + "isBackground": true, + "problemMatcher": { + "owner": "custom", + "pattern": { + "regexp": ".*" + }, + "background": { + "activeOnStart": true, + "beginsPattern": "^\\[Appium\\] Welcome to Appium v.*", + "endsPattern": "^\\[Appium\\] Appium REST http interface listener started on 0.0.0.0:4723" + } + }, + "presentation": { + "reveal": "always", + "panel": "new" + } + }, + { + "label": "Stop Appium Server", + "type": "shell", + "command": "pkill -2 -f appium", + "presentation": { + "reveal": "always", + "panel": "new" + } + } + ] +} \ No newline at end of file diff --git a/DEV_CONTAINERS.md b/DEV_CONTAINERS.md new file mode 100644 index 0000000..4c848b7 --- /dev/null +++ b/DEV_CONTAINERS.md @@ -0,0 +1,153 @@ +# Working with the MWTH Dev Container + +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) + +## Contents +- [Summary](#summary) +- [Prerequisites](#prerequisites) +- [Setup](#setup) +- [Running Tests](#running-tests) + - [Write your tests](#write-your-tests) + - [Run your tests](#run-your-tests) + - [Using Appium Inspector](#using-appium-inspector) + - [Connected Real Android Devices](#connected-real-android-devices) + - [Cloud Based Device Services](#cloud-based-device-services) + - [Biometrics Handling & QR Code Scanning](#biometrics-handling--qr-code-scanning) + - [Using AATH Agents as Issuers and Verifiers](#using-aath-agents-as-issuers-and-verifiers) + +## Summary + +The Mobile Wallet Test Harness(aka Aries Mobile Test Harness) provides a [Dev Container](https://code.visualstudio.com/docs/devcontainers/tutorial) to streamline the process of writing and debugging mobile wallet tests. This setup allows developers to write test code for wallet apps without having to install all libraries and configure their local machine for mobile wallet testing. This document outlines the steps to set up and run the Dev Container with Appium server and a local Android device or a Device Cloud Service. + +## Prerequisites + +- Docker installed on your local machine +- Visual Studio Code with the [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) installed +- Android Studio or the Android SDK Platform-Tools installed on your local machine +- A local Android emulator downloaded and installed,a connected Android device, or a subscription to one of the supported Device Cloud Services. + +## Setup + +**Clone the repository**: Clone the [Mobile Wallet Test Harness repository](https://github.com/openwallet-foundation/mobile-wallet-test-harness) to your local machine. + +**Open the project in VS Code**: Open the cloned repository in Visual Studio Code. + +**Add the app apk to the mount location:** The `devcontainer.json` file in `aries-movile-test-harness/.devcontainer/` defines where to get the app to install into the emulator. It is located in this `mounts` section: +``` + "mounts": [ + { "source": "/Users/Shel/Projects/BC.gov/apps/bc-wallet", "target": "/bc-wallet/app", "type": "bind" }, + { ... + ], +``` +Change the `source` in the mount to the location of the apps apk file. Change the `target` if you so desire, but remember it to reference later. + +**Update the apk filename in the android config:** Open and copy the contents of the `local_android_config.json` file and replace the contents of `config.json` with it. +Update the `app` section with the name of your app apk file. If you changed the `mount` `target` location for the app above. then change it here as well to the correct app target location. +``` +{ + "capabilities": { + ... + "app": "/bc-wallet/app/app-release1735.apk", + ... + } +} +``` + +**Start the Dev Container**: In VS Code, use the Command Palette (`F1`) to run the `Remote-Containers: Reopen in Container` command. This will start the Dev Container. +This will take a few minutes on the first opening, since it will be building the container with all test harness dependencies. + +**Start the Android device**: Connect your local Android device to your local machine via USB, or start the Android emulator. Here is an example of what that may look like in a terminal. In the location of your /emulator +``` +./emulator -avd -no-snapshot-load & +``` +Check to make sure adb server is running and that it sees the running emulator. +``` +platform-tools> adb devices +``` +You should see something like the following: +``` +List of devices attached +emulator-5554 device +``` +You could also do all of this in Android Studio in the Device Manager. + +**Start Appium Server**: In VS Code, use the Command Palette (`F1`) to run the `Tasks: Run Tasks` command, and select `Start Appium Server` This will start Appium Server inside the Dev Container. + +You are now ready to start writing, running, and debugging wallet tests. + +## Running Tests + +### Write your tests +Write your mobile wallet tests as you would as if you had setup the test harness locally as described in [Implementing Tests for Your Wallet](README.md#implementing-tests-for-your-wallet) + +### Run your tests +The following examples will reference the BC Wallet app. Just replace those specifics with your own. + +**Review/Update the config.json:** Make sure the config.json has the correct app location and app name in the dev container. Also make sure the udid is set to the emulator name you are running. +``` +{ + "capabilities": { + "platformName": "Android", + "app": "/bc-wallet/app/app-release1735.apk", + "autoGrantPermissions": true, + "automationName": "UiAutomator2", + "udid": "emulator-5554", + "remoteAdbHost": "host.docker.internal", + "newCommandTimeout": 480 + } +} +``` + +**Update the launch.json:** The test harness comes with a handful of predefined launch configurations, mostly that work with BC Wallet. Take one that best matches the Device Service and issuer and verifier agents you are using. The one below uses a local Android device and issuer and verifier from Aries Agent Test Harness Agents. +The other configuration you will be concerned with is the `--tags` setting. Update this to the tag(s) that represents the test(s) you want to run. +``` + { + "name": "Python: Behave current file LocalAndroid", + "type": "debugpy", + "request": "launch", + "module": "behave", + "console": "integratedTerminal", + "cwd": "${workspaceFolder}/aries-mobile-tests", + "env": { + "DEVICE_CLOUD": "LocalAndroid" + }, + "args": [ + "${file}", + "--tags=@T002-Proof", + "-k", + "-D", + "Issuer=AATH;http://host.docker.internal:9020", + "-D", + "Verifier=AATH;http://host.docker.internal:9030" + ] + }, +``` + +Make sure your launch configuration is selected in the Run and Debug Section in VS Code. + + +**Open the feature file:** In order to run with the debugger with the behave module you must have the feature file with the test definition you referenced with the `--tag` option above, opened and active in VS code and with the test you want to run + +**Run:** At this point you can run the debugger let the test play through or put breakpoints where ever you want to diagnose issues. + +You should at this point see the app load on the device and the test control the app. + +### Using Appium Inspector +When writing and running/debugging tests you will want to use a tool to get the possible element locators in the app. The easiest way to do this with the dev container is to use appium inspector in the browser on your local machine. +Go to https://inspector.appiumpro.com/ and select the Appium Server section. Enter `localhost` as Remote Host, `4723` as the Remote Port, and `/wd/hub` as Remote Path. Select Attach to Session... and you should see the session ID of the Appium Server session you have running in the Dev Container. Selecting Attach to Session at the bottom of the page and you should see a view of the device, be able to control it, and inspect the page contents. + +### Connected Real Android Devices +If you desire to use a real device, the same launch.json configuration as shown above for LocalAndroid can be used. You will just have to get adb connected to that device either through USB or wirelessly. + +### Cloud Based Device Services +The Dev Container can also work with Test Harness supported Device Cloud Services like Sauce Labs or LambdaTest. You would need to configure the config.json to look like the other example configs that exist like `sl_ios_config.json` for Sauce Labs iOS devices. + +### Biometrics Handling & QR Code Scanning +To get your Android Emulator to work with biometrics handeling and scanning of QR Codes generated by issuers and verifiers in the Test Harness please follow the instructions [here](MOBILE_DEVICE_SERVICES.md#setup-with-an-local-android-emulator). + +### Using AATH Agents as Issuers and Verifiers +You can use many different issuers and verfiers with your tests and when developing in the dev container, including [creating your own agent interfaces](AGENT_ABSTRACTION.md#implementing-agent-interfaces-for-your-agents). However, the most common is to use issuers and verifiers that are created from the AATH test agents. In the context of the dev container, you will need to run these agents outside of the dev container as you regularly would as documented [here](AGENT_ABSTRACTION.md#usage-at-runtime). It seem that when using the AATH agents you will have to use the NGROK tunnel option on the agents for the local android emulator/device and the agents to communicate. + +It has also been observed that sometimes VSCode may hold on to forwarded ports from runs of other dev containers (for example if you are running AATH agent in a dev container). If you are running AMTH in a Dev Container, you are also using AATH agents as issuers or verifiers, and you are having trouble with calls to the agent hanging, check the ports tab in VSCode in the running dev container. If you see ports like 9020 or 9030, just delete the port forwarding in that tab and rerun the tests. + + diff --git a/aries-mobile-tests/Dockerfile.dev-harness b/aries-mobile-tests/Dockerfile.dev-harness new file mode 100644 index 0000000..14565ed --- /dev/null +++ b/aries-mobile-tests/Dockerfile.dev-harness @@ -0,0 +1,43 @@ +FROM python:3.9-bullseye + +# Install sudo +RUN apt-get update && apt-get install -y sudo + +RUN apt update && apt install -y chromium + +# 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 + +# Download and unzip Android SDK command line tools +RUN mkdir -p /usr/local/android-sdk && \ + wget -q https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip && \ + unzip commandlinetools-linux-7302050_latest.zip -d /usr/local/android-sdk && \ + rm commandlinetools-linux-7302050_latest.zip + +# Move unzipped "cmdline-tools" directory to "cmdline-tools/latest" +RUN mv /usr/local/android-sdk/cmdline-tools /usr/local/android-sdk/cmdline-tools-temp && \ + mkdir -p /usr/local/android-sdk/cmdline-tools/latest && \ + mv /usr/local/android-sdk/cmdline-tools-temp/* /usr/local/android-sdk/cmdline-tools/latest && \ + 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 + +# 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" + + diff --git a/aries-mobile-tests/device_service_handler/device_service_handler_interface.py b/aries-mobile-tests/device_service_handler/device_service_handler_interface.py index 465961a..46b45d3 100644 --- a/aries-mobile-tests/device_service_handler/device_service_handler_interface.py +++ b/aries-mobile-tests/device_service_handler/device_service_handler_interface.py @@ -25,6 +25,10 @@ def __init__(self, config_file_path: str): self.set_device_service_specific_options() self._options = AppiumOptions() + def is_running_in_dev_container(self): + """Returns: True if running in a VS Code Dev Container, else False""" + return 'REMOTE_CONTAINERS_IPC' in os.environ + @abstractmethod def set_device_service_specific_options(self, options:dict=None, command_executor_url:str=None): """set any specific device options before initialize_driver is called """ diff --git a/aries-mobile-tests/device_service_handler/local_android_handler.py b/aries-mobile-tests/device_service_handler/local_android_handler.py index b0c2b32..686fdd4 100644 --- a/aries-mobile-tests/device_service_handler/local_android_handler.py +++ b/aries-mobile-tests/device_service_handler/local_android_handler.py @@ -28,12 +28,20 @@ def set_device_service_specific_options(self, options: dict = None, command_exec def set_desired_capabilities(self, config: dict): """set extra capabilities above what was in the config file""" # Handle common options and capabilities - for item in config: - self._CONFIG['capabilities'][item] = config[item] + #for item in config: + # self._CONFIG['capabilities'][item] = config[item] self._desired_capabilities = self._CONFIG['capabilities'] print("\n\nDesired Capabilities passed to Appium:") print(json.dumps(self._desired_capabilities, indent=4)) + self._set_appium_options_from_desired_capabilities() + + def _set_appium_options_from_desired_capabilities(self): + """set the appium options from the desired capabilities""" + #self._options = webdriver.AppiumOptions() + for key in self._desired_capabilities: + self._options.set_capability(key, self._desired_capabilities[key]) + def inject_qrcode(self, image): """pass the qrcode image to the device in a way that allows for the device to scan it when the camera opens""" # get the android home environment variable @@ -42,6 +50,10 @@ def inject_qrcode(self, image): shutil.copy( "qrcode.png", f"{android_home}/emulator/resources/qrcode.png") + # if we are running in a dev container copy to /qrcodes as well. + if self.is_running_in_dev_container(): + shutil.copy( + "qrcode.png", f"/qrcodes/qrcode.png") def biometrics_authenticate(self, authenticate: bool, finger_id: int = 1): """authenticate when biometrics, ie fingerprint or faceid, true is success, false is fail biometrics""" diff --git a/aries-mobile-tests/features/steps/bc_wallet/connect.py b/aries-mobile-tests/features/steps/bc_wallet/connect.py index 37380ce..d029f79 100644 --- a/aries-mobile-tests/features/steps/bc_wallet/connect.py +++ b/aries-mobile-tests/features/steps/bc_wallet/connect.py @@ -3,6 +3,7 @@ # # ----------------------------------------------------------- +import os from pageobjects.bc_wallet.scan import ScanPage from pageobjects.bc_wallet.navbar import NavBar from behave import given, when, then @@ -40,7 +41,7 @@ def step_impl(context, pin): @when('the Holder scans the QR code sent by the "{agent}"') def step_impl(context, agent): # check the device serivce handler to see if we are on a tablet or phone - if context.device_service_handler.is_current_device_a_tablet(): + if "Local" not in os.environ['DEVICE_CLOUD'] and context.device_service_handler.is_current_device_a_tablet(): qr_code_border = 80 else: qr_code_border = 40 diff --git a/aries-mobile-tests/features/steps/bc_wallet/security.py b/aries-mobile-tests/features/steps/bc_wallet/security.py index 058aba5..c267fe2 100644 --- a/aries-mobile-tests/features/steps/bc_wallet/security.py +++ b/aries-mobile-tests/features/steps/bc_wallet/security.py @@ -76,7 +76,10 @@ def step_impl(context): assert context.thisOnboardingBiometricsPage.select_biometrics() #context.thisInitializationPage = context.thisOnboardingBiometricsPage.select_continue() context.thisEnableNotificationsPage = context.thisOnboardingBiometricsPage.select_continue() - context.device_service_handler.biometrics_authenticate(True) + # Not sure we need this next line since I don't think the app asks to authenticate when you select to use biometrics. + # This is causing the test to fail when using a local android device so make this line conditional + if "Local" not in os.environ['DEVICE_CLOUD']: + context.device_service_handler.biometrics_authenticate(True) @then('they have access to the app') def step_impl(context): diff --git a/aries-mobile-tests/local_android_config.json b/aries-mobile-tests/local_android_config.json index 5d9e3b5..bfeb196 100644 --- a/aries-mobile-tests/local_android_config.json +++ b/aries-mobile-tests/local_android_config.json @@ -1,13 +1,11 @@ { "capabilities": { - "appPackage": "ca.bc.gov.BCWallet", - "appium:appActivity": "ca.bc.gov.BCWallet.MainActivity", "platformName": "Android", - "app": "/Users/Shel/Projects/BC.gov/apps/bifold-bc/AriesBifold-209.apk", - "deviceName": "Android Accelerated Oreo", - "udid": "emulator-5554", - "automationName": "UiAutomator2", + "app": "/bc-wallet/app/app-release1735.apk", "autoGrantPermissions": true, - "fullReset": true + "automationName": "UiAutomator2", + "udid": "emulator-5554", + "remoteAdbHost": "host.docker.internal", + "newCommandTimeout": 480 } } \ No newline at end of file