Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <file_to_upload>"
exit -1
fi
FILE=$1
filename=$(basename $FILE)
curl -u $SAUCE_USERNAME:$SAUCE_ACCESS_KEY -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/${SAUCE_USERNAME}/${filename}?overwrite=true --data-binary @${FILE}

Configure Sauce Connect for Mobile

  1. Confirm with your Firewall and Proxy teams that the list of IP ranges specified in [1] are opened on the corporate side. I would imagine they were done at the time when Desktop was implemented, but it’ll save a lot of head scratching to confirm in advance.

  2. In parallel with Step 1, you’ll need to download the Sauce Connect executable (also found in [1]). You’ll need to make sure that wherever you run it from, it’ll have network access to #1 above.

  3. I’ve attached a sample Sauce Connect config file specifically for mobile. Be sure to tweak it to match your environment, specifically the tunnel-domains entry to tunnel your corporate traffic.

@billmeyer
billmeyer / README.md
Last active December 17, 2019 04:14
Command Line Selenium Session

Create the Session

NOTE: Be sure to set the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables first!

    curl -v -u ${SAUCE_USERNAME}:${SAUCE_ACCESS_KEY} \
        https://ondemand.saucelabs.com/wd/hub/session -X POST \
        -d '{"desiredCapabilities": {"browserName":"firefox"}}' | jq "."
@billmeyer
billmeyer / Opening the Web Inspector to Debug Applications in the iOS Simulator.md
Last active January 28, 2020 14:20
Opening the Web Inspector to Debug Applications in the iOS Simulator/Mobile Safari
  1. Launch a manual session with the iOS simulator of your choice.
  2. In the manual session, open Safari (desktop). To do this:
  3. Click outside the simulator, activating Finder.
  4. Select File in the menu → New Finder Window.
  5. Select ApplicationsSafari and open it.
  6. Check to see if Develop is in the menu for Safari. If it isn't:
  • Select SafariPreferences.
  • Go to the Advanced tab, and check the box at the bottom to turn ON the develop menu.
  • Check to see if the web inspector is active for the iOS Simulator (it should be enabled by default):
  • Select Settings (for iOS Simulator) → SafariAdvanced (scroll to the bottom of the settings page) &arr; Turn on web inspector.

Setup

  1. Copy the files attached to this Gist and place them in their respective directories:

  2. Be sure to changes the permissions on /root/sauceconnect/*.yml to user readable:

    $ sudo chmod 600 /root/sauceconnect/*.yml

and that the file is owned by root:

Start the tunnels

  1. Set environment variables needed by Sauce Connect:
  • SAUCE_USERNAME
  • SAUCE_ACCESS_KEY
  1. In Terminal 1:
@billmeyer
billmeyer / README.md
Last active July 30, 2020 18:04
Sauce Connect for Real Device *LIVE* Testing

Starting Sauce Connect for Real Device LIVE Testing

NOTE: These instructions only apply to Real Device LIVE Testing. For Live Desktop, Automated Desktop, Automated Emulator, Automated Simulator, and Automated Real Device testing, a separate Sauce Connect instance is needed. Reference this Gist for details: https://gist.github.com/billmeyer/5cdb1ff770b0552ef0e49c49ba122d47.

Get started by downloading the Sauce Connect executable from https://wiki.saucelabs.com/display/DOCS/Downloading+Sauce+Connect+Proxy.

See https://wiki.saucelabs.com/display/DOCS/System+and+Network+Requirements+for+Sauce+Connect+Proxy for network-specific requirements.

Prerequisites

@billmeyer
billmeyer / README.md
Last active August 17, 2020 15:46
Sauce Connect for Desktop/Emulator/Simulator and Real Device *AUTOMATED* Testing

Add and Remove user from group on macOS

Procedure

Add user ernie to group _www.

sudo dseditgroup -o edit -a ernie -t user _www
@billmeyer
billmeyer / README.md
Last active December 30, 2020 11:20
Setting PROXY variables for Go apps

Set https_proxy in Mac OS or Linux

To set the https_proxy environment variable in Mac OS or Linux:

Use the command specific to your shell. For example, in bash, use the export command, as in the example below:

export https_proxy=http://my.proxyserver.com:8080