summaryrefslogtreecommitdiff
path: root/sc/qa/uitest/autofilter/tdf126306.py
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/uitest/autofilter/tdf126306.py')
-rw-r--r--sc/qa/uitest/autofilter/tdf126306.py229
1 files changed, 115 insertions, 114 deletions
diff --git a/sc/qa/uitest/autofilter/tdf126306.py b/sc/qa/uitest/autofilter/tdf126306.py
index 71102365fd5e..73f8d83f8b85 100644
--- a/sc/qa/uitest/autofilter/tdf126306.py
+++ b/sc/qa/uitest/autofilter/tdf126306.py
@@ -21,119 +21,120 @@ class tdf126306(UITestCase):
self.assertEqual(bVisible, value)
def test_run(self):
- with self.ui_test.create_doc_in_start_center("calc"):
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWin = calcDoc.getChild("grid_window")
-
- default_values = [25, 1023, 17, 9, 19, 0, 107, 89, 8, 453, 33, 3, 25, 204]
- document = self.ui_test.get_component()
-
- for i, value in enumerate(default_values, start=2):
- enter_text_to_cell(xGridWin, "A" + str(i), str(value))
-
- xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A15"}))
-
- self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xYesBtn = xDialog.getChild("yes")
- self.ui_test.close_dialog_through_button(xYesBtn)
-
- self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
-
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Sort ascending button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SPACE"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- sort_asc_values = [0, 3, 8, 9, 17, 19, 25, 25, 33, 89, 107, 204, 453, 1023]
- self.check_values(document, sort_asc_values)
- self.check_row_hidden(document)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Sort descending button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- sort_des_values = [1023, 453, 204, 107, 89, 33, 25, 25, 19, 17, 9, 8, 3, 0]
- self.check_values(document, sort_des_values)
- self.check_row_hidden(document)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Top 10 button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- top10_hidden_values = [True, True, True, False, True, False, True,
- True, False, True, True, False, True, True]
-
- #Values are the same
- self.check_values(document, default_values)
- self.check_row_hidden(document, top10_hidden_values)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Empty button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- empty_values = [False] * 14
- #Values are the same
- self.check_values(document, default_values)
- self.check_row_hidden(document, empty_values)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Not Empty button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- #Nothing should change
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # finish
+ self.ui_test.create_doc_in_start_center("calc")
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = calcDoc.getChild("grid_window")
+
+ default_values = [25, 1023, 17, 9, 19, 0, 107, 89, 8, 453, 33, 3, 25, 204]
+ document = self.ui_test.get_component()
+
+ for i, value in enumerate(default_values, start=2):
+ enter_text_to_cell(xGridWin, "A" + str(i), str(value))
+
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A15"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xYesBtn = xDialog.getChild("yes")
+ self.ui_test.close_dialog_through_button(xYesBtn)
+
+ self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
+
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Sort ascending button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SPACE"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ sort_asc_values = [0, 3, 8, 9, 17, 19, 25, 25, 33, 89, 107, 204, 453, 1023]
+ self.check_values(document, sort_asc_values)
+ self.check_row_hidden(document)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Sort descending button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ sort_des_values = [1023, 453, 204, 107, 89, 33, 25, 25, 19, 17, 9, 8, 3, 0]
+ self.check_values(document, sort_des_values)
+ self.check_row_hidden(document)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Top 10 button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ top10_hidden_values = [True, True, True, False, True, False, True,
+ True, False, True, True, False, True, True]
+
+ #Values are the same
+ self.check_values(document, default_values)
+ self.check_row_hidden(document, top10_hidden_values)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Empty button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ empty_values = [False] * 14
+ #Values are the same
+ self.check_values(document, default_values)
+ self.check_row_hidden(document, empty_values)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Not Empty button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ #Nothing should change
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # finish
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab: