3liz / qgis-veloroutes_voies_vertes-plugin

Standard Covadis Véloroutes et Voies Vertes (3V)
4 stars 5 forks source link

Check actions in QML on the CI #87

Closed Gustry closed 3 years ago

Gustry commented 3 years ago

Add a test to check actions stored in QML.

This test is checking :

The only thing not testable is the type of parameter (clicked X, clicked Y, strings, attributes etc).

The python code of the action itself is not covered by this test. This was already possible before, it just needs a test calling the Python function.

This code can be copy/pasted in another project.

For all actions which are not "edition only", we should use Python to create them. For instance in QuickOSM:

    actions = layer.actions()

    title = tr('OpenStreetMap Browser')
    osm_browser = QgsAction(
        QgsAction.OpenUrl,
        title,
        'http://www.openstreetmap.org/browse/[% "osm_type" %]/[% "osm_id" %]',
        '',
        False,
        title,
        ACTIONS_VISIBILITY,
        ''
    )
    actions.addAction(osm_browser)

CC @drillinP @rldhont @mdouchin