Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Steps for web testing using selenium and planterbox

Project description

https://api.travis-ci.org/npilon/planterbox-webdriver.png?branch=master

A suite of steps for planterbox for web testing with Selenium

Usage

  1. Install planterbox and planterbox-webdriver: pip install planterbox planterbox-webdriver

  2. Add a unittest.cfg to your project that enables planterbox:

    [unittest]
    plugins = planterbox
    
    [planterbox]
    always-on = True
    

3. Create a package containing your tests; its __init__.py defines the steps you will have available in your .feature files. This package must be detected by nose2 as containing tests; see nose2’s docs for details.

  1. Add a “before” hook that sets up a webdriver for your tests:

    @hook('before', 'feature')
    def create_webdriver(test):
        from selenium import webdriver
        test.browser = webdriver.Firefox()
    
  2. from planterbox_webdriver.webdriver import * if you want steps that let you find elements in your tests with XPath

  3. from planterbox_webdriver.css_selector_steps import * for steps that let you find elements in your tests with jQuery-style CSS selectors

  4. Add a .feature file in this package containing tests specified using Gherkin. planterbox will turn these into appropriate test case objects and give them to nose to run.

  5. Run your tests: nose2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for planterbox-webdriver, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size planterbox_webdriver-0.4.0-py2.py3-none-any.whl (45.7 kB) File type Wheel Python version any Upload date Hashes View
Filename, size planterbox-webdriver-0.4.0.tar.gz (42.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page