Skip to content

Test agent setup

Nathan Bu edited this page May 10, 2023 · 21 revisions

If you are a Microsoft FTE and want to onboard to the internal Hydra Lab testing service, please visit our SharePoint site to learn more about the internal Hydra Lab service instance.

If you don't know what is a test agent, visit Glossary to learn common concepts in the Hydra Lab project.

Agent machine environment setup guideline

Depending on your auto-testing demands and device status, there are several types of Hydra Lab test agent you can set up, so please choose the right agent setup instructions according to your requirements:

Test Agent Machine OS Test Framework Support Instruction
Windows(X86/X64) Android Espresso Link
Windows(X86/X64) Appium Android Link
Windows(X86/X64) Appium Cross Device E2E Test Link
Windows(X86/X64) Appium iOS Link
MacOS Appium iOS Link
Linux Android Espresso Link
Linux Appium WIP
Windows(ARM64) Appium Cross Device E2E Test Link

Common MUST-HAVE

Download the agent configuration

You need to download the application.yml which contains your agent identity token and put it under the same folder with agent.jar as the additional application configuration. And in this YAML file, you can also customize your agent test lifecycle according to this wiki. Please navigate to the below page in your center portal, create a new agent, and follow the steps illustrated by the screenshots to download the application.yml that belongs to your agent.

Create a new agent under the Auth page

Click this button to download your configuration

Common Dependencies

  • JDK (11 and above).

Test Device Onboarding

Android Phone

To ensure your Android Test Phone can be stably connected to the agent/center service, please follow the below 2 steps as onboarding guides:

  1. Turn on the Android Debug mode on your phone and connect the phone to the PC with cable or ADB wireless mode (Another guideline for wireless setup).
  2. Set the phone lock mode as 'None' in the Phone lock screen setting page: Settings > Security > Screen Lock, and if prompted, enter your current lock screen code > None > Delete.

After a successful test run, you will find that a new app is installed on the phone called "HydraLab Client", which chiefly helps record test run videos on the phone. For some phones with customized rom (e.g.: Xiaomi), you may need to manually allow the HydarLab Client app display over other apps:

image

You can also add the app to the battery save mode whitelist to secure the recording service running consistently. We have pragmatically enabled it with this relevant code and this, but on some phones with customized rom you may need to configure it manually in the Setting, e.g.: Settings > Battery > Battery Optimization.

iPhone

After connecting the iPhone and PC with a USB wire, you need to Choose "trust the computer" on the phone. And then you need to install the WebDriverAgent(WDA) on the phone, which is the same one used in Appium iOS testing. We offer internal support for this integration within Microsoft. Please contact Nathan or Millard to get the internal integration wiki.

Performance Testing

For battery testing on Windows, the following 2 prerequisites are required

  1. Requires a Windows device with a battery, such as a laptop.
  2. Need to disable UAC popup manually since the elevated privileges is required which would blocking the performance testing.
    image
Clone this wiki locally