Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

lino.api.selenium

Defines the Tour class and a runserver() function.

See Screenshot tours.

Functions

runserver(func[, url])

Run a Django development server in background and wait until it responds to web requests.

Classes

Tour(main_func[, output_path, title, ref, intro])

Generates a directory of screenshots images and their index.rst file.

lino.api.selenium.runserver(func, url='http://127.0.0.1:8000/', *args, **kwargs)

Run a Django development server in background and wait until it responds to web requests.

class lino.api.selenium.Tour(main_func, output_path=None, title='Screenshots', ref=None, intro=None)

Bases: object

Generates a directory of screenshots images and their index.rst file.

screenshots = []

A list of tuples (name, desc), where desc is another tuple (imgname, caption, before, after).

stabilize()

Wait until the screen has become stable. This measn that the browser has processed all Javascript, including ExtJS.onReady, that all AJAX requests have finised.

This is not trivial to detect, but fortunately we need to check it only for Lino screens. Technically we wait until

  • a <div id="body"> element must be present

  • no more loadmask is visible

make(driver=None, headless=True, *args, **kwargs)

Make the tour. Open a selenium driver, start the development server in background, run the main_func, write the index.rst files.