From 8ecc813983cf07132c120f1ac7c42ad0bbf3ab7c Mon Sep 17 00:00:00 2001 From: Alexander Bruy Date: Tue, 10 Nov 2020 16:24:06 +0200 Subject: [PATCH] test for adding new rows to the Processing batch interface, see https://github.com/qgis/QGIS/issues/39696 --- coretests/tests/testerplugin.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/coretests/tests/testerplugin.py b/coretests/tests/testerplugin.py index ed6e97d..c0bbf3f 100644 --- a/coretests/tests/testerplugin.py +++ b/coretests/tests/testerplugin.py @@ -24,9 +24,11 @@ import os import sys -from qgis.core import QgsSettings +from qgis.core import QgsSettings, QgsApplication from qgis.utils import iface +from processing.gui.BatchAlgorithmDialog import BatchAlgorithmDialog + def functionalTests(): try: @@ -48,8 +50,16 @@ def functionalTests(): testBrowserAddWmts.addStep('Try to add layer "112 Par satellite" from the Browser to QGIS canvas. Check that QGIS prompts for date and after setting a date layer added to canvas and visible.') testBrowserAddWmts.setCleanup(lambda: _removeWmtsConnection()) + # adding rows in the Processing batch interface - #39696 + testAddBatchRows = Test('Adding new rows in Processing batch interface') + testAddBatchRows.setIssueUrl('https://github.com/qgis/QGIS/issues/39696') + testAddBatchRows.addStep('Start native "Buffer" algorithm in batch mode', function=lambda: _runProcessingBatch()) + testAddBatchRows.addStep('Check that every time green plus button in the dialog toolbar is pressed a new row added to the batch.', isVerifyStep=True) + testAddBatchRows.addStep('Close dialog by pressing "Close" button.') + return [testAdvancedSettings, - testBrowserAddWmts + testBrowserAddWmts, + testAddBatchRows ] @@ -73,8 +83,16 @@ def _addWmtsConnection(): iface.browserModel().reload() + def _removeWmtsConnection(): settings = QgsSettings() settings.remove('qgis/connections-wms/TesterPlugin') settings.remove('qgis/WMS/TesterPlugin') iface.browserModel().reload() + + +def _runProcessingBatch(): + alg = QgsApplication.processingRegistry().createAlgorithmById('native:buffer') + dlg = BatchAlgorithmDialog(alg.create(), parent=iface.mainWindow()) + dlg.show() + dlg.exec_()