Skip to content
Le Zhou edited this page Jun 21, 2022 · 36 revisions

Introduction

Welcome to Hydra-Lab Wiki.

Getting Started(For Developer)

1.Set up environment

  1. Install Java sdk link (at least jdk 11)
  2. Install Python 3.7+ link
  3. Install Android sdk link
  4. Install Node.js link
  5. Install Appium execute npm install -g appium
  6. Install WinAppdriver 1.2.1
  7. Config Environment Variables - System variables (take this as a reference)
Type Variable Name Value
Java JAVA_HOME C:\Program Files\Java\jdk-11.0.14
Java CLASSPATH .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
Java Path %JAVA_HOME%\bin
Java Path %JAVA_HOME%\jre\bin
Python Path C:\Python38|
Python Path C:\Python38\Scripts|
Android ANDROID_HOME C:\Users\demo\AppData\Local\Android\Sdk
Android ANDROID_PLATFORM_TOOLS C:\Users\demo\AppData\Local\Android\Sdk\platform-tools
Android Path %ANDROID_HOME%
Android Path %ANDROID_PLATFORM_TOOLS%
Node NODE_PATH C:\Users\demo\AppData\Roaming\npm\node_modules
Node Path C:\Users\demo\AppData\Roaming\npm
Appium APPIUM_BINARY_PATH C:\Users\demo\AppData\Roaming\npm\node_modules\appium\build\lib\main.js

2. Add a Storage in Azure

  1. Create a storage account https://portal.azure.com/#create/Microsoft.StorageAccount-ARM
  2. Create 4 containers: pkgstore, images, testsuitestore, testresults
  3. Change access level of them to Container (anonymous read access for containers and blobs).

3.Build font-end project

Go to react_network_center_portal folder, & run:

npm install
npm run pub

4.Config Hydra Lab Center

Add a .env file in network_center/src/main/resources. If you want to enable OAuth2, please set up an AAD Client in Azure and modify ${the spring.security.oauth2.enabled} in application.yml to true value. more

BLOB_CONNECTION_STR=${Azure Blob Connection String}
DEFAULT_USER=defaultUser@1234.com
MICROSOFT_PROVIDER_CLIENT_ID=${Microsoft AAD Client ID}
MICROSOFT_PROVIDER_AUTHENTICATION_SECRET=${Microsoft AAD Client Secret}

5.Config Hydra Lab Agent

Register a agent in Hydra Lab Center and then add a .env file in network_agent/src/main/resources.

image

image

BLOB_CONNECTION_STR=${Azure Blob Connection String}
AGENT_SECRET=${Generated in Hydra Lab Center}
AGENT_ID=${Generated in Hydra Lab Center}
AGENT_TYPE=${1:Run test in Android, 2:Run test in Winwows+Android, 3:Run test in iOS}

Capability

Name Android IOS
Get Device List android-ddmlib + Map xcrun xctrace list devices / tidevice list --json (tidevice)
Monitor Device Status android-ddmlib(IDeviceChangeListener) tidevice watch
Get Screenshot android-ddmlib(IDevice) tidevice screenshot $path_to_save_img
Wake up Device adb -s {} shell input keyevent {} Appium: driver.unlockDevice()
Grant Permission adb -s {} shell pm grant packageName permissionName Appium: driver.runAppInBackground(Duration.ofSeconds(-1))
Install/Uninstall App adb -s {} install/uninstall tidevice install $path_to_testApp / tidevice uninstall com.microsoft.packageName / tidevice install idb launch com.microsoft.packageName
Record Video Screen Record App Appium
Clone this wiki locally