summaryrefslogtreecommitdiff
path: root/sc/qa/uitest/calc_tests7/tdf123122.py
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/uitest/calc_tests7/tdf123122.py')
-rw-r--r--sc/qa/uitest/calc_tests7/tdf123122.py76
1 files changed, 37 insertions, 39 deletions
diff --git a/sc/qa/uitest/calc_tests7/tdf123122.py b/sc/qa/uitest/calc_tests7/tdf123122.py
index 566ac527eef3..858ffed472c8 100644
--- a/sc/qa/uitest/calc_tests7/tdf123122.py
+++ b/sc/qa/uitest/calc_tests7/tdf123122.py
@@ -14,48 +14,46 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf123122(UITestCase):
def test_tdf123122_format_cell_datetime(self):
#numberingformatpage.ui
- 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()
- #select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog:
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0") #tab Numbers
- xliststore1 = xDialog.getChild("categorylb") #1st list / Category
- xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
- xdecimalsed = xDialog.getChild("decimalsed")
- xleadzerosed = xDialog.getChild("leadzerosed")
- xnegnumred = xDialog.getChild("negnumred")
- xthousands = xDialog.getChild("thousands")
- xlanguagelb = xDialog.getChild("languagelb")
- xformatted = xDialog.getChild("formatted")
+ with self.ui_test.create_doc_in_start_center_guarded("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ #select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0") #tab Numbers
+ xliststore1 = xDialog.getChild("categorylb") #1st list / Category
+ xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
+ xdecimalsed = xDialog.getChild("decimalsed")
+ xleadzerosed = xDialog.getChild("leadzerosed")
+ xnegnumred = xDialog.getChild("negnumred")
+ xthousands = xDialog.getChild("thousands")
+ xlanguagelb = xDialog.getChild("languagelb")
+ xformatted = xDialog.getChild("formatted")
- #Format cells and enter NN MMM DD YYYY HH:MM as format code
- xformatted.executeAction("CLEAR", tuple()) #clear textbox
- xformatted.executeAction("TYPE", mkPropertyValues({"TEXT":"NN MMM DD YYYY HH:MM"}))
- #save - OK
+ #Format cells and enter NN MMM DD YYYY HH:MM as format code
+ xformatted.executeAction("CLEAR", tuple()) #clear textbox
+ xformatted.executeAction("TYPE", mkPropertyValues({"TEXT":"NN MMM DD YYYY HH:MM"}))
+ #save - OK
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog:
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0") #tab Numbers
- xliststore1 = xDialog.getChild("categorylb") #1st list / Category
- xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
- xdecimalsed = xDialog.getChild("decimalsed")
- xleadzerosed = xDialog.getChild("leadzerosed")
- xnegnumred = xDialog.getChild("negnumred")
- xthousands = xDialog.getChild("thousands")
- xlanguagelb = xDialog.getChild("languagelb")
- xformatted = xDialog.getChild("formatted")
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0") #tab Numbers
+ xliststore1 = xDialog.getChild("categorylb") #1st list / Category
+ xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
+ xdecimalsed = xDialog.getChild("decimalsed")
+ xleadzerosed = xDialog.getChild("leadzerosed")
+ xnegnumred = xDialog.getChild("negnumred")
+ xthousands = xDialog.getChild("thousands")
+ xlanguagelb = xDialog.getChild("languagelb")
+ xformatted = xDialog.getChild("formatted")
- self.assertEqual(get_state_as_dict(xliststore1)["SelectEntryText"], "Date")
- self.assertEqual(get_state_as_dict(xformatted)["Text"], "NN MMM DD YYYY HH:MM")
+ self.assertEqual(get_state_as_dict(xliststore1)["SelectEntryText"], "Date")
+ self.assertEqual(get_state_as_dict(xformatted)["Text"], "NN MMM DD YYYY HH:MM")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab: