lino.api.selenium

Used by make_screenshots.py and maketour.py scripts.

Defines an Album class and a runserver() function. An "album" represents a directory with screenshot images and their index.rst file.

Note that one maketour.py file might generate several albums during a single runserver process, e.g. one for each language.

Introducing the Selenium-WebDriver API by Example

INVOKE_SERVER does not work at the moment. It seems that driver.get() does not wait if the server is just starting up and therefore not even yet responding to connection requests. The only workaround for this is currently to run the webserver process in a different terminal.

(This module's source code is available here.)

Functions

runserver(settings_module, func[, driver])

Classes

Album(driver[, root, title, ref, intro])

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

class lino.api.selenium.Album(driver, root=None, title='Screenshots', ref=None, intro=None)

Bases: object

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

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