Skip to main content

WonderProxy Integration

You can use Sauce Labs and WonderProxy's global network to test your geoIP websites and applications.

Overview

WonderProxy provides a global network of proxy servers that you can use to ensure that your localized applications are behaving properly around the world. With Sauce Labs and WonderProxy, you can run your geoIP testing through all of the browser-operating system-hardware combinations that you care about, from all of the locales that you care about.

What You'll Need

info

At WonderProxy, proxy tokens replace passwords in your server credentials. Proxy tokens are quick to generate and work instantly across the network. Generate one (or five), and then use them anywhere your proxy configuration asks for a password.

Proxy tokens are part of our Delegated Authentication system.

Automated Testing with Sauce Labs and WonderProxy

If you use Playwright for your automated end-to-end tests, you can use saucectl and WonderProxy to add multi-platform localization tests.

The code samples and setup instructions below use a working demo in GitHub that runs sample tests against the WonderNetwork GeoTest page.

Step 1: Set Up saucectl

  1. Install saucectl.
  2. Export your SAUCE_USERNAME, SAUCE_ACCESS_KEY, and WonderProxy credentials as environment variables:
export SAUCE_USERNAME="yourSauceUsername"
export SAUCE_ACCESS_KEY="the-access-key-from-your-account"
export WONDERPROXY_USER="wonderProxyUsername"
export WONDERPROXY_TOKEN="wonderProxyProxyToken"

Step 2: Configure saucectl For Your tests

You can use WonderProxy's sample saucectl configuration file to run a localized Playwright test suite on two platforms: Firefox on Windows and Chrome on Mac.

The configuration file is formatted with YAML. You can specify the type of tests to run with the kind property, and create test suites for each platform with the suites property:

kind: playwright
suites:
- name: "Firefox on Windows 10"
platformName: "Windows 10"
testMatch: ['.*.js']
params:
browserName: "firefox"
- name: "Chromium on Mac 11"
platformName: "mac 11.00"
testMatch: ['.*.js']
params:
browserName: "chromium"

To create your own custom configuration, you can use saucectl init. For more information, see Configure saucectl for your Tests.

Step 3: Write Your Tests

You can use the sample tests in Step 3: Write tests, with localization testing through WonderProxy locations.

You don't need to add any Sauce-specific code to your test, and you also don't need to install Node.js or any npm packages on your local system.

Step 4: Run Your Tests

saucectl will upload your tests to Sauce Labs and run them against the configured platforms. Pass your WonderProxy credentials as environment variables, so they'll be available to the tests in the Sauce Labs cloud.

$ saucectl run --env WONDERPROXY_USER="$WONDERPROXY_USER" --env WONDERPROXY_TOKEN="$WONDERPROXY_TOKEN"

The sample code has 6 tests (2 tests per location, 3 locations). saucectl will track the test progress, and provide links to the Automated Test Results page in Sauce Labs where you can see live video and see the results.

09:00:43 INF Starting suite. region=us-west-1 suite="Firefox on Windows 10"
09:00:43 INF Starting suite. region=us-west-1 suite="Chromium on Mac 11"
09:00:46 INF Suite started. browser=chromium platform="mac 11.00" suite="Chromium on Mac 11" url=https://app.saucelabs.com/tests/[test id]
09:00:47 INF Suite started. browser=firefox platform="Windows 10" suite="Firefox on Windows 10" url=https://app.saucelabs.com/tests/[test id]
09:00:53 INF Suites in progress: 2
09:01:03 INF Suites in progress: 2
09:01:18 INF Suite finished. passed=true suite="Chromium on Mac 11" url=https://app.saucelabs.com/tests/[test id]
09:01:21 INF Suite finished. passed=true suite="Firefox on Windows 10" url=https://app.saucelabs.com/tests/[test id]

Results:


Name Duration Status Browser Platform Attempts
───────────────────────────────────────────────────────────────────────────────────────────────────────
✔ Chromium on Mac 11 33s passed chromium 101 mac 11.00 1
✔ Firefox on Windows 10 34s passed firefox 97 Windows 10 1
───────────────────────────────────────────────────────────────────────────────────────────────────────
✔ All tests have passed 38s

Build Link: https://app.saucelabs.com/builds/vdc/[build id]