summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-02-28 20:36:38 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-03-07 14:11:57 +0100
commit9299617531ada46650d3a6855870aea13db161c4 (patch)
tree04b2eacb71d669f3ca0a0a2802b946cb1c07cbd9 /sc
parent6439ee65bdfc4151d96ff2aeb3958949996cbc77 (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 'sc')
-rw-r--r--sc/qa/uitest/calc_tests3/insertQrCodeGen.py15
-rw-r--r--sc/qa/uitest/signatureLine/insertSignatureLine.py22
2 files changed, 12 insertions, 25 deletions
diff --git a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
index 50cb75641027..0fe70f1febc0 100644
--- a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
+++ b/sc/qa/uitest/calc_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):
@@ -15,13 +14,6 @@ class insertQrCode(UITestCase):
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
- # 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
@@ -35,8 +27,9 @@ class insertQrCode(UITestCase):
xBorder.executeAction("DOWN", tuple())
# check the QR code in the document
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Payload, "www.libreoffice.org")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.ErrorCorrection, 1)
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).BarCodeProperties.Border, 1)
+ element = document.Sheets.getByIndex(0).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/sc/qa/uitest/signatureLine/insertSignatureLine.py b/sc/qa/uitest/signatureLine/insertSignatureLine.py
index 28d9c4e29fcc..8dde04e1c875 100644
--- a/sc/qa/uitest/signatureLine/insertSignatureLine.py
+++ b/sc/qa/uitest/signatureLine/insertSignatureLine.py
@@ -8,7 +8,6 @@ from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict, type_text
from libreoffice.uno.propertyvalue import mkPropertyValues
-from com.sun.star.lang import IndexOutOfBoundsException
#Bug 117903 - Allow signature lines in Calc
@@ -19,12 +18,6 @@ class insertSignatureLineCalc(UITestCase):
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
- # 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:
@@ -41,12 +34,13 @@ class insertSignatureLineCalc(UITestCase):
xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
#check the signature Line in the document
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerName, "Name")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerEmail, "Email")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineCanAddComment, False)
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineShowSignDate, True)
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSigningInstructions, "Instructions")
+ element = document.Sheets.getByIndex(0).DrawPage.getByIndex(0)
+ self.assertEqual(element.SignatureLineSuggestedSignerName, "Name")
+ self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(element.SignatureLineSuggestedSignerEmail, "Email")
+ self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(element.SignatureLineCanAddComment, False)
+ self.assertEqual(element.SignatureLineShowSignDate, True)
+ self.assertEqual(element.SignatureLineSigningInstructions, "Instructions")
# vim: set shiftwidth=4 softtabstop=4 expandtab: