diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-02-28 20:36:38 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-02-28 22:28:05 +0100 |
commit | 907a3c0248834f13441ec8c1239b3ca5c016aa5a (patch) | |
tree | c6c6e0fbe1d5dc3585fdc8318a449dd42c1f28d3 /sw | |
parent | 424de44cd0eba254368d3b867bc440c99b548168 (diff) |
uitest: simplify tests even more
- No need to open the dialog to click the cancel button
- Avoid repeated calls to document.DrawPage.getByIndex(0).
Similar to 26298f29e9d36313be527b785a9bb96089582037
this might fix the different failures these tests sometimes
have
Change-Id: I4e175b6c5d48c4651e5877ec2a72c4858b590321
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130727
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/uitest/writer_tests3/insertQrCodeGen.py | 15 | ||||
-rw-r--r-- | sw/qa/uitest/writer_tests3/insertSignatureLine.py | 7 |
2 files changed, 4 insertions, 18 deletions
diff --git a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py index ec88944af6a7..5895211af123 100644 --- a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py +++ b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py @@ -9,7 +9,6 @@ from uitest.framework import UITestCase from uitest.uihelper.common import type_text -from com.sun.star.lang import IndexOutOfBoundsException class insertQrCode(UITestCase): @@ -17,13 +16,6 @@ class insertQrCode(UITestCase): with self.ui_test.create_doc_in_start_center("writer") as document: xWriterDoc = self.xUITest.getTopFocusWindow() - # cancel the dialog without doing anything - with self.ui_test.execute_dialog_through_command(".uno:InsertQrCode", close_button="cancel") as xDialog: - - xURL = xDialog.getChild("edit_text") - type_text(xURL, "www.libreoffice.org") - - # Reopen the dialog box with self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") as xDialog: # Get elements in the Dialog Box @@ -37,8 +29,9 @@ class insertQrCode(UITestCase): xBorder.executeAction("DOWN", tuple()) # check the QR code in the document - self.assertEqual(document.DrawPage.getByIndex(0).BarCodeProperties.Payload, "www.libreoffice.org") - self.assertEqual(document.DrawPage.getByIndex(0).BarCodeProperties.ErrorCorrection, 1) - self.assertEqual(document.DrawPage.getByIndex(0).BarCodeProperties.Border, 1) + element = document.DrawPage.getByIndex(0) + self.assertEqual(element.BarCodeProperties.Payload, "www.libreoffice.org") + self.assertEqual(element.BarCodeProperties.ErrorCorrection, 1) + self.assertEqual(element.BarCodeProperties.Border, 1) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests3/insertSignatureLine.py b/sw/qa/uitest/writer_tests3/insertSignatureLine.py index 67987a57e860..0082891dab1a 100644 --- a/sw/qa/uitest/writer_tests3/insertSignatureLine.py +++ b/sw/qa/uitest/writer_tests3/insertSignatureLine.py @@ -9,7 +9,6 @@ from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues -from com.sun.star.lang import IndexOutOfBoundsException class insertSignatureLine(UITestCase): @@ -17,12 +16,6 @@ class insertSignatureLine(UITestCase): with self.ui_test.create_doc_in_start_center("writer") as document: xWriterDoc = self.xUITest.getTopFocusWindow() - # cancel the dialog without doing anything - with self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine", close_button="cancel") as xDialog: - - xName = xDialog.getChild("edit_name") - xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line - # set the signature line with self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine") as xDialog: |