summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-02-28 20:36:38 +0100
committerAndras Timar <andras.timar@collabora.com>2022-03-09 09:17:24 +0100
commit1298b29ce53fd851915dee8d2a27c1e0081ce1d5 (patch)
tree4bf16c88f0dc924f7b00b049e5d09c9af02f0259 /sw/qa
parent963cd26342e9f133066578621ded1198c67d439d (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> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131102
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/uitest/writer_tests3/insertQrCodeGen.py15
-rw-r--r--sw/qa/uitest/writer_tests3/insertSignatureLine.py7
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 5083703926e8..a8702b745944 100644
--- a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py
+++ b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py
@@ -6,7 +6,6 @@
from uitest.framework import UITestCase
from uitest.uihelper.common import type_text
-from com.sun.star.lang import IndexOutOfBoundsException
class insertQrCode(UITestCase):
@@ -14,13 +13,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
@@ -34,8 +26,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 74ba342006da..6537520cabf4 100644
--- a/sw/qa/uitest/writer_tests3/insertSignatureLine.py
+++ b/sw/qa/uitest/writer_tests3/insertSignatureLine.py
@@ -6,7 +6,6 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
-from com.sun.star.lang import IndexOutOfBoundsException
class insertSignatureLine(UITestCase):
@@ -14,12 +13,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: