sc/qa/uitest/textToColumns/tdf69981.py | 11 -- sc/qa/uitest/textToColumns/tdf92423.py | 12 -- sc/qa/uitest/textToColumns/textToColumns.py | 120 +++++----------------------- 3 files changed, 22 insertions(+), 121 deletions(-)
New commits: commit 05472ebc3fd9c89080cfb28c26951164139b632a Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Feb 1 17:04:17 2023 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Feb 1 19:32:06 2023 +0000 UITest_textToColumns: fix indent and simplify code The wrong indent made those tests not to be executed OTOH, do not change the option replwarncb so it's enabled by default. This tests are not about testing that Change-Id: Ib73305f43dd8285f1042f9e399efb034d872d895 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146462 Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/uitest/textToColumns/tdf69981.py b/sc/qa/uitest/textToColumns/tdf69981.py index bd4b5756c9b7..87c09e8ffcbf 100644 --- a/sc/qa/uitest/textToColumns/tdf69981.py +++ b/sc/qa/uitest/textToColumns/tdf69981.py @@ -18,17 +18,6 @@ class tdf69981(UITestCase): with self.ui_test.load_file(get_url_for_data_file("tdf69981.ods")) as calc_doc: xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") - #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged. - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialogOpt: - - xPages = xDialogOpt.getChild("pages") - xWriterEntry = xPages.getChild('3') # Calc - xWriterEntry.executeAction("EXPAND", tuple()) - xWriterGeneralEntry = xWriterEntry.getChild('0') - xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb - xreplwarncb = xDialogOpt.getChild("replwarncb") - if (get_state_as_dict(xreplwarncb)["Selected"]) == "false": - xreplwarncb.executeAction("CLICK", tuple()) #Select A2:A7 gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A7"})) diff --git a/sc/qa/uitest/textToColumns/tdf92423.py b/sc/qa/uitest/textToColumns/tdf92423.py index 44c7613db48a..99486bb2f00e 100644 --- a/sc/qa/uitest/textToColumns/tdf92423.py +++ b/sc/qa/uitest/textToColumns/tdf92423.py @@ -19,17 +19,6 @@ class tdf92423(UITestCase): xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") - #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged. - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialogOpt: - - xPages = xDialogOpt.getChild("pages") - xWriterEntry = xPages.getChild('3') # Calc - xWriterEntry.executeAction("EXPAND", tuple()) - xWriterGeneralEntry = xWriterEntry.getChild('0') - xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb - xreplwarncb = xDialogOpt.getChild("replwarncb") - if (get_state_as_dict(xreplwarncb)["Selected"]) == "false": - xreplwarncb.executeAction("CLICK", tuple()) #enter data enter_text_to_cell(gridwin, "A1", "1;2") enter_text_to_cell(gridwin, "A2", "2;3") @@ -53,7 +42,6 @@ class tdf92423(UITestCase): xSemicolon = xDialog.getChild("semicolon") #check semicolon checkbox if (get_state_as_dict(xSemicolon)["Selected"]) == "false": xSemicolon.executeAction("CLICK", tuple()) - # Click Ok #Verify self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 1) diff --git a/sc/qa/uitest/textToColumns/textToColumns.py b/sc/qa/uitest/textToColumns/textToColumns.py index f17f6cc79ff0..c67e879d1835 100644 --- a/sc/qa/uitest/textToColumns/textToColumns.py +++ b/sc/qa/uitest/textToColumns/textToColumns.py @@ -20,17 +20,6 @@ class CalcTextToColumns(UITestCase): with self.ui_test.load_file(get_url_for_data_file("text_to_columns_dot.ods")) as calc_doc: xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") - #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged. - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialogOpt: - - xPages = xDialogOpt.getChild("pages") - xWriterEntry = xPages.getChild('3') # Calc - xWriterEntry.executeAction("EXPAND", tuple()) - xWriterGeneralEntry = xWriterEntry.getChild('0') - xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb - xreplwarncb = xDialogOpt.getChild("replwarncb") - if (get_state_as_dict(xreplwarncb)["Selected"]) == "false": - xreplwarncb.executeAction("CLICK", tuple()) #Select A1:A5 on Sheet 'Dot_as_Separator' gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"})) @@ -44,12 +33,9 @@ class CalcTextToColumns(UITestCase): xother.executeAction("CLICK", tuple()) xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"."})) #Click Ok - #Does an overwrite warning come up? If not file an Issue. - #Tag the 'Do not show warning again' checkbox and press Ok. xOK = xDialog.getChild("ok") - with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes") as dialog: - xask = dialog.getChild("ask") - xask.executeAction("CLICK", tuple()) + with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"): + pass #Verify self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getValue(), 1) @@ -88,33 +74,11 @@ class CalcTextToColumns(UITestCase): self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0) self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content") - #verify setting in options - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialogOpt: - - xPages = xDialogOpt.getChild("pages") - xWriterEntry = xPages.getChild('3') # Calc - xWriterEntry.executeAction("EXPAND", tuple()) - xWriterGeneralEntry = xWriterEntry.getChild('0') - xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb - xreplwarncb = xDialogOpt.getChild("replwarncb") - self.assertEqual(get_state_as_dict(xreplwarncb)["Selected"], "false") - def test_text_to_columns_comma(self): #Comma as Separator with self.ui_test.load_file(get_url_for_data_file("text_to_columns_comma.ods")) as calc_doc: xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") - #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged. - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialogOpt: - - xPages = xDialogOpt.getChild("pages") - xWriterEntry = xPages.getChild('3') # Calc - xWriterEntry.executeAction("EXPAND", tuple()) - xWriterGeneralEntry = xWriterEntry.getChild('0') - xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb - xreplwarncb = xDialogOpt.getChild("replwarncb") - if (get_state_as_dict(xreplwarncb)["Selected"]) == "false": - xreplwarncb.executeAction("CLICK", tuple()) # Select A1:A5 gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"})) @@ -167,21 +131,11 @@ class CalcTextToColumns(UITestCase): self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0) self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content") - def test_text_to_columns_semicolon(self): - #Semicolon as Separator - with self.ui_test.load_file(get_url_for_data_file("text_to_columns_semicolon.ods")) as calc_doc: - gridwin = xCalcDoc.getChild("grid_window") - #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged. - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialogOpt: - - xPages = xDialogOpt.getChild("pages") - xWriterEntry = xPages.getChild('3') # Calc - xWriterEntry.executeAction("EXPAND", tuple()) - xWriterGeneralEntry = xWriterEntry.getChild('0') - xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb - xreplwarncb = xDialogOpt.getChild("replwarncb") - if (get_state_as_dict(xreplwarncb)["Selected"]) == "false": - xreplwarncb.executeAction("CLICK", tuple()) + def test_text_to_columns_semicolon(self): + #Semicolon as Separator + with self.ui_test.load_file(get_url_for_data_file("text_to_columns_semicolon.ods")) as calc_doc: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") # Select A1:A5 on Sheet gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"})) @@ -234,21 +188,11 @@ class CalcTextToColumns(UITestCase): self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0) self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content") - def test_text_to_columns_space(self): - #Space as Separator - with self.ui_test.load_file(get_url_for_data_file("text_to_columns_space.ods")) as calc_doc: - gridwin = xCalcDoc.getChild("grid_window") - #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged. - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialogOpt: - - xPages = xDialogOpt.getChild("pages") - xWriterEntry = xPages.getChild('3') # Calc - xWriterEntry.executeAction("EXPAND", tuple()) - xWriterGeneralEntry = xWriterEntry.getChild('0') - xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb - xreplwarncb = xDialogOpt.getChild("replwarncb") - if (get_state_as_dict(xreplwarncb)["Selected"]) == "false": - xreplwarncb.executeAction("CLICK", tuple()) + def test_text_to_columns_space(self): + #Space as Separator + with self.ui_test.load_file(get_url_for_data_file("text_to_columns_space.ods")) as calc_doc: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") # Select A1:A5 on Sheet gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"})) @@ -302,21 +246,11 @@ class CalcTextToColumns(UITestCase): self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0) self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content") - def test_text_to_columns_pipe(self): - #Space as Separator - with self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe.ods")) as calc_doc: - gridwin = xCalcDoc.getChild("grid_window") - #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged. - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialogOpt: - - xPages = xDialogOpt.getChild("pages") - xWriterEntry = xPages.getChild('3') # Calc - xWriterEntry.executeAction("EXPAND", tuple()) - xWriterGeneralEntry = xWriterEntry.getChild('0') - xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb - xreplwarncb = xDialogOpt.getChild("replwarncb") - if (get_state_as_dict(xreplwarncb)["Selected"]) == "false": - xreplwarncb.executeAction("CLICK", tuple()) + def test_text_to_columns_pipe(self): + #Space as Separator + with self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe.ods")) as calc_doc: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") # Select A1:A5 on Sheet gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"})) @@ -371,21 +305,11 @@ class CalcTextToColumns(UITestCase): self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0) self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content") - def test_text_to_columns_pipespace(self): - #Space as Separator - with self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe_space.ods")) as calc_doc: - gridwin = xCalcDoc.getChild("grid_window") - #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged. - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialogOpt: - - xPages = xDialogOpt.getChild("pages") - xWriterEntry = xPages.getChild('3') # Calc - xWriterEntry.executeAction("EXPAND", tuple()) - xWriterGeneralEntry = xWriterEntry.getChild('0') - xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb - xreplwarncb = xDialogOpt.getChild("replwarncb") - if (get_state_as_dict(xreplwarncb)["Selected"]) == "false": - xreplwarncb.executeAction("CLICK", tuple()) + def test_text_to_columns_pipespace(self): + #Space as Separator + with self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe_space.ods")) as calc_doc: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") # Select A1:A5 on Sheet gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))