Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.06 KB

README.rst

File metadata and controls

46 lines (31 loc) · 1.06 KB

Anvil Test Library

A library to facilitate automated testing of Anvil applications based on Selenium.

Installation

pip install anvil_test

You will also need the relevant webdrivers for the browsers you wish to use. See the Selenium docs for further info.

Usage

The library contains a module of functions which you can import to use within your testing suite.

Example code using pytest to login to an anvil app, run a trivial (failing) test and close down the browser session at the end:

import pytest

from anvil_test import session

browser = 'firefox'
url = 'https://<your-app>.anvilapp.net/'
email = '[email protected]'
password = 'password'


@pytest.fixture
def test_session():
    session.init(browser, url)
    session.login(email, password)
    yield
    session.browser.quit()


def test_login(test_session):
    assert 1 == 2