Skip to content

ganeshk905/Python-Pytest-Nerodia

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-Pytest-Nerodia

This is a sample of how to use Pytest and Nerodia with Sauce Labs for browser-based testing. These tests make use of basic e-commerce app, Swag Labs, for purchasing various items of swag.

Note: This code has only been tested with Python 3 and not been rigorously tested against Python 2.7.

This code 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. Your tests and testing environments may require you to modify this framework. Issues regarding this framework should be submitted through GitHub. For questions regarding Sauce Labs integration, please see the Sauce Labs documentation at https://wiki.saucelabs.com/. This framework is not maintained by Sauce Labs Support.

Environment Setup

  1. Global Dependencies

    $ brew install python
    
    • Install pip for package installation
  2. Sauce Credentials

    • In the terminal export your Sauce Labs Credentials as environmental variables:
    $ export SAUCE_USERNAME=<your Sauce Labs username>
    $ export SAUCE_ACCESS_KEY=<your Sauce Labs access key>
    
  3. Project

    • The recommended way to run your tests would be in virtualenv. It will isolate the build from other setups you may have running and ensure that the tests run with the specified versions of the modules specified in the requirements.txt file.

    • Create a virtual environment in your project folder the environment name is arbitrary. $ python3 -m venv ./venv

    • Activate the environment: $ source venv/bin/activate

    • Install the required packages: $ pip install -r requirements.txt

Running Tests: -n option designates number of parallel tests and -s to disable output capture.

  • Tests in Parallel: $ py.test -s -n 6

Sauce Labs Dashboard

Advice/Troubleshooting

There may be additional latency when using a remote webdriver to run tests on Sauce Labs. Timeouts or Waits may need to be increased. * Selenium tips regarding explicit waits

Resources

  • A great resource to search for issues not explicitly covered by documentation.

About

A sample framework for using Pytest, Nerodia and Sauce Labs for browser testing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%