GithubHelp home page GithubHelp logo

youweideng80 / hydralab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/hydralab

0.0 0.0 0.0 58.2 MB

Intelligent cloud testing made easy. 搭建属于你的移动云测试平台

License: MIT License

Shell 0.38% JavaScript 16.02% Java 69.03% Groovy 0.53% PowerShell 2.66% TypeScript 1.54% CSS 1.05% HTML 8.27% Batchfile 0.17% Dockerfile 0.32% SCSS 0.04%

hydralab's Introduction

Hydra Lab

Build your own cloud testing infrastructure

What is Hydra Lab?

Hydra Lab is a framework that can help you easily build a cloud testing platform utilizing the test devices/machines in hand. It enables dev team to quickly build a self-manageable and intelligent cloud testing infrastructure. With the help of Hydra Lab, you can:

  • Either: Create a new cloud testing network.
  • Or: Onboard your test device to an existing network with a minimized effort.

Capabilities of Hydra Lab include:

  • Scalable test device management under the center-agent distributed design; Test task management and test result visualization.
  • Powering Android Espresso Test.
  • Appium(Java) test on different platforms: Windows/iOS/Android/Browser/Cross-platform.
  • Case-free test automation: Monkey test, Smart exploratory test.

For more details, see Introduction: What is Hydra Lab?

Get Started

Please visit our GitHub Project Wiki to understand the dev environment setup procedure: Contribution Guideline.

Supported environments for Hydra Lab agent: Windows, Mac OSX, and Linux (Docker).

Supported platforms and frameworks matrix:

Appium(Java) Espresso
Android
iOS x
Windows x
Web (Browser) x

Quick guide on out-of-box Uber docker image

Hydra Lab offers an out-of-box experience of docker image called Uber. You can follow the below steps and start your docker container with a center instance and an agent instance built in:

Step 1. download and install Docker from https://www.docker.com

Step 2. run on your machine

Simply choose one of the following commands to start your experience on Hydra Lab:

1. use local storage service

Hydra Lab Uber image uses local file system as default storage, no extra environment variable is needed:

docker run -p 9886:9886 --name=hydra-lab ghcr.io/microsoft/hydra-lab-uber:latest

2. use third-party storage service

Hydra Lab currently supports Azure Blob Storage as cloud file storage solution to persist various file types such as log files, video, app package, etc. Any contribution to integrating other third-party storage services is welcome. (Here's the UML class diagram for this module as a reference: storage service structure.)

Some extra environment variables need to be specified in the command according to the storage service type.

If you want to use Azure Blob storage, please go to your Azure portal, open an Azure Blob storage account, and get the connection string. Brief steps: Login Azure -> Portal -> Storage Accounts -> Create new storage account (you may disable the public access for the container) -> In the created storage account, find Access Keys tab -> copy Connection string. image

You may write the following content in an env file (e.g. env.properties):

STORAGE_TYPE=AZURE
BLOB_CONNECTION_STR=${YOUR_BLOB_CONNECTION_STR}

Then pass the path of the file to docker container

docker run --env-file env.properties -p 9886:9886 --name=hydra-lab ghcr.io/microsoft/hydra-lab-uber:latest

Or simply run with the env parameter -e:

docker run -e STORAGE_TYPE=AZURE -e BLOB_CONNECTION_STR=${YOUR_BLOB_CONNECTION_STR} -p 9886:9886 --name=hydra-lab ghcr.io/microsoft/hydra-lab-uber:latest

Step 3. visit front-end page and view your connected devices

Url: http://localhost:9886/portal/index.html#/ (or your custom port).

Enjoy starting your journey of exploration!

Note: Uber now only provides the Espresso test feature for Android, please refer to this section for more features: For Hydra Lab User

Quick guide on build and run

You can also run the center java Spring Boot service (a runnable Jar) separately with the following commands:

The build and run process will require JDK11 | NPM | Android SDK platform-tools in position.

Step 1. build and run Hydra Lab center service.

# In project root, switch to react folder to build the Web front.
cd react
npm ci
npm run pub
# Get back to the project root, and build the center runnable Jar. 
cd ..
# For the gradlew command, if you are on Windows please replace it with `./gradlew` or `./gradlew.bat`
gradlew :center:bootJar
# Run it, and then visit http://localhost:9886/portal/index.html#/
java -jar center/build/libs/center.jar
# Then visit http://localhost:9886/portal/index.html#/auth to generate a new agent ID and agent secret.

If you encounter the error: Error: error:0308010C:digital envelope routines::unsupported, set the System Variable NODE_OPTIONS as --openssl-legacy-provider and then restart the terminal.

Step 2. build and run Hydra Lab agent service.

# In project root, copy the sample config file and update the:
# YOUR_AGENT_NAME, YOUR_REGISTERED_AGENT_ID and YOUR_REGISTERED_AGENT_SECRET.
cp agent/application-sample.yml application.yml
# Then build agent jar and run it
gradlew :agent:bootJar
java -jar agent/build/libs/agent.jar

Step 3. visit http://localhost:9886/portal/index.html#/ and view your connected devices

Technical design overview:

Tech Architecture

More integration guidelines:

Note: 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 service instance.

Who are using Hydra Lab?

It's already powering the UI test automation of the following Microsoft products:

  • Microsoft Phone Link (Windows UWP app) and Link to Windows (Android app)
  • Microsoft Launcher (Android)
  • Microsoft Outlook/Edge (Android/iOS)
  • Microsoft Fluent UI Android/Yammer Android

Contribute

Your contribution to Hydra Lab will make a difference for the entire test automation ecosystem. Please refer to CONTRIBUTING.md for contribution instructions.

Contributor Hero Wall:

Contact Us

Feel free to dive in! If you have questions about Hydra Lab, or you would like to reach out to us about an issue you're having, you can reach us as follows:

Links

Microsoft Give Sponsors

Thank you for your contribution to Microsoft employee giving program in the name of Hydra Lab:

@Germey(崔庆才), @SpongeOnline(王创), @ellie-mac(陈佳佩), @Yawn(刘俊钦), @White(刘子凡), @597(姜志鹏), @HCG(尹照宇)

Microsoft Give

License & Trademarks

The entire codebase is under MIT license.

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

hydralab's People

Contributors

hydraxman avatar zhou9584 avatar olivershen-wow avatar taoran6 avatar tedaliez avatar raccoonli avatar dependabot[bot] avatar dexterdreeeam avatar dinghong2233 avatar microsoftran avatar lifesaver0129 avatar ac-phoenix avatar nathan2win avatar microsoftopensource avatar wwmmssyster avatar bipin-k avatar eltociear avatar ellie-mac avatar marianconstantinmarica avatar sangling avatar lastsource avatar jkfhklh avatar aqinqin48 avatar jzp1996 avatar spongeonline avatar mahoshojohcg avatar microsoft-github-operations[bot] avatar ying-star avatar germey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.