Skip to content

Latest commit

 

History

History
262 lines (211 loc) · 23.2 KB

python-test-automation.md

File metadata and controls

262 lines (211 loc) · 23.2 KB

Python test automation

A comprehensive curated list of python test automation frameworks, tools, libraries and software to help software engineers easily bootstrap test automation on python.

Have questions\issues\problems, join the chat at https://gitter.im/atinfo/awesome-test-automation

Table of content:

Also:


xUnit frameworks

  • frameworks
    • unittest - is a library to make unit testing distributed with python out of the box.
    • unittest2 - is a backport of the new features added to the unittest testing framework in Python 2.7 and onwards.
    • pytest - is a mature full-featured Python testing tool that helps you write better programs.
    • nosetests - is a nicer testing for python.
    • slash - is a testing framework written in Python.
  • extensions
    • proboscis - is a Python test framework that extends Python’s built-in unittest module and Nose with features from TestNG.
    • grail - is a library which allows test script creation based on steps.
    • testify - unit test framework, provides Enhanced test fixture setup, Split test suites into buckets for easy parallelization, PEP8 naming conventions & Fancy color test runner with lots of logging / reporting option.
    • trial - Extension of unittest to support writing asynchronous unit tests using Deferreds and new result types ('skip' and 'todo'). Includes a command-line program that does test discovery and integrates with doctest and coverage.
    • subunit - Transparently adds support for running unittest test cases/suites in a separate process : prevents system wide changes by a test destabilising the test runner. It also allows reporting from tests in another process into the unittest framework, giving a single integrated test environment.
    • testresources - Provides a mechanism for managing 'resources' - expensive bits of infrastructure - that are needed by multiple tests. Resources are constructed and free on demand, but with an optional TestSuite?, the test run order is optimised to reduce the number of resource constructions and releases needed. Compatible with unittest.
    • testtools - Useful extensions to unittest derived from custom extensions by projects such as Twisted and Bazaar.
    • Sancho - Sancho 2.1 runs tests, and provides output for tests that fail; Sancho 2.1 does not count tests passed or failed; targets projects that do not maintain failing tests
    • zope.testing - Powerful test runner that includes support for post-mortem debugging of test failures. Also includes profiling and coverage reporting. This is a standalone package that has no dependencies on Zope and works just fine with projects that don't use Zope.
    • pythoscope - Tool that will automatically, or semi-automatically, generate unit tests for legacy systems written in Python.
    • testlib - Gives more power to standard unittest. More assert* methods; support for module level setup/teardown; skip test feature...
    • dutest - An object oriented interface to retrieve unittest test cases out of doctests. Hides initialization from doctests by allowing setUp and tearDown for each interactive example. Allows control over all the options provided by doctest. Specialized classes allow selective test discovery across a package hierarchy.
    • green - Green is a clean, colorful test runner for Python unit tests. Compare it to nose or trial.
    • ddt - Data-Driven tests with unittest

TDD \ ATDD \ BDD

  • BDD
    • behave - BDD tool
    • lettuce - BDD tool
      • lettuce-tools - Lettuce Tools are a set of tools and utilities that extend the lettuce out of the box features fill some of the gaps detected in the projects.
    • contexts - Descriptive testing for Python.
    • mamba - The definitive testing tool for Python. Born under the banner of Behavior Driven Development.
    • pyvows - Asynchronous behaviour driven development for Python.
    • robotframework - A generic test automation framework for acceptance testing and acceptance test-driven development (ATDD)
    • radish-bdd - BDD testing tool with supplements
  • Assertions
    • pyshould - Should style asserts based on pyhamcrest.
    • pyhamcrest - Hamcrest matchers for Python.
    • sure - A testing library for python with powerful and flexible assertions.
  • Mocking
    • mock - A Python Mocking and Patching Library for Testing.
    • Ludibrio - Elegant test doubles framework in Python (mocks, stubs, spy, and dummies).
    • responses - A utility library for mocking out the requests Python library.
    • doublex - Powerful test doubles framework for Python.
    • freezegun - Travel through time by mocking the datetime module.
    • httpretty - HTTP request mock tool for Python.
    • httmock - A mocking library for requests for Python 2.6+ and 3.2+.
    • pretenders - fake servers for testing.
    • mock-server - Simple mock server for REST and XML-RPC API with admin panel based on tornado.
    • VCR.py - Automatically mock your HTTP interactions to simplify and speed up testing.

Test Data manipulation

  • faker - A Python package that generates fake data.
  • fake2db - Fake database generator.
  • ForgeryPy - An easy to use forged data generator for Python. It's a port of forgery.
  • radar - Generate random datetime / time.
  • robotframework-faker - Robot Framework wrapper for faker.
  • hypothesis - Library for property based testing in Python, based on the Haskell library Quickcheck.

Code analysis

  • pysonar2 - A type inferencer and indexer for Python.
  • coverage - Code coverage measurement
  • pycallgraph - A library that visualises the flow (call graph) of your Python application.
  • Flake8 - The modular source code checker: pep8, pyflakes and co.
  • pylama - Code audit tool for Python and JavaScript.
  • Pylint - A source code analyzer.
  • hacking - OpenStack Hacking Style Checks (flake8 plugins).

Web UI test automation

  • libraries
    • selenium webdriver - Browser automation tool.
    • splinter - A tool for test web applications with a simple for find elements, form actions, and others browser actions.
    • mechanize - Stateful programmatic web browsing in Python.
  • frameworks and wrappers
    • py.saunter - An opinionated automation framework for use with the Selenium RC and WebDriver libraries.
    • moz-web-qa - A plugin for py.test that provides additional features needed for Mozilla's WebQA projects.
    • testutils sst - A web test framework that uses Python to generate functional browser-based tests.
    • wtframework - Framework for configurable Web Tests in Python.
    • holmium.core - Page objects & Utilities for writing selenium test cases.
    • robotframework-selenium2library - Web testing library for Robot Framework.
    • gocept.selenium - An API for the Selenium remote control that is suited for writing tests and integrates this with your test suite for any WSGI, Plone, Zope 2, ZTK, or Grok application.
    • webium - A Page Object pattern implementation library for Python
    • robotframework-anywherelibrary - A cross platform(desktop browser,android,ios) testing library for Robot Framework that leverages the Selenium 2(WebDriver) libraries internally to control a web browser and appium as mobile test automation framework for use with native and hybrid app.
    • robotframework-pageobjects - Nice implementation of the Page Object pattern with robotframework and selenium, that can work even outside of robotframework. More on this blog post
    • elementium - jQuery-style syntactic sugar for highly reliable automated browser testing in Python
    • slickqa - The slick-webdriver-python project is a wrapper around the python webdriver client bindings.
    • selene - Concise UI tests in Python + Ajax support + PageObjects + Widgets
    • hitch - A high level integration testing framework for service based applications.
  • extensions
    • pytest_splinter - pytest spinter and selenium integration for anyone interested in browser interaction in tests.
    • lettuce_webdriver - Selenium webdriver for lettuce.
    • Browsermob Proxy - A python wrapper for Browsermob Proxy.
    • FireRobot - A Firefox extension that allows you to create Robot Framework/Selenium tests, in a more efficient way.
    • pytractor - Python selenium extensions for testing angular.js apps
    • Selenium-Requests - Extends Selenium WebDriver classes to include the request function from the Requests library, while doing all the needed cookie and request headers handling.

Mobile test automation

  • appium - An open source test automation framework for use with native, hybrid and mobile web apps. It drives iOS and Android apps using the WebDriver protocol.
  • Winium.StoreApps - An open source test automation tool for Windows Store apps, tested on emulators. It is Selenium Remote WebDriver implementation.
  • robotframework-androidlibrary - A Robot Framework test library for all your Android automation needs.
  • robotframework-appiumlibrary - An appium testing library for RobotFramework.
  • robotframework-ioslibrary - A Robot Framework test library for all your iOS automation needs.
  • uiautomator - Python wrapper of Android uiautomator test tool, it works on Android 4.1+ simply with Android device attached via adb.

Windows UI test automation

  • Winium.Desktop - An open source test automation tool for automated testing of Windows application based on WinForms and WPF platforms. It is Selenium Remote WebDriver implementation.
  • PyAutoGUI - A cross-platform module for GUI automation for human beings. Control the keyboard and mouse from a Python script.
  • robotframework-autoitlibrary - A Windows GUI testing library for Robot Framework
  • autopy - A simple, cross-platform GUI automation toolkit for Python.
  • UISoup - This library supports UI-related testing using Python on Windows and Mac OS. (Only Python x86 is supported)
  • pywinauto - Very pythonic object-oriented Windows GUI automation library. Now it supports 64-bit Py2 and Py3.

Unix \ Linux UI test automation

  • ldtp - Cross Platform Linux Desktop (GUI Application) Testing Project.
  • fMBT - Python libraries for multiplatform GUI testing.

MacOS UI test automation

  • PyAutoGUI - A cross-platform module for GUI automation for human beings. Control the keyboard and mouse from a Python script.
  • ATOMac - Python library to fully enable GUI testing of Mac applications via the Apple Accessibility API

REST API Testing

  • Rester - Framework for testing (RESTful) HTTP APIs
  • pyresttest - A REST testing and API microbenchmarking tool
  • siesta - Python REST Client

Virtual environments

  • virtualenv - A tool to create isolated Python environments.
  • virtualenvwrapper - A set of extensions to Ian Bicking’s virtualenv tool.
  • tox - A generic virtualenv management and test command line tool to test code on different python versions.
  • PyVirtualDisplay - A python wrapper for Xvfb, Xephyr and Xvnc for GUI testing and\or automatic GUI screenshot.
  • pew - A set of tools to manage multiple virtual environments.
  • Vex - Run a command in the named virtualenv.
  • PyRun - A one-file, no-installation-needed version of Python.
  • pyenv - Simple Python version management.
  • Tapper - all-embracing test infrastructure.

Performance & stress & load

  • Multi-Mechanize - An open source framework for performance and load testing.
  • locust - Scalable user load testing tool written in Python.
  • Yandex.Tank - Load and performance benchmark tool.
  • pytest-benchmark - A py.test fixture for benchmarking code.
  • Airspeed Velocity - A simple Python benchmarking tool with web-based reporting
  • The Grinder - Load testing framework that makes it easy to run a distributed test using many load injector machines. This includes common cases such as HTTP web servers, SOAP and REST web services, and application servers (CORBA, RMI, JMS, EJBs), as well as custom protocols. Flexible Scripting Test scripts are written in the powerful Jython and Clojure languages.
  • Tsung - is an open-source multi-protocol distributed load testing tool. It can be used to stress HTTP, WebDAV, SOAP, PostgreSQL, MySQL, LDAP and Jabber/XMPP servers.
  • taurus - Automation-friendly framework for Continuous Testing

Security checking

  • sparta - A GUI application which simplifies network infrastructure penetration testing by aiding the penetration tester in the scanning and enumeration phase.
  • OWASP ZAP - An API for the usage of OWASP ZAP-features from a Python-script.

Continuous Integration

  • buildbot - A system to automate the compile/test cycle required by most software projects to validate code changes.
  • jenkins - An extensible open source continuous integration server.
  • travis-ci - Free Hosted Continuous Integration Platform.

Reporting

  • allure pytest - Allure adapter for PyTest framework.
  • HTMLTestRunner - An extension to the Python standard library's unittest module. It generates easy to use HTML test reports.
  • unittest-xml-reporting - A unittest test runner that can save test results to XML files that can be consumed by a wide range of tools, such as build systems, IDEs and continuous integration servers.

Documentation generation

  • Sphinx - Python Documentation generator.
  • MkDocs - Markdown friendly documentation generator.
  • Pycco - The original quick-and-dirty, hundred-line-long, literate-programming-style documentation generator.

Editors, IDE, consoles

  • pycharm - Smart code editor provides first-class support for Python
  • pydev - Full featured python ide based on eclipse
  • sublime - A sophisticated text editor for code, markup and prose.
  • ipython - A command shell for interactive computing in multiple programming languages, originally developed for the Python programming language

Useful libs

Libraries that may help you to build better test automation.

  • requests - An Apache2 Licensed HTTP library, written in Python, for human beings.
  • WebTest - WebTest helps you test your WSGI-based web applications.
  • lxml - Most feature-rich and easy-to-use library for processing XML and HTML in the Python language.
  • suds - A lightweight SOAP python client for consuming Web Services.
  • fabric - A Python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.
  • BeautifulSoup - Package for parsing HTML documents (including having malformed markup, i.e. non-closed tags, so named after Tag soup). It creates a parse tree for parsed pages that can be used to extract data from HTML, which is useful for web scraping.
  • Soupy - It is a wrapper around BeautifulSoup that makes it easier to build complex queries when wrangling web data.
  • waiting - python utility library for waiting for predicates.
  • Comcast - simulating shitty network connections so you can build better systems.
  • dateutil - Extensions to the standard Python datetime module.
  • python-tesseract - Wrapper class for tesseract OCR (Linux & Mac & Windows)
  • pywinrm - A Python client for Windows Remote Management (WinRM). This allows you to invoke commands on target Windows machines from any machine that can run Python. WinRM allows you to call native objects in Windows. These include, but are not limited to, running batch scripts, powershell scripts and fetching WMI variables. For more information on WinRM, please visit Microsoft's WinRM site.
  • fig - Fast, isolated development environments using Docker.
  • gitapi - Pure-Python API for git.
  • Pyro4 - Pyro enables you to build applications in which objects can talk to each other over the network, with minimal programming effort.

Resources

Where to discover new libraries, information, tools, etc.

Websites

Other Awesome Test Automation Lists

Your contributions are always welcome!