diff options
author | Zdenek Crhonek <zcrhonek@gmail.com> | 2018-12-10 08:00:01 +0100 |
---|---|---|
committer | Zdenek Crhonek <zcrhonek@gmail.com> | 2018-12-10 08:59:50 +0100 |
commit | d374834344132f53c96c12234f4b33f437454e3a (patch) | |
tree | 7da1704f7280ac8ae5d937eac890a154f06163a9 /sw | |
parent | 2cfdf00a9a2f9287a822219bc8ab600edf3c0c35 (diff) |
Revert "uitest writer - insert field"
This reverts commit 5743e432e45ed5ed7a4f010a262b2737f1351d3c.
The test is not stable.
Change-Id: I3ad13392ef32ab2d8d305e7a0876014573c79a37
Reviewed-on: https://gerrit.libreoffice.org/64856
Tested-by: Jenkins
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/Module_sw.mk | 1 | ||||
-rw-r--r-- | sw/UITest_fields.mk | 16 | ||||
-rw-r--r-- | sw/qa/uitest/fields/insertField.py | 187 | ||||
-rw-r--r-- | sw/qa/uitest/writer_tests/data/insertField.odt | bin | 7885 -> 0 bytes |
4 files changed, 0 insertions, 204 deletions
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 5e0e69e936ea..ee052eceb24a 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -146,7 +146,6 @@ $(eval $(call gb_Module_add_uicheck_targets,sw,\ UITest_chapterNumbering \ UITest_librelogo \ UITest_options \ - UITest_fields \ )) endif diff --git a/sw/UITest_fields.mk b/sw/UITest_fields.mk deleted file mode 100644 index e0df0c178b8e..000000000000 --- a/sw/UITest_fields.mk +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_UITest_UITest,fields)) - -$(eval $(call gb_UITest_add_modules,fields,$(SRCDIR)/sw/qa/uitest,\ - fields/ \ -)) - -$(eval $(call gb_UITest_set_defs,fields, \ - TDOC="$(SRCDIR)/sw/qa/uitest/writer_tests/data" \ -)) diff --git a/sw/qa/uitest/fields/insertField.py b/sw/qa/uitest/fields/insertField.py deleted file mode 100644 index ab394d097748..000000000000 --- a/sw/qa/uitest/fields/insertField.py +++ /dev/null @@ -1,187 +0,0 @@ -# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -from uitest.framework import UITestCase -import time -from uitest.uihelper.common import get_state_as_dict, type_text -from uitest.debug import sleep -from libreoffice.uno.propertyvalue import mkPropertyValues -from uitest.uihelper.common import select_pos -from uitest.framework import UITestCase -from uitest.path import get_srcdir_url - -def get_url_for_data_file(file_name): - return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name - -class insertField(UITestCase): - - def test_insert_field_document_author(self): - - writer_doc = self.ui_test.load_file(get_url_for_data_file("insertField.odt")) - xWriterDoc = self.xUITest.getTopFocusWindow() - xWriterEdit = xWriterDoc.getChild("writer_edit") - document = self.ui_test.get_component() - - #fill the Options-> User data - self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") - xProperties = self.xUITest.getTopFocusWindow() - - xCompanyText = xProperties.getChild("company") - xCompanyText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xCompanyText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xCompanyText.executeAction("TYPE", mkPropertyValues({"TEXT":"Documentfoundation"})) - - xfirstnameText = xProperties.getChild("firstname") - xfirstnameText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xfirstnameText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xfirstnameText.executeAction("TYPE", mkPropertyValues({"TEXT":"Libre"})) - - xlastnameText = xProperties.getChild("lastname") - xlastnameText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xlastnameText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xlastnameText.executeAction("TYPE", mkPropertyValues({"TEXT":"Office"})) - - xstreetText = xProperties.getChild("street") - xstreetText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xstreetText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xstreetText.executeAction("TYPE", mkPropertyValues({"TEXT":"Street"})) - - xCityText = xProperties.getChild("city") - xCityText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xCityText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xCityText.executeAction("TYPE", mkPropertyValues({"TEXT":"City"})) - - xStateText = xProperties.getChild("state") - xStateText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xStateText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xStateText.executeAction("TYPE", mkPropertyValues({"TEXT":"State"})) - - xZIPText = xProperties.getChild("zip") - xZIPText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xZIPText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xZIPText.executeAction("TYPE", mkPropertyValues({"TEXT":"0000000"})) - - xCountryText = xProperties.getChild("country") - xCountryText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xCountryText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xCountryText.executeAction("TYPE", mkPropertyValues({"TEXT":"Country"})) - - xTitleText = xProperties.getChild("title") - xTitleText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xTitleText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xTitleText.executeAction("TYPE", mkPropertyValues({"TEXT":"Title_prop"})) - - xPositionText = xProperties.getChild("position") - xPositionText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xPositionText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xPositionText.executeAction("TYPE", mkPropertyValues({"TEXT":"position"})) - - xHomephoneText = xProperties.getChild("home") - xHomephoneText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xHomephoneText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xHomephoneText.executeAction("TYPE", mkPropertyValues({"TEXT":"0001"})) - - xWorkphoneText = xProperties.getChild("work") - xWorkphoneText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xWorkphoneText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xWorkphoneText.executeAction("TYPE", mkPropertyValues({"TEXT":"0002"})) - - xFaxText = xProperties.getChild("fax") - xFaxText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xFaxText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xFaxText.executeAction("TYPE", mkPropertyValues({"TEXT":"0003"})) - - xEmailText = xProperties.getChild("email") - xEmailText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xEmailText.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xEmailText.executeAction("TYPE", mkPropertyValues({"TEXT":"email"})) - - xOkBtn = xProperties.getChild("ok") - self.ui_test.close_dialog_through_button(xOkBtn) # save the data in properties dialog - - #check data saved in properties dialog - self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") - xProperties = self.xUITest.getTopFocusWindow() - - xCompanyText = xProperties.getChild("company") - xfirstnameText = xProperties.getChild("firstname") - xlastnameText = xProperties.getChild("lastname") - xstreetText = xProperties.getChild("street") - xCityText = xProperties.getChild("city") - xStateText = xProperties.getChild("state") - xZIPText = xProperties.getChild("zip") - xCountryText = xProperties.getChild("country") - xTitleText = xProperties.getChild("title") - xPositionText = xProperties.getChild("position") - xHomephoneText = xProperties.getChild("home") - xWorkphoneText = xProperties.getChild("work") - xEmailText = xProperties.getChild("email") - xFaxText = xProperties.getChild("fax") - - self.assertEqual(get_state_as_dict(xCompanyText)["Text"], "Documentfoundation") - self.assertEqual(get_state_as_dict(xfirstnameText)["Text"], "Libre") - self.assertEqual(get_state_as_dict(xlastnameText)["Text"], "Office") - self.assertEqual(get_state_as_dict(xstreetText)["Text"], "Street") - self.assertEqual(get_state_as_dict(xCityText)["Text"], "City") - self.assertEqual(get_state_as_dict(xStateText)["Text"], "State") - self.assertEqual(get_state_as_dict(xZIPText)["Text"], "0000000") - self.assertEqual(get_state_as_dict(xTitleText)["Text"], "Title_prop") - self.assertEqual(get_state_as_dict(xPositionText)["Text"], "position") - self.assertEqual(get_state_as_dict(xHomephoneText)["Text"], "0001") - self.assertEqual(get_state_as_dict(xWorkphoneText)["Text"], "0002") - self.assertEqual(get_state_as_dict(xFaxText)["Text"], "0003") - self.assertEqual(get_state_as_dict(xEmailText)["Text"], "email") - - xCancBtn = xProperties.getChild("cancel") - self.ui_test.close_dialog_through_button(xCancBtn) # close the dialog - - # open and close dialog - self.xUITest.executeCommand(".uno:InsertField") - xCrossRef = self.xUITest.getTopFocusWindow() - xTabs = xCrossRef.getChild("tabcontrol") - select_pos(xTabs, "0") - xCloseBtn = xCrossRef.getChild("cancel") - self.ui_test.close_dialog_through_button(xCloseBtn) # close the dialog - #Author ->Name - self.xUITest.executeCommand(".uno:InsertField") - xCrossRef = self.xUITest.getTopFocusWindow() - xTabs = xCrossRef.getChild("tabcontrol") - select_pos(xTabs, "0") - sleep(1) - xTypeListbox = xCrossRef.getChild("type") - select_pos(xTypeListbox, "0") - xSelectListbox = xCrossRef.getChild("select") - select_pos(xSelectListbox, "1") - select_pos(xSelectListbox, "0") - xAddBtn = xCrossRef.getChild("ok") - xAddBtn.executeAction("CLICK", tuple()) # insert the field - xCloseBtn = xCrossRef.getChild("cancel") - xCloseBtn.executeAction("CLICK", tuple()) # close the dialog - self.assertEqual(document.Text.String[0:12], "Libre Office") # assert the field's text Author ->Name - selection = self.xUITest.executeCommand(".uno:SelectAll") #select whole text - self.xUITest.executeCommand(".uno:Cut") #cut text - - #Author ->Initials -# self.xUITest.executeCommand(".uno:InsertField") - self.xUITest.executeCommand(".uno:InsertField") - xCrossRef = self.xUITest.getTopFocusWindow() - xTypeListbox = xCrossRef.getChild("type") - select_pos(xTypeListbox, "0") - sleep(1) - xSelectListbox = xCrossRef.getChild("select") - select_pos(xSelectListbox, "1") - xAddBtn = xCrossRef.getChild("ok") - xAddBtn.executeAction("CLICK", tuple()) # insert the field - xCloseBtn = xCrossRef.getChild("cancel") - xCloseBtn.executeAction("CLICK", tuple()) # close the dialog - self.assertEqual(document.Text.String[0:2], "LO") # assert the field's text Author ->Initials - selection = self.xUITest.executeCommand(".uno:SelectAll") #select whole text - self.xUITest.executeCommand(".uno:Cut") #cut text - - self.ui_test.close_doc() - -# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests/data/insertField.odt b/sw/qa/uitest/writer_tests/data/insertField.odt Binary files differdeleted file mode 100644 index 1653c12e79e6..000000000000 --- a/sw/qa/uitest/writer_tests/data/insertField.odt +++ /dev/null |