Giter Site home page Giter Site logo

demo-espresso's Introduction

Espresso examples

For Demonstration Purposes Only
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.

Introduction

This repository will hold multiple examples on how to run Espresso tests on the Sauce Labs cloud. This can be on Android Emulators, Sauce Labs Android real devices or both at the same time, see example 8! More information on how to use it can be found below and in each folder.

Prerequisites

  • Please check our documentation for installing SauceCTL
  • Make sure you've set up your credentials on your local machine and or CI-pipeline, see this-doc
  • Check the Espresso-docs for all options

Install saucectl

curl -L https://saucelabs.github.io/saucectl/install | bash

โš ๏ธ Make sure saucectl version is newer than v0.44.0

Apps

A prebuilt native Android application and it's Espresso test cases are included in this repo. Source to this application can be found on GitHub in this folder. The test-classes can be found here.

The application is bundled in mda-1.0.8-10.apk and the tests cases are bundled in mda-androidTest-1.0.8-10.apk.

Examples

All below mentioned examples can be found in the .sauce-folder. You can run the configurations by running the following command from the root of this folder

  saucectl run --config ./.sauce/runner-ex{#}.yml

The # stands for the number of the below mentioned examples.

Example 1 - Minimal configuration for all tests

runner-ex1.yml provides a minimum configuration needed to run the Espresso tests. In this example, all test cases are executed on a single, available device in sequential order.
Espresso - Example 1

Example 2 - Minimal configuration for 2 tests

runner-ex2.yml provides a minimum configuration needed to run the Espresso tests. In this example, there are two test cases executed on a single, available device in sequential order.
Espresso - Example 2

Example 3 - Run each test on its own device

runner-ex3.yml breaks apart the execution of the two test cases such that they can run in parallel on separate devices that are available (ie., not in use) in the pool.
Espresso - Example 3

Example 4 - Run in parallel on hard-coded devices

runner-ex4.yml modifies the second example by specifying which device in the pool to execute each test on. Still uses parallel execution.
Espresso - Example 4

Example 5 - Parallel execution using dynamic devices

runner-ex5.yml uses the deviceNameQuery capability to look for available devices using wildcard names. This example demonstrates the ability to run a specified test(s) on a pool devices that are configured the same but have different names for parallel processing.
Espresso - Example 5

Example 6 - Parallel execution by platform version

runner-ex6.yml uses only the platformVersion field to select an available device. Demonstrates the ability to pick a specific version of Android from the pool of devices for executing tests in parallel.
Espresso - Example 6

Example 7 - Single file test annotation

runner-ex7.yml uses Espresso test annotation. Demonstrates the ability to run four tests based on the @ErrorFlow-annotation in a single class, see here.
Espresso - Example 7

Example 8 - Single execution on Android Emulators and Android Real Devices

runner-ex8.yml runs espresso tests on both Android Emulators AND Android Real Devices.
Espresso - Example 8

Example 9 - Shard all tests over multiple instances

runner-ex9.yml runs espresso all tests on multiple Android Real Devices and Android Emulators by automatically sharding the tests. saucectl automatically creates the sharded jobs for each of the devices defined for the suite based on the number of shards you specify.
Espresso - Example 9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.