This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

It's simple way to mock your back-end from webdriver UI tests

Project Description

Bemo(back-end mock) - it’s simple way to mock your back-end from webdriver UI tests.

Installation

Install bemo using pip:

$ pip install bemo

…or install bemo running command below if you want to use Python 2.7:

$ pip install bemo[py2x]

Enjoy!

Usage

from selenium import webdriver
from selene.conditions import text
from selene.tools import set_driver, visit, s

import bemo


wd = webdriver.Firefox()
set_driver(wd)

visit('https://accounts.google.com/SignUp')

with bemo.Session(wd=wd) as session:
    handler = session.handle('InputValidator', body={
        'input01': {
            'Valid': 'false',
            'ErrorMessage': 'Error!',
            'Errors': {
                'GmailAddress': 'It work.',
            },
            'ErrorData': [],
        },
        'Locale': 'ru',
    })
    session.inject()

    s('#GmailAddress').set('John Snow')
    s('#submitbutton').click()

    s('#errormsg_0_GmailAddress').should_have(text('It work.'))

    handler.assert_called_once_with({
        'method': 'POST',
        'url': 'InputValidator?resource=SignUp',
    })

Testing

Just run tox to test package.

License

bemo is licensed under the MIT license. See the license file for details.

Release History

Release History

This version
History Node

0.0.2

History Node

0.0.1

History Node

0.0.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bemo-0.0.2.tar.gz (6.9 kB) Copy SHA256 Checksum SHA256 Source May 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting