Private Environments
Private Environments
Reflect Tunnel
Our recommended method for testing local and private environments is to use the Reflect Tunnel top application that can be installed on your local machine or in your company’s infrastructure. Reflect Tunnel registers with the Swagger Functional Testing API and establishes a secure, encrypted connection to Swagger Functional Testing’s cloud test infrastructure. When Reflect Tunnel is enabled, all web requests initiated within a Swagger Functional Testing test are proxied through the Tunnel, enabling your tests to access local or private environments that are accessible to the machine that Reflect Tunnel is running on.
Installation
Reflect Tunnel is a native, cross-platform application that can be run on Windows, macOS, or Linux. This feature is available to all Reflect accounts, regardless of usage tier.
Reflect Tunnel can be downloaded via our Downloads page.
Windows and macOS
On Windows and macOS devices, Reflect Tunnel runs as a system tray application. After installing and running Reflect Tunnel application, the application will reside in the system tray through the icon shown below:
macOS:

Windows:

LINUX:
The Linux version of Reflect Tunnel is a binary executable that can be run through the command line or configured to run as a daemon process (such as systemd):
./reflect_tunnel -settings <location-of-settings-file>
Starting the Tunnel
In order for the Reflect Tunnel to act as a proxy for your Swagger Functional Testing tests, you must associate the Tunnel to your Swagger Functional Testing account. This is done by entering your Swagger Functional Testing API Key in the Settings of the Reflect Tunnel.
Your Swagger Functional Testing API key can be found on the Account Information page within the Settings section of Swagger Functional Testing. This is the same API key that is used when invoking the Swagger Functional Testing API directly, or when using one of our CI/CD integrations. If you have not already generated an API Key for your Swagger Functional Testing account, you can do so through the button on this page.
WINDOWS AND MACOS
To link your Reflect Tunnel to your account, click the icon in the system tray > menu bar, and select the Settings option:

This menu option will open a web browser to the Settings view for your Reflect Tunnel:

The Settings view has the following configuration options:
Device Name: This is the name that will be associated with your Tunnel, and is the name that will appear when you choose a Tunnel when creating or running tests within Swagger Functional Testing. By default, this will be set to the device name of your computer.
API Key: This is the linkage between your Tunnel and your Swagger Functional Testing Account. This must match the API Key associated with your Swagger Functional Testing Account.
To connect the Tunnel, click the Enable Reflect Tunnel toggle. If the Tunnel connects successfully, you’ll see that the toggle is set to enabled, a log line will appear stating that the Tunnel is connected, and the system tray icon will be updated to indicate that the Tunnel is connected.
LINUX
To start the Tunnel, you’ll need to first create a JSON file that looks like the following:
{
"deviceName": "Your Tunnel Name",
"apiKey": "your-api-key"
}Pass the location of the settings file to the reflect_tunnel application as a command line argument:
./reflect_tunnel -settings <location-of-settings-file>
When running the command-line application, the tunnel will attempt to connect using the API Key provided in the settings JSON file. If the connection is established successfully, you will see a log line indicating that the connection is successful.
Creating Tests Using the Tunnel
When creating a test within Swagger Functional Testing, the option to route all traffic through a Tunnel is presented via a drop-down list to the right side under Reflect Tunnel > Connect via Tunnel.

Running Tests Using the Tunnel
Running individual tests
When running a test, you can choose to route traffic through a Tunnel by clicking the drop-down list in the upper right corner of the Run Test modal next to the Execute Request button. Select your desired Tunnel.

Running a suite of tests
To run all tests in a test suite via a Tunnel, first select the Suite and click on the Define Environment Settings box within the Workflow settings of the Suite. In the sidebar, choose the Tunnel that you’d like all future executions of this Suite to use:


If you’re invoking a test suite directly through the UI, you’ll also have this same Tunnel option within the Run Suite modal.
Configuring access
The list of all Tunnels connected to your Swagger Functional Testing Account can be viewed by navigating to the Settings section and clicking the Local / Private Environments section from the sidebar.

From this same view, administrators can also disable the Swagger Functional Testing Tunnel feature for your Swagger Functional Testing account by deselecting the toggle next to the ‘Swagger Functional Testing Tunnel’ heading and clicking ‘Save Changes’.
Using a Static IP
An alternative approach to testing private environments is to enable Swagger Functional Testingits Static IP feature for your Swagger Functional Testing account. Some QA or staging environments may be restricted to only allow visitors coming from a specific IP address or set of IPs. By default, Swagger Functional Testing assigns IP addresses to its cloud browsers from a range of dynamic IPs, which means they will not be able to access an IP-restricted environment. To support testing these environments, Swagger Functional Testing can provision a static IP address for your account. This forces all cloud browsers (i.e., recordings and test runs) to egress from Swagger Functional Testing with the same IP address. You can then add this IP address to the list of “allowed” IP addresses in your environment’s network ACL.
Note
Provisioning a static IP for your account is charged as an add-on to your subscription. For more information or to see a demo, contact us at support@reflect.run.