Skip to content

Commit

Permalink
Add test insuring SSL-enabled postgis layers load properly
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jan 11, 2024
1 parent 2c6aef4 commit 72255c8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/spix/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,30 @@ def test_svg(app, screenshot_path, screenshot_check, extra, process_alive):
assert screenshot_check("test_svg", "test_svg")


@pytest.mark.project_file("test_postgis_ssl.qgz")
def test_svg(app, screenshot_path, screenshot_check, extra, process_alive):
"""
Starts a test app and check that a SSL-enabled postgis layer loads properly
"""
assert app.existsAndVisible("mainWindow")

# Arbitrary wait period to insure project fully loaded and rendered
time.sleep(4)
assert process_alive()

# Insure layer has loaded properly by checking for error messages
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


if __name__ == "__main__":
sys.exit(pytest.main([__file__]))
Binary file added test/testdata/test_postgis_ssl.qgz
Binary file not shown.

1 comment on commit 72255c8

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.