summaryrefslogtreecommitdiff
path: root/sc/qa/uitest/protect
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-06-24 01:53:06 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-24 02:40:43 +0200
commit9a89eea4c3c58d2efce8afe709c0317869839ff9 (patch)
treef235036802674593f9cf6253f2f6363664494233 /sc/qa/uitest/protect
parent6805efdecb240fad8c82a5c1756a2a0e92f12b7d (diff)
Revert "uitest: guard create_doc_in_start_center"
This reverts commit 374baf308979306aa35575118c40ccd7caae1e29. Many uitests are failing randomly in jenkins for no apparent reason Change-Id: I5960330fab4967518bfeea32b3b8c5f8bfbea57e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117752 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/uitest/protect')
-rw-r--r--sc/qa/uitest/protect/protectSheet.py82
-rw-r--r--sc/qa/uitest/protect/protectSpreadsheet.py42
2 files changed, 64 insertions, 60 deletions
diff --git a/sc/qa/uitest/protect/protectSheet.py b/sc/qa/uitest/protect/protectSheet.py
index 4f24e9e68fca..90030b5322e7 100644
--- a/sc/qa/uitest/protect/protectSheet.py
+++ b/sc/qa/uitest/protect/protectSheet.py
@@ -16,45 +16,47 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class protectSheet(UITestCase):
def test_protect_sheet(self):
- with self.ui_test.create_doc_in_start_center("calc"):
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #enter password - lock
- self.ui_test.execute_dialog_through_command(".uno:Protect")
- xDialog = self.xUITest.getTopFocusWindow()
- xprotect = xDialog.getChild("protect")
- xpassword1 = xDialog.getChild("password1")
- xpassword2 = xDialog.getChild("password2")
-
- if (get_state_as_dict(xprotect)["Selected"]) == "false":
- xprotect.executeAction("CLICK", tuple())
- xpassword1.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
- xpassword2.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
-
- xOKBtn = xDialog.getChild("ok")
- # self.ui_test.close_dialog_through_button(xOKBtn)
- xOKBtn.executeAction("CLICK", tuple())
- #Unlock
-
- self.ui_test.execute_dialog_through_command(".uno:Protect")
- xDialog = self.xUITest.getTopFocusWindow()
- xpass1ed = xDialog.getChild("pass1ed")
-
- xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify - the sheet is unlocked
- enter_text_to_cell(gridwin, "B2", "A")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "A")
-
- # test cancel button
- self.ui_test.execute_dialog_through_command(".uno:Protect")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
- enter_text_to_cell(gridwin, "B2", "B")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "B")
+ calc_doc = self.ui_test.create_doc_in_start_center("calc")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #enter password - lock
+ self.ui_test.execute_dialog_through_command(".uno:Protect")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xprotect = xDialog.getChild("protect")
+ xpassword1 = xDialog.getChild("password1")
+ xpassword2 = xDialog.getChild("password2")
+
+ if (get_state_as_dict(xprotect)["Selected"]) == "false":
+ xprotect.executeAction("CLICK", tuple())
+ xpassword1.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+ xpassword2.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+
+ xOKBtn = xDialog.getChild("ok")
+# self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn.executeAction("CLICK", tuple())
+ #Unlock
+
+ self.ui_test.execute_dialog_through_command(".uno:Protect")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xpass1ed = xDialog.getChild("pass1ed")
+
+ xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify - the sheet is unlocked
+ enter_text_to_cell(gridwin, "B2", "A")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "A")
+
+ # test cancel button
+ self.ui_test.execute_dialog_through_command(".uno:Protect")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+ enter_text_to_cell(gridwin, "B2", "B")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "B")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/protect/protectSpreadsheet.py b/sc/qa/uitest/protect/protectSpreadsheet.py
index 7aa53f19fbc8..c0b78943fa05 100644
--- a/sc/qa/uitest/protect/protectSpreadsheet.py
+++ b/sc/qa/uitest/protect/protectSpreadsheet.py
@@ -16,29 +16,31 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class protectSpreadsheet(UITestCase):
def test_protect_spreadsheet(self):
- with self.ui_test.create_doc_in_start_center("calc"):
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #enter password
- self.ui_test.execute_dialog_through_command(".uno:ToolProtectionDocument")
- xDialog = self.xUITest.getTopFocusWindow()
- xpass1ed = xDialog.getChild("pass1ed")
- xconfirm1ed = xDialog.getChild("confirm1ed")
+ calc_doc = self.ui_test.create_doc_in_start_center("calc")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #enter password
+ self.ui_test.execute_dialog_through_command(".uno:ToolProtectionDocument")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xpass1ed = xDialog.getChild("pass1ed")
+ xconfirm1ed = xDialog.getChild("confirm1ed")
- xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
- xconfirm1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+ xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+ xconfirm1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.ui_test.execute_dialog_through_command(".uno:ToolProtectionDocument")
- xDialog = self.xUITest.getTopFocusWindow()
- xpass1ed = xDialog.getChild("pass1ed")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.ui_test.execute_dialog_through_command(".uno:ToolProtectionDocument")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xpass1ed = xDialog.getChild("pass1ed")
- xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+ xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab: