A front-end testing framework using Selenium WebDriver and Python
Project description
A front-end testing framework using Selenium WebDriver and Python.
Overview
WebDriver Test Tools provides a framework and utilities for writing front-end functional tests.
Features
Framework for writing cross-browser front-end test suites
Pre-defined test functions for commonly used test procedures
Utilities and extended functionality for the Selenium WebDriver package
Implementation of the Page Object Model with pre-defined page objects for common elements (navbars, forms, etc)
Command line tool for quickly generating files and directories for new test projects
Mobile device layout emulation for responsive tests
Headless browser testing
Support for running tests on BrowserStack
This project uses Selenium WebDriver for automated browser actions and the python unittest library for the test framework, documentation for which can be found below:
Documentation
Full documentation for WebDriver Test Tools:
WebDriver Test Tools Docs: Framework documentation
webdriver_test_tools Package API: Python package API
Set Up
Prerequisites
Python
python 3+
pip
Drivers
In order to use Selenium, drivers will need to be installed for any browser tests will be run on.
Cross-Platform
The following cross-platform browser drivers are supported and enabled by default:
These can be disabled in <test_package>/config/browser.py by commenting out the corresponding line in BrowserConfig.BROWSER_TEST_CLASSES.
Platform-Specific
The following platform-specific drivers are supported:
These need to be enabled in <test_package>/config/browser.py by uncommenting the corresponding line in BrowserConfig.BROWSER_TEST_CLASSES.
The following documentation goes into detail on configuring browsers for testing:
Testing with Additional Browsers: Enabling/disabling browsers, per-test skipping for certain browsers, emulating mobile browsers, and headless browser testing
BrowserStack Support: Enabling and configuring testing on BrowserStack
Installation
The package can be installed using pip:
pip install webdriver-test-tools
Note: Command may be pip3 instead of pip depending on the system.
Creating a Test Suite
The package itself does not contain test cases. To generate files for a new test suite, change into the desired directory and run:
webdriver_test_tools --init
This will generate a new test package with template files and project directories.
The following documentation goes into detail on test projects:
Test Project Overview: Test project setup, configuration, command line usage, and directory structure
Example Test Project: Step-by-step tutorial with a simple example test project
Command Line Usage
webdriver_test_tools
For info on command line arguments:
webdriver_test_tools --help
To initialize a new test project in the current directory:
webdriver_test_tools --init
To print the version number:
webdriver_test_tools --version
Test Projects
Test projects generated using webdriver_test_tools --init have their own set of command line arguments. For detailed information on test project command line usage and additional command line arguments, see the Test Project Overview documentation.
For info on command line arguments:
python -m <test_package> --help
To print a list of available test classes and methods:
python -m <test_package> --list
To run all tests:
python -m <test_package>
To run all test cases in one or more modules:
python -m <test_package> --module <test_module> [<test_module> ...]
To run specific test case classes or methods:
python -m <test_package> --test <TestClass>[.<test_method>] [<TestClass>[.<test_method>] ...]
To skip certain test cases or methods:
python -m <test_package> --skip <TestClass>[.<test_method>] [<TestClass>[.<test_method>] ...]
To do any of the above in specific browsers rather than running in all available browsers:
python -m <test_package> <args> --browser <browser> [<browser ...]
For a list of options you can specify with --browser, run python -m <test_package> --help.
To improve performance, tests can be run in headless browsers using the --headless argument:
python -m <test_package> <args> --headless
For a list of supported drivers, run python -m <test_package> --help. For details on using the --headless argument, see Testing with Additional Browsers.
Contributing
Please read the contributing guidelines for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for webdriver_test_tools-0.29.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 965c9f3cf699a6787d7f5d805c361e743ceeb4a8dd6d261ae06a8fbf532f2185 |
|
MD5 | db94250b3da8667a1538dba527c9f62f |
|
BLAKE2b-256 | 87e4e7216bf0c79b1d8512b172d02ce3ab0d27c3b54250bfd61f1a4703d075d2 |