*Testing via MagicPodConnect (Secure tunneling feature) can be used by customers with an enterprise plan agreement.
This page describes how to use the client software called MagicPodConnect to carry out tests in environments that cannot be accessed from the internet, such as in-house environments.
Introduction
- For more general information on testing private environments, see Test in private environments.
Table of contents
Overview of testing with MagicPodConnect
How MagicPodConnect works
MagicPodConnect is a feature that enables access to in-house environments when creating and executing tests in MagicPod's cloud environment. Note that MagicPodConnect is not associated with local PC environments or external cloud environments.
The basic mechanism involves launching the MagicPodConnect client software on a machine with access to the in-house environment and connecting to MagicPod, establishing a two-way connection and allowing communication from cloud devices (including browsers). This mechanism enables connections to test environments that are not accessible from the internet.
Advantages of using this feature
Without MagicPodConnect, a local PC environment is typically the choice for testing in an in-house environment, whereas with MagicPodConnect a cloud environment can be utilized. There are two main advantages to using a cloud environment.
- Ease of setup: Testing iOS and Android on a local PC requires setting up numerous tools in addition to a MagicPod account, incurring significant management costs. Whereas with a cloud environment, users only need a browser to access MagicPod on their PC, making it much easier to start creating and running tests.
- Improved convenience in test creation: In addition, a cloud environment also allows users to use the Real-time simple tests feature, which makes test creation smoother than taking screen captures one by one locally and returning to the edit screen in MagicPod.
Supported environments
- Test execution environment: Supports all platforms operational in a cloud environment.
- iOS (Simulator)
- Android (Emulator)
- Browsers (Chrome, Edge, Firefox)
- Client environment (where MagicPodConnect is launched): Supports the following major operating systems.
- Windows
- macOS
- Linux
Usage requirements
- Plan: Enterprise only
- Scope of shared connections: Limited within the project. Connections from different projects within the same organization cannot be used. Within the same project, it is possible to simultaneously use one connection for multiple purposes, such as using one device for test creation and three devices for batch run. However, considering the load, it is recommended to limit to around five devices per connection.
- Limit on number of connections: None. Since MagicPodConnect is used in combination with cloud devices, the maximum number of cloud devices effectively becomes the maximum number of MagicPodConnect connections.
- Restrictions on connection destinations: Connections can be made to any locations that can be accessed from the machine where MagicPodConnect is running, including in-house environments. However, currently localhost and 127.0.0.1 cannot be specified as the destination. To access a server on local machine, use a local IP address such as 192.168.1.10 or configure the hosts file by adding an arbitrary domain which should be resolved as a local machine. The same configuration is required to connect to the local server via the "Web API call" command as well, other than connecting from web pages or mobile apps. Especially the "Web API call" limits the available domains, so please configure to make the domain end with ".test".
127.0.0.1 myserver.test
How to use
Download MagicPodConnect
The latest version of MagicPodConnect can be downloaded from this page. Download the zip file corresponding to your OS (Mac, Windows or Linux), then unzip it for use.
Prepare the configuration file
Before launching MagicPodConnect, it is necessary to prepare a configuration file for the connection.
Create a file named "magicpodconnect.yml" in the same folder as MagicPodConnect and configure it as outlined below. You must configure the sections within "<>" to match your specific environment. Each of these items will be explained subsequently.
token: <MAGICPOD_API_TOKEN>
organization: <ORGANIZATION_NAME>
project: <PROJECT_NAME>
allowedDomains:
- <YOUR_LOCAL_DOMAIN1>
- <YOUR_LOCAL_DOMAIN2>
- ...
magicPodConnectId: <CONNECTION_ID>
logLevel: info
forceCreate: true
proxyServerUrl:
proxyServerAuthType: none
proxyServerAuthUser:
proxyServerAuthPassword:
Key | Required | Description | Default value |
token | ✅ | Specify the token for using MagicPod's API. The token value can be copied from the API token screen. | The value of the environment variable MAGICPOD_API_TOKEN |
organization | ✅ | Specify the organization name where you create and execute tests. | The value of the environment variable MAGICPOD_ORGANIZATION |
project | ✅ | Specify the project name where you create and execute tests. | The value of the environment variable MAGICPOD_PROJECT |
allowedDomains | ✅ | Specify a list of domains or the IP addresses accessible via MagicPodConnect (more details below) | - |
magicPodConnectId | Specify an alphanumeric ID to distinguish between multiple MagicPodConnect connections. If not specified, a random value will be automatically set. | The value of the environment variable MAGICPODCONNECT_ID | |
logLevel | Specify the level of detail of MagicPodConnect's output logs. You can choose these values: trace, debug, info, notice, warning, error, critical. | info | |
forceCreate | If a connection with the same magicPodConnectId already exists, specify 'true' to delete the existing connection and create a new one. | ||
proxyServerUrl | Specify this when using MagicPodConnect in a proxy environment (more details below). | ||
proxyServerAuthType | Specify this when using MagicPodConnect in a proxy environment (more details below). | ||
proxyServerAuthUser | Specify this when using MagicPodConnect in a proxy environment (more details below). | ||
proxyServerAuthPassword | Specify this when using MagicPodConnect in a proxy environment (more details below). | ||
proxyExcludedDomains | Specify this when using MagicPodConnect in a proxy environment (more details below). |
The basic configuration will look as follows:
token: ${MAGICPOD_API_TOKEN}
organization: SampleCompany
project: SampleProject
allowedDomains:
- example.com
- 192.168.1.19
Use environment variables
Specify an environment variable for each item as described in the example. This is particularly useful for avoiding direct specification of tokens in shared environments, such as CI systems. The format for environment variables is either $VAR_NAME or ${VAR_NAME}, and this applies to all OS (including Windows).
Specify the required item "allowedDomains"
Connecting through MagicPodConnect significantly relaxes the security of the in-house environment, therefore only pre-specified connections are allowed. For example, if you wish to connect to certain in-house test environments but not to an employee portal, only the former should be specified.
As shown in the example, you can specify multiple domains and IP addresses for allowedDomains. While wildcards (using "*" to match all characters) are now allowed for domain names, subdomains of the specified domains are implicitly permitted. For instance, in the example above, along with "example.com", subdomains as "test.example.com" and "staging.example.com" are also allowed.
If allowedDomains are not specified, MagicPodConnect will deny all connections. For testing domains that are internet-accessible and do not require MagicPodConnect, you can configure them not to use MagicPodConnect. This method will be described later.
Launch MagicPodConnect
Once the configuration file is prepared, run the downloaded and unzipped MagicPodConnect from the command line. This process is basically the same on any OS, but here is an example command on Linux.
./MagicPodConnect
After launching, if you see the established connection information displayed as below, you're good to go. In this instance, since we didn't specify the magicPodConnectId, the part "00ea1067-c980-44fd-b4cd-fb5ae2edca97" is automatically generated and serves as the connection ID (MagicPodConnectID).
[xxxx-xx-xx xx:xx:xx.xxx - INFO] Started MagicConnect (MagicPodConnect ID=00ea1067-c980-44fd-b4cd-fb5ae2edca97) for <ORGANIZATION_NAME>/<PROJECT_NAME>
Test creation and execution
To create and execute tests using MagicPodConnect, configure the following settings in the Advanced settings tab of the test settings panel:
- MagicPodConnect: Use self-launched instance
- MagicPodConnect ID: Specify either the above automatically generated or a pre-specified MagicPodConnect ID
- Target domains: Specify domains and/or IP addresses you wish to connect via MagicPodConnect. Ideally, these should match those listed in the 'allowedDomains' section above.
About MagicPodConnect ID
If only one MagicPodConnect is running for a project, you can use an already activated connection without specifying a MagicPodConnect ID. However, other users may unknowingly start another connection or use an existing connection without knowing it, so it is generally better to specify a value (Only users with "Test case update" priviledges for the project can launch or use MagicPodConnect connections, so it cannot be used by unauthorized users).
About target domains
Even with MagicPodConnect enabled, connections to destinations not specified in "target domains" will be made through the internet. Please ensure to specify in the "target domains" and "allowedDomains" of the magicpodconnect.yml configuration file, only those destinations that require private access.
Once set up, start the device using the Launch button for test creation and the Run new batch for batch execution.
Use MagicPodConnect in a proxy environment
When using MagicPodConnect from a machine that connects to the internet through a proxy, additional settings are required. Currently, MagicPodConnect supports two types of proxies:
- Proxy without authentication
- Proxy that requires Basic authentication
You can configure the proxy settings in the configuration file. Below is an example for using Basic authentication. If no authentication is needed, simply specify the 'proxyServerUrl'.
proxyServerUrl: <PROXY_SERVER_URL>
proxyServerAuthType: basic
proxyServerAuthUser: <USER>
proxyServerAuthPassword: <PASSWORD>
When you want to exclude specific domains from the proxy, please specify domains under "proxyExcludedDomains" like below. Like "allowedDomains", subdomains of the specified domains are also execluded.
allowedDomains:
- example.com
proxyServerUrl: <PROXY_SERVER_URL>
proxyExcludedDomains:
- exclude.example.com
Advanced options for MagicPodConnect
You can check a list of parameters that can be specified for MagicPodConnect using the following command.
./MagicPodConnect -h
NAME:
MagicPodConnect - Enables MagicPod testing within local testing environment
USAGE:
flags [global options] command [command options] [arguments...]
VERSION:
1.5.0.1
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--config value, -c value (Optional) The path to the configuration file. (default: "magicpodconnect.yml")
--help, -h show help
--version, -v print the version
--config, -c
If you want to use a configuration file other than "magicpodconnect.yml" that's in the same folder as MagicPodConnect, you can specify the path of the configuration file using this option.