This directory contains example scripts and dependencies for the SauceCon workshop: Become an Espresso Barista! SauceCon 19 Workshop. Use these scripts to test your Sauce Labs authentication credentials, setup your automated testing environment, try out Sauce Labs features, and complete the in-class examples. Download the zip file or clone the entire directory to your local environment.
The code in these scripts is provided on an "AS-ISβ basis without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement. These scripts are provided for educational and demonstration purposes only, and should not be used in production. Issues regarding these scripts should be submitted through GitHub. These scripts are maintained by the Technical Services team at Sauce Labs.
These procedures will show you to set up a Android Studio environment. The scripts in this repository allow you run a simple automated test to validate your environment and your saucelabs.com account credentials. In order to complete these exercises you must complete the following prerequisite installation and configuration steps:
- Install Git
- Install JDK
- Install Gradle
- Install Android Studio
- Install and AVD
- Setup Project
Once your test environment is up and running, refer to the exercise guides to begin the exercises.
Git is a version control system that lets you check out code from a repository, work with that code on your own branch, and then merge that code with any changes that have been made by other developers. Git is an essential tool for distributed development teams, and is a critical component of the continuous integration/continuous development toolchain.
- Go to https://git-scm.com/downloads.
- Under Downloads, click Mac OS X.
- When the download completes, double-click the
.dmg
file open the installer package. - Double-click the installer package to begin the installation.
Security Warning
You may see a warning message that the package can't be opened because it's not from a recognized developer. If this happens, go to System Preferences > Security and Privacy Settings, and click Open Anyway.
- Click Continue for the installation, and enter your local password to authorize the installation.
- Go to https://git-scm.com/downloads
- Under Downloads, click on Windows.
- When the dialog opens asking if you want to allow the app to make changes to your device, click Yes.
- Follow the steps in the setup wizard to complete the installation. You should accept all the default settings.
The Java SE Developer Kit lets you develop and deploy Java applications on desktops and servers. It is needed to compile our test code.
- Go to the JDK downloads page, locate the latest release, select the download button.
- Under Java SE Development Kit {version}, select the Accept License Agreement radio button.
- Click the download link for Mac OS.
- When the download completes, double-click the
.dmg
file open the installer package. Double-click the installer package to begin the installation.
- Go to the JDK downloads page, locate the latest release, select the download button.
- Under Java SE Development Kit {version}, select the Accept License Agreement radio button.
- Click the download link for Windows x64.
- When the download completes, double-click the
.exe
file open the installer package. - Double-click the installer package to begin the installation. You should accept all the default settings.
Gradle is a build automation tool used to accelerate your development and deployments. It is needed to compile and build our test code.
- Go to the Gradle Installation page.
- Navigate to the section that reads Install Manually
- Click the download link for the Complete distribution (includes sources and docs).
- Open a Terminal Window and create the following directory:
$ mkdir /opt/gradle
- Extract the
zip
archive into that directory:$ unzip -d /opt/gradle gradle-5.3-bin.zip
- Set the following system-wide environment variable for
gradle
, then reinitialize your bash session:$ export PATH=$PATH:/opt/gradle/gradle-5.3/bin
$ source ~/.bashrc
- Test to ensure the installation worked:
$ gradle -v
Welcome to Gradle 5.3! Here are the highlights of this release: - Feature variants AKA "optional dependencies" - Type-safe accessors in Kotlin precompiled script plugins - Gradle Module Metadata 1.0 For more details see https://docs.gradle.org/5.3/release-notes.html
- Create a new directory in the
C:\
drive calledGradle
.> C:\Gradle
- Go to the Gradle Installation page.
- Navigate to the section that reads Install Manually
- Click the download link for the Complete distribution (includes sources and docs).
- When the download completes, move the
zip
archive intoC:\Gradle
. - Extract the archive using an archive tool of your choice.
- Open a Windows Command Prompt and verify the installation:
> gradle -v
Android Studio is an integrated development environment that incorporates several tools for developing and running Android Applications using Java code. You will be using Android Studio to write and edit the sample scripts used in the exercises. For these exercises you only need to download the free Community edition.
- Go to https://developer.android.com/studio#downloads
- Click the
android-studio-ide-<version>-mac.dmg
download link. - When the download completes, double-click the .dmg file open the installer package.
- Double-click the installer package to begin the installation.
- Drag and drop the Android Studio icon into the Applications folder (if necessary).
- Go to https://developer.android.com/studio#downloads
- Click the
android-studio-ide-<version>-windows.exe
download link. - When the download completes, double-click the
.exe
file to launch the installation wizard. You should accept all the default settings.
> Screenshots are from the OSX installation:
- Open Android Studio and when prompted, select Do not import settings, then OK:
- Next you may see a prompt for updating, follow that process to return to this page, then select Next.
- Select the Standard installation, then click Next.
In order to particiapte in these exercises you must install a supported android emulator on your system. We recommend the Nexus5, API version 7.1.1.
- Open Android Studio.
- Select Tools > AVD Manager:
- At the bottom of the window, select Create Virtual Device:
- In the "Select Hardware" window, select Phone > Nexus 5 (or Nexus 5X):
- Click Next.
- In the "System Image" window, select API Version 7.1.1 (Nougat) and click the Download link:
- Wait for the component to install and click Finish:
- Select the API Version 7.1.1 (Nougat) then click Finish:
- The device should appear as an option in the "Your Virtual Devices" window:
- Open Android Studio
- Select Import project (Gradle, Eclipse ADT, etc.):
- When prompted select the root directory of
saucecon19-espresso-workshop
- Android Studio should open and begin downloading the components (via
gradle
): - After some time, Android Studio begins to setup the project build. Wait for this completion notice in the console: