diff --git a/src/qml/FeatureListForm.qml b/src/qml/FeatureListForm.qml index 8c00be12ef..6d5f2bd76d 100644 --- a/src/qml/FeatureListForm.qml +++ b/src/qml/FeatureListForm.qml @@ -58,7 +58,7 @@ Rectangle { width: { if ( props.isVisible || featureForm.canvasOperationRequested ) { - if (fullScreenView || parent.width < parent.height || parent.width < 300) + if (fullScreenView || parent.width <= parent.height || parent.width < 300) { parent.width } diff --git a/test/spix/requirements.txt b/test/spix/requirements.txt index 32fa62d924..adef83e1c6 100644 --- a/test/spix/requirements.txt +++ b/test/spix/requirements.txt @@ -2,3 +2,4 @@ py pytest pytest-html pytest-image-diff +pyautogui diff --git a/test/spix/smoke_test.py b/test/spix/smoke_test.py index 54a8c36870..55a4ade4ba 100755 --- a/test/spix/smoke_test.py +++ b/test/spix/smoke_test.py @@ -12,6 +12,7 @@ import platform from pathlib import Path from PIL import Image +import pyautogui @pytest.fixture @@ -166,6 +167,52 @@ def test_projection(app, screenshot_path, screenshot_check, extra, process_alive assert messagesCount == 0 +@pytest.mark.project_file("test_image_attachment.qgz") +def test_projection(app, screenshot_path, screenshot_check, extra, process_alive): + """ + Starts a test app and check for proper reprojection support (including rendering check and message logs). + This also tests that QField is able to reach proj's crucial proj.db + """ + assert app.existsAndVisible("mainWindow") + + # Arbitrary wait period to insure project fully loaded and rendered + time.sleep(4) + + messagesCount = 0 + for i in range(0, 10): + message = app.getStringProperty( + "mainWindow/messageLog/messageItem_{}/messageText".format(i), "text" + ) + if message == "": + break + extra.append(extras.html("Message logs content: {}".format(message))) + messagesCount = messagesCount + 1 + extra.append(extras.html("Message logs count: {}".format(messagesCount))) + assert messagesCount == 0 + + bounds = app.getBoundingBox("mainWindow/mapCanvas") + move_x = bounds[0] + bounds[2] / 2 + move_y = bounds[1] + bounds[3] / 3 + + pyautogui.moveTo(move_x, move_y, duration=0.5) + pyautogui.click(interval=0.5) + + bounds = app.getBoundingBox("mainWindow/featureForm") + move_x = bounds[0] + bounds[2] / 2 + move_y = bounds[1] + 80 + + pyautogui.moveTo(move_x, move_y, duration=0.5) + pyautogui.click(interval=0.5) + + app.takeScreenshot( + "mainWindow", os.path.join(screenshot_path, "test_image_attachment.png") + ) + assert process_alive() + extra.append(extras.html('')) + + assert screenshot_check("test_image_attachment", "test_image_attachment") + + @pytest.mark.project_file("test_svg.qgz") def test_svg(app, screenshot_path, screenshot_check, extra, process_alive): """ diff --git a/test/testdata/polygons.gpkg b/test/testdata/polygons.gpkg new file mode 100644 index 0000000000..e99fdf8e4f Binary files /dev/null and b/test/testdata/polygons.gpkg differ diff --git a/test/testdata/projection_dataset.gpkg b/test/testdata/projection_dataset.gpkg index d773f8ee91..9f332a6a60 100644 Binary files a/test/testdata/projection_dataset.gpkg and b/test/testdata/projection_dataset.gpkg differ diff --git a/test/testdata/reserve.jpg b/test/testdata/reserve.jpg new file mode 100644 index 0000000000..09b618f29f Binary files /dev/null and b/test/testdata/reserve.jpg differ diff --git a/test/testdata/test_image_attachment.qgz b/test/testdata/test_image_attachment.qgz new file mode 100644 index 0000000000..65d4b3cd63 Binary files /dev/null and b/test/testdata/test_image_attachment.qgz differ