diff --git a/tests/src/python/test_qgsserver_wms.py b/tests/src/python/test_qgsserver_wms.py index d1676889c17..a2900554023 100644 --- a/tests/src/python/test_qgsserver_wms.py +++ b/tests/src/python/test_qgsserver_wms.py @@ -1302,6 +1302,70 @@ class TestQgsServerWMS(QgsServerTestBase): r, h = self._result(self._execute_request(qs)) self._img_diff_error(r, h, "WMS_GetPrint_Selection") + def test_wms_getprint_highlight(self): + # default style + qs = "?" + "&".join(["%s=%s" % i for i in list({ + "MAP": urllib.parse.quote(self.projectPath), + "SERVICE": "WMS", + "VERSION": "1.1.1", + "REQUEST": "GetPrint", + "TEMPLATE": "layoutA4", + "FORMAT": "png", + "map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031", + "map0:LAYERS": "Country_Labels", + "map0:HIGHLIGHT_GEOM": "POLYGON((-15000000 10000000, -15000000 6110620, 2500000 6110620, 2500000 10000000, -15000000 10000000))", + "map0:HIGHLIGHT_SYMBOL": "HighlightSymbol%23ea117311.6", + "map0:HIGHLIGHT_LABELSTRING": "Highlight Layer!", + "map0:HIGHLIGHT_LABELSIZE": "16", + "map0:HIGHLIGHT_LABELCOLOR": "%2300FF0000", + "map0:HIGHLIGHT_LABELBUFFERCOLOR": "%232300FF00", + "map0:HIGHLIGHT_LABELBUFFERSIZE": "1.5", + "HEIGHT": "500", + "WIDTH": "500", + "CRS": "EPSG:3857" + }.items())]) + + r, h = self._result(self._execute_request(qs)) + assert h.get("Content-Type").startswith('image'), r + self._img_diff_error(r, h, "WMS_GetPrint_Highlight") + + def test_wms_getprint_label(self): + qs = "?" + "&".join(["%s=%s" % i for i in list({ + "MAP": urllib.parse.quote(self.projectPath), + "SERVICE": "WMS", + "VERSION": "1.1.1", + "REQUEST": "GetPrint", + "TEMPLATE": "layoutA4", + "FORMAT": "png", + "map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031", + "map0:LAYERS": "Country,Hello", + "HEIGHT": "500", + "WIDTH": "500", + "CRS": "EPSG:3857", + "IDTEXTBOX": "Updated QGIS composer label" + }.items())]) + + r, h = self._result(self._execute_request(qs)) + self._img_diff_error(r, h, "WMS_GetPrint_LabelUpdated") + + qs = "?" + "&".join(["%s=%s" % i for i in list({ + "MAP": urllib.parse.quote(self.projectPath), + "SERVICE": "WMS", + "VERSION": "1.1.1", + "REQUEST": "GetPrint", + "TEMPLATE": "layoutA4", + "FORMAT": "png", + "map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031", + "map0:LAYERS": "Country,Hello", + "HEIGHT": "500", + "WIDTH": "500", + "CRS": "EPSG:3857", + "IDTEXTBOX": "" + }.items())]) + + r, h = self._result(self._execute_request(qs)) + self._img_diff_error(r, h, "WMS_GetPrint_LabelRemoved") + def test_getLegendGraphics(self): """Test that does not return an exception but an image""" parms = { diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/WMS_GetPrint_Highlight.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/WMS_GetPrint_Highlight.png new file mode 100644 index 00000000000..2bf4169cad8 Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/WMS_GetPrint_Highlight.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/WMS_GetPrint_Highlight_mask.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/WMS_GetPrint_Highlight_mask.png new file mode 100644 index 00000000000..fe0db2294ab Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Highlight/WMS_GetPrint_Highlight_mask.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelRemoved/WMS_GetPrint_LabelRemoved.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelRemoved/WMS_GetPrint_LabelRemoved.png new file mode 100644 index 00000000000..c08284f6683 Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelRemoved/WMS_GetPrint_LabelRemoved.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelRemoved/WMS_GetPrint_LabelRemoved_mask.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelRemoved/WMS_GetPrint_LabelRemoved_mask.png new file mode 100644 index 00000000000..4b90d240e8c Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelRemoved/WMS_GetPrint_LabelRemoved_mask.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelUpdated/WMS_GetPrint_LabelUpdated.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelUpdated/WMS_GetPrint_LabelUpdated.png new file mode 100644 index 00000000000..a63f00c1d59 Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelUpdated/WMS_GetPrint_LabelUpdated.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelUpdated/WMS_GetPrint_LabelUpdated_mask.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelUpdated/WMS_GetPrint_LabelUpdated_mask.png new file mode 100644 index 00000000000..c857d50f26e Binary files /dev/null and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_LabelUpdated/WMS_GetPrint_LabelUpdated_mask.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_Legend/WMS_GetPrint_Legend.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Legend/WMS_GetPrint_Legend.png index 575e187d31c..022ac05a628 100644 Binary files a/tests/testdata/control_images/qgis_server/WMS_GetPrint_Legend/WMS_GetPrint_Legend.png and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Legend/WMS_GetPrint_Legend.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_Legend/WMS_GetPrint_Legend_mask.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Legend/WMS_GetPrint_Legend_mask.png index 8db85dfb416..bb330c47f6f 100644 Binary files a/tests/testdata/control_images/qgis_server/WMS_GetPrint_Legend/WMS_GetPrint_Legend_mask.png and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_Legend/WMS_GetPrint_Legend_mask.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleCustom/WMS_GetPrint_StyleCustom.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleCustom/WMS_GetPrint_StyleCustom.png index 32ea4e0cf8d..7290ef388a0 100644 Binary files a/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleCustom/WMS_GetPrint_StyleCustom.png and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleCustom/WMS_GetPrint_StyleCustom.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleCustom/WMS_GetPrint_StyleCustom_mask.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleCustom/WMS_GetPrint_StyleCustom_mask.png index 8db85dfb416..aebba9da8f0 100644 Binary files a/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleCustom/WMS_GetPrint_StyleCustom_mask.png and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleCustom/WMS_GetPrint_StyleCustom_mask.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleDefault/WMS_GetPrint_StyleDefault.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleDefault/WMS_GetPrint_StyleDefault.png index a1b0f339640..fd51e9d7feb 100644 Binary files a/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleDefault/WMS_GetPrint_StyleDefault.png and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleDefault/WMS_GetPrint_StyleDefault.png differ diff --git a/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleDefault/WMS_GetPrint_StyleDefault_mask.png b/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleDefault/WMS_GetPrint_StyleDefault_mask.png index 8db85dfb416..93ed78bc5c7 100644 Binary files a/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleDefault/WMS_GetPrint_StyleDefault_mask.png and b/tests/testdata/control_images/qgis_server/WMS_GetPrint_StyleDefault/WMS_GetPrint_StyleDefault_mask.png differ