sc/qa/uitest/calc_tests3/insertQrCodeGen.py | 15 ++++----------- sc/qa/uitest/signatureLine/insertSignatureLine.py | 22 ++++++++-------------- sw/qa/uitest/writer_tests3/insertQrCodeGen.py | 15 ++++----------- sw/qa/uitest/writer_tests3/insertSignatureLine.py | 7 ------- 4 files changed, 16 insertions(+), 43 deletions(-)
New commits: commit 9299617531ada46650d3a6855870aea13db161c4 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Feb 28 20:36:38 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Mar 7 14:11:57 2022 +0100 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 <xiscofa...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131102 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: 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: