4DvAnCeBoY / demo-python

A repository containing all Python examples for Sauce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Demonstration Scripts

CircleCI

This repository contains example scripts and dependencies for running automated Selenium tests on Sauce Labs using Python. You can use these scripts to test your Sauce Labs authentication credentials, setup of your automated testing environment, and try out Sauce Labs features.

Disclaimer

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.

Some examples in this repository, such as appium-examples and headless-examples, may require a different account tier beyond free trial. Please contact the Sauce Labs Sales Team for support and information.


Solution Outline


Prerequisites

In order to complete these exercises you must complete the following prerequisite installation and configuration steps:

Detailed Instructions located in the prerequisites file.

*NOTE: All code here is written in Python 3, and is not guaranteed to work with Python 2. It is strongly, strongly recommended you either migrate to Python 3.5+ if you are using Python 2, or get started using Python 3.5+.

Try Demo in Gitpod

Select the button below to try this demo in Gitpod

Open in Gitpod

After the gitpod session launches, navigate to the terminal and run the following commands to save your Sauce Labs Credentials to gitpod as environment variables:

eval $(gp env -e SAUCE_USERNAME=******)
eval $(gp env -e SAUCE_ACCESS_KEY=******)

Click the following link if you're unsure how to access your Sauce Labs credentials. Also, if you start a new terminal in gitpod, you have to run the following command to reset envrionment variables:

eval $(gp env -e)

For more information consult the gitpod documentation


Run the Onboarding Scripts

If you would like to get started with using Python and Sauce Labs with some guidance, please look at the Onboarding scripts provided in the on-boarding-modules directory.


Run the Sauce Examples

In addition to onboarding, we have also included some samples of using Sauce Labs with some common Python test tools. In particular, we have examples using

  • Pytest
  • Robotframework

and these cover using

  • Sauce Labs Virtual Device Cloud (VDC), which includes desktop browsers and emulator/simulator devices (EMUSIM)
  • Sauce Labs Real Device Cloud (RDC).

These samples are executed using Pipenv for simplicity. You can find a list of available executions in the Pipfile for executing tests written in the test tools. These executions demonstrate how to run tests in parallel on the various Sauce Labs platforms.

The organization of these samples are as follows:

-- driver (appium or selenium) 
   |- test tooling
      |- test environment (virtual or real devices)
         |- additional resources needed (if any)
            |- sample test framework

For example, to run tests with pytest:

sudo pip install pipenv
pipenv install
pipenv run pytest-vdc-us

About

A repository containing all Python examples for Sauce

License:MIT License


Languages

Language:Python 83.2%Language:RobotFramework 14.8%Language:Shell 1.8%Language:Dockerfile 0.2%