Skip to content
Jonas Bardino edited this page Oct 17, 2025 · 1 revision

Web Screen Shooter

We include a tool using selenium in mig/user/selenium/userguidescreens.py to automatically run through all enabled web pages on a given site and produce screenshots for a number of common pages in different states. One could refer to it as a software robot that helps automate a common workflow when working on site documentation, but it also comes in handy for testing purposes.

Usage

The tool can be used from the root of a migrid repository clone with something like:

PYTHONPATH=. python mig/user/selenium/userguidescreens.py BROWSER SITEURL LOGINFLAVOR [USERNAME [PASSWORD [2FAKEY]]]

Further details may be available with the -h flag and of course in the code itself:

PYTHONPATH=. python mig/user/selenium/userguidescreens.py -h

Examples

The examples here use a Snap version of Firefox as available on recent versions of Ubuntu Linux but one can replace the BROWSER argument to use another common browser like Chrome/Chromium or natively installed Firefox instead.

Running the tool against the corresponding organizational ucph OpenID Connect login flavor exposed at https://oidc.mysite.org with internal UCPH OIDC user abc123 could be achieved with:

PYTHONPATH=. python3 mig/user/selenium/userguidescreens.py firefox-snap https://oidc.mysite.org ucph abc123

Running the tool against the corresponding built-in mig OpenID login flavor exposed at https://ext.mysite.org with external user john@doe.org could be achieved with:

PYTHONPATH=. python3 mig/user/selenium/userguidescreens.py firefox-snap https://ext.mysite.org mig

Please replace references to mysite.org URLs above with your own site URLs.

Clone this wiki locally