sc/qa/uitest/calc_tests3/insertQrCodeGen.py | 23 ++++++++++++++++++++++- sw/qa/uitest/writer_tests3/insertQrCodeGen.py | 24 +++++++++++++++++++++++- 2 files changed, 45 insertions(+), 2 deletions(-)
New commits: commit ecc48a8f86647b7f02631ea2b06ac63d28979d9b Author: Xisco Fauli <[email protected]> AuthorDate: Tue Mar 3 12:36:16 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Tue Mar 3 14:35:44 2026 +0100 uitest: test insert bar code Change-Id: I317649c75c4553f00dd74f70ba402e05e8df2e09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200880 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py index db0dd03bd355..ca983f540bd1 100644 --- a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py +++ b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py @@ -9,7 +9,7 @@ import os from uitest.framework import UITestCase -from uitest.uihelper.common import type_text +from uitest.uihelper.common import type_text, select_by_text class insertQrCode(UITestCase): @@ -34,5 +34,26 @@ class insertQrCode(UITestCase): self.assertEqual(element.BarCodeProperties.Payload, "www.libreoffice.org") self.assertEqual(element.BarCodeProperties.ErrorCorrection, 1) self.assertEqual(element.BarCodeProperties.Border, 1) + self.assertEqual(element.BarCodeProperties.Type, 0) + + def test_insert_bar_code_gen(self): + if os.getenv('ENABLE_ZXING') == 'TRUE': + + with self.ui_test.create_doc_in_start_center("calc") as document: + with self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") as xDialog: + + # Get elements in the Dialog Box + xURL = xDialog.getChild("edit_text") + xType = xDialog.getChild("choose_type") + + type_text(xURL, "www.libreoffice.org") #set the QR code + select_by_text(xType, "Barcode") + + # check the QR code in the document + element = document.Sheets[0].DrawPage[0] + self.assertEqual(element.BarCodeProperties.Payload, "www.libreoffice.org") + self.assertEqual(element.BarCodeProperties.ErrorCorrection, 1) + self.assertEqual(element.BarCodeProperties.Border, 1) + self.assertEqual(element.BarCodeProperties.Type, 1) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py index c07a276a44d9..5084373fc47b 100644 --- a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py +++ b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py @@ -9,7 +9,7 @@ import os from uitest.framework import UITestCase -from uitest.uihelper.common import type_text +from uitest.uihelper.common import type_text, select_by_text class insertQrCode(UITestCase): @@ -35,5 +35,27 @@ class insertQrCode(UITestCase): self.assertEqual(element.BarCodeProperties.Payload, "www.libreoffice.org") self.assertEqual(element.BarCodeProperties.ErrorCorrection, 1) self.assertEqual(element.BarCodeProperties.Border, 1) + self.assertEqual(element.BarCodeProperties.Type, 0) + + def test_insert_bar_code(self): + if os.getenv('ENABLE_ZXING') == 'TRUE': + + with self.ui_test.create_doc_in_start_center("writer") as document: + + with self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") as xDialog: + + # Get elements in the Dialog Box + xURL = xDialog.getChild("edit_text") + xType = xDialog.getChild("choose_type") + + type_text(xURL, "www.libreoffice.org") #set the QR code + select_by_text(xType, "Barcode") + + # check the QR code in the document + element = document.DrawPage[0] + self.assertEqual(element.BarCodeProperties.Payload, "www.libreoffice.org") + self.assertEqual(element.BarCodeProperties.ErrorCorrection, 1) + self.assertEqual(element.BarCodeProperties.Border, 1) + self.assertEqual(element.BarCodeProperties.Type, 1) # vim: set shiftwidth=4 softtabstop=4 expandtab:
