summaryrefslogtreecommitdiff
path: root/sc/qa/uitest/search_replace/tdf35020.py
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/uitest/search_replace/tdf35020.py')
-rw-r--r--sc/qa/uitest/search_replace/tdf35020.py55
1 files changed, 27 insertions, 28 deletions
diff --git a/sc/qa/uitest/search_replace/tdf35020.py b/sc/qa/uitest/search_replace/tdf35020.py
index 994bcd21a89d..335d985eadcb 100644
--- a/sc/qa/uitest/search_replace/tdf35020.py
+++ b/sc/qa/uitest/search_replace/tdf35020.py
@@ -16,34 +16,33 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf35020(UITestCase):
def test_tdf39959_find_replace_all_sheets(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf35020.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf35020.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"X6"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"A6"})) #replace textbox
- allsheets = xDialog.getChild("allsheets")
- allsheets.executeAction("CLICK", tuple())
- calcsearchin = xDialog.getChild("calcsearchin")
- select_by_text(calcsearchin, "Formulas")
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"X6"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"A6"})) #replace textbox
+ allsheets = xDialog.getChild("allsheets")
+ allsheets.executeAction("CLICK", tuple())
+ calcsearchin = xDialog.getChild("calcsearchin")
+ select_by_text(calcsearchin, "Formulas")
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
- #verify Sheet1.A13 A14 = 2
- self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 2)
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 1)
- self.ui_test.close_doc()
+ #verify Sheet1.A13 A14 = 2
+ self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 2)
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 1)
# vim: set shiftwidth=4 softtabstop=4 expandtab: