QGIS plugin manual test plan

This document describes how to perform a full manual test on the Ribasim QGIS plugin. Known shortcomings and issues can be documented here. Bugs can be reported on GitHub.

1 Clean slate tests

Before starting with data, perform the following tests to see if the plugin doesn’t result in any errors.

1.1 Enable and disable

  • Open QGIS and navigate to “Plugins > Manage and Install Plugins…”: The plugin management window opens.
  • Navigate to “Installed”: Ribasim plugin is in the list (enabled).
  • Disable the Ribasim plugin: Ribasim plugin panel hides if it was open, Ribasim button hides from navigation toolbar.
  • Enable the Ribasim plugin: Ribasim button shows on the navigation toolbar.

1.2 Open and close

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the Ribasim button on the QGIS toolbar: Ribasim panel hides.

1.3 Button states on startup

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • In the Model tab, the “Add to QGIS” and “Remove from Dataset” buttons are disabled.
  • In the Nodes tab, all buttons are disabled.

Failing

2 New model tests

2.1 New and cancel

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name.
  • Press “Cancel”: Ensure that no files are created in that location.

2.2 New single model

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • The layers tab shows a group with a “Node” and “Edge” layer, the canvas is empty.
  • The Ribasim panel shows a Node and Edge layer, the file path is set in the text field, all nodes buttons are enabled.
  • Cleanup: Delete the created files from disk.

2.3 New model in same folder

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test2”).
  • Press OK: An error is given that the database.gpkg already exists, test2.toml is not written.
  • Cleanup: Delete the created files from disk.

Failing

2.4 New model with same name

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Open test1.toml in a text editor and write “EXTRA_LINE=true”
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: Shows a popup window to ask if you want to overwrite.
  • Press Yes: An error is given that the database.gpkg already exists, test1.toml is not overwritten (EXTRA_LINE=true) is still in test1.toml.
  • Cleanup: Delete the created files from disk.

Unsure if this is wanted behavior, as we said we wanted to overwrite the TOML file, and therefore also the database file. Perhaps we should create folders instead of TOML files only.

Failing

2.5 New model and clean new project cleans Ribasim plugin

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Press “Project > New”: Popup asks to save the project.
  • Press Discard: Layers tab is emptied, Ribasim panel is emptied.

Failing

3 Model tab button interaction tests

3.1 Open model twice

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Press the “Open” button in the Model tab: file navigation window pops up.
  • Open test1.toml: A new layer group is added to the layers panel.
  • In the Nodes tab press “Basin / profile”: A Basin / profile table layer is added to the last layer group only.

Intended behavior: The same model is loaded twice, but there is only a connection on the last loaded model when interacting with the plugin.

3.2 Add to QGIS button

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Press “Add to QGIS”: Nothing happens.
  • Press the “Edge” layer in the Model tab: “Add to QGIS” button is disabled.

Failing

3.3 Remove from Dataset button

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Press the “Edge” layer in the Model tab, press “Remove from Dataset”: Popup shows “Deleting: Edge”.
  • Press “Yes”: “Edge” layer is removed from Layers panel and from Model tab.

Unsure if this is wanted behavior, it is now impossible to load the model afterwards because it no longer contains an Edge layer. Perhaps better if we only allow removal of the optional tables. See this bug report.

4 Nodes tab button interaction tests

4.1 Add all tables to new model

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Go to the Nodes tab: All buttons are enabled.
  • From left to right, top to bottom, press every button to add tables to the layers: The layer group contains extra layers for every button clicked. Basin / area is a MultiPolygon layer.
  • Navigate to Model tab: All layers are added to the panel.
  • Press the “Open” button to open the same model once again: The layers panel adds the model containing all of its layers, the Model tab was refreshed.

4.2 Add table twice to new model

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Go to the Nodes tab: All buttons are enabled.
  • Press the Basin / time button: A layer is added to the layers panel with that name, the button becomes disabled.

Failing

5 Map interaction tests

5.1 Add points to Node layer

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Select the Node layer in the Layers tab: edit buttons in the toolbar become enabled.
  • Edit the layer by pressing the pencil button: Add Point Feature button becomes enabled.
  • Click in the canvas: Popup appears with Feature Attributes to fill in.
  • Press OK: The first Node appears on the map.
  • Click in the canvas again: Popup appears with Feature Attributes to fill in.
  • Press OK: The second Node appears on the map.

Unexpected behavior: The default type of the nodes is NULL, and therefore undefined. Should be enforced and validated. See issue.

5.2 Add edges to Edge layer

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “New” button in the Model tab: file navigation window pops up.
  • Fill in a name (“test1”).
  • Press OK: A TOML and database file are created on the given location.
  • Select the Node layer in the Layers tab: edit buttons in the toolbar become enabled.
  • Edit the layer by pressing the pencil button: Add Point Feature button becomes enabled.
  • Click in the canvas: Popup appears with Feature Attributes to fill in.
  • Add a node id of 1, press OK: The first Node appears on the map.
  • Click in the canvas again: Popup appears with Feature Attributes to fill in.
  • Add a node id of 2, press OK: The second Node appears on the map.
  • Select the Edge layer in the Layers tab: edit buttons in the toolbar become enabled.
  • Enable snapping under View > Toolbars > Snapping Toolbars: Magnet button is enabled and active.
  • Press the Add Line Feature button: Mouse becomes a crosshair.
  • Snap a line between the two nodes, click the two nodes and then right click to finish: Popup shows with input, most fields are set to NULL.
  • Press OK: Line appears on screen between the two nodes.
  • Save the layer’s edits: The line becomes blue.
  • Open the attribute table: The information shows the from_node_id, to_node_id. This information matches the information from the Node table.

5.3 Node selection on map triggers table selection

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the “Open” button in the Model tab: file navigation window pops up.
  • Choose an existing model from the generated_testmodels folder.
  • Press OK: The model layers appear in the layer panel and on the map.
  • Select the node layer, and make a subselection of nodes on the map: Nodes are highlighted in yellow, including their edges.
  • Open the Edge attribute table: The highlighted rows are those with a from/to node_id that was selected.
  • Open any non-spatial attribute table: The highlighted rows are those with an node_id that was selected.

6 Tables tests

6.1 Edit tables with data

TODO

6.2 Edit the type of a node

TODO

6.3 Edit information in optional tables

TODO

7 Result inspection tests

7.1 Run a model and check the time series

TODO

8 Tutorial tests

8.1 Perform tutorial in documentation

Go through the tutorial as described in the How-to guide.