Skip to main content

bemo Requirements Status Build Status Code Health PyPI Supported Python versions

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.

Metadata

Release files for bemo 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bemo 0.0.2
File Size Uploaded Provenance Actions
bemo-0.0.2.tar.gz 6.9 kB Without provenance Details for bemo-0.0.2.tar.gz

Release files / bemo-0.0.2.tar.gz

Download URL bemo-0.0.2.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dafa25b69326c4c13bdaef2e908a4abece7d4e50e668a9a6a4a0e69b2b513380
BLAKE2b-256 checksum
How to use checksums
b85a0f47064b14a896ac821600231f591278c43b6cbdfb156ae377d60ca51256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for bemo 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

0.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page