Tool for manual controlling Mobile Application on Sauce Labs
Do you know Sauce Labs has a hidden feature that allows you to have
full control over simulator/emulator and do
manual testing for native mobile applications?
However, it requires quite a hack/workaround before you can make it work.
This tool helps you:
- Automatically upload your application to Sauce Labs storage
- Quickly bypass all the hack that are needed for the setup
- Automatically setup Sauce Connect tunnel between your local machine and Sauce Labs VM so the mobile application tested could access the internal network resources
- Support both iOS and Android
All you need to do is to start the tool in a terminal, then go to the link printed out in the terminal when it finishes setup, and from there you'll have full manual control over your mobile application in the specified simulator/emulator.
Setup
$ git clone git@github.com:chenchaoyi/saucebreak.git
$ npm install
Usage
export SAUCE_USERNAME=your_user_name
export SAUCE_ACCESS_KEY=your_access_key
Regular mobile application manual control
e.g.: If you only need to manually test the mobile application without Sauce Connect
UPLOADAPP=true APP_PATH=path_to_your_app ./node_modules/.bin/magellan --browsers=iphone_9_3_iOS_iPhone_Simulator
NODE_ENV=android UPLOADAPP=true APP_PATH=path_to_your_app ./node_modules/.bin/magellan --browsers=android_5_1_Linux_Android_Emulator
Mobile application manual control with newly created network tunnel
e.g.: If you are inside internal network (in the office or have access through VPN), and want to manually test the mobile application by yourself with internal network access
UPLOADAPP=true APP_PATH=path_to_your_app ./node_modules/.bin/magellan --browsers=iphone_9_3_iOS_iPhone_Simulator --create_tunnels
NODE_ENV=android UPLOADAPP=true APP_PATH=path_to_your_app ./node_modules/.bin/magellan --browsers=android_5_1_Linux_Android_Emulator --create_tunnels
Mobile application manual control with existed network tunnel
e.g.: If someone inside the internal network has setup a Sauce Connect tunnel and share the tunnel ID with you, then even if you don't have internal network access, you can still use this tunnel ID to gain the internal network access with your mobile application:
UPLOADAPP=true APP_PATH=path_to_your_app ./node_modules/.bin/magellan --browsers=iphone_9_3_iOS_iPhone_Simulator --sauce_tunnel_id=shared_tunnel_id
NODE_ENV=android UPLOADAPP=true APP_PATH=path_to_your_app ./node_modules/.bin/magellan --browsers=android_5_1_Linux_Android_Emulator --sauce_tunnel_id=shared_tunnel_id
Mobile application manual control with existed network tunnel shared from Sauce Labs parent account
For an complete example of this, please refer to this wiki page.
UPLOADAPP=true APP_PATH=path_to_your_app SAUCE_CONNECT_PARENT_TUNNEL_ID=parent_sauce_labs_username ./node_modules/.bin/magellan --browsers=iphone_9_3_iOS_iPhone_Simulator --sauce_tunnel_id=shared_tunnel_id
NODE_ENV=android UPLOADAPP=true APP_PATH=path_to_your_app SAUCE_CONNECT_PARENT_TUNNEL_ID=parent_sauce_labs_username ./node_modules/.bin/magellan --browsers=android_5_1_Linux_Android_Emulator --sauce_tunnel_id=shared_tunnel_id