[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/spellDialog.py |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit e22a3f596ce50b5166063e217d96ef674a54d380 Author: Mike Kaganski AuthorDate: Sat Dec 28 00:03:09 2019 +0300 Commit: Mike Kaganski CommitDate: Sat Dec 28 00:19:17 2019 +0100 UITest: fix spellDialog.SpellingAndGrammarDialog.test_tdf46852 Two problems were present: 1. If local system default locale is not en_US, then in created document, text has some other language initially; and instrted text also gets this language. This may result in no replacement suggestions for the spelling errors, and "changeall" is not active, so expected sequence of changes and clicks does not happen. Fixed by setting language at cursor before paste explicitly. 2. On Windows, the returned text has \r\n paragraph breaks, which didn't match the regex having \n. Fixed by postprocessing the text before match. Change-Id: I320fc62c3c27dfe699fb45669c081df30cb66d6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85877 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/uitest/writer_tests/spellDialog.py b/uitest/writer_tests/spellDialog.py index 9f69fc2c8fe3..e678afea53e9 100644 --- a/uitest/writer_tests/spellDialog.py +++ b/uitest/writer_tests/spellDialog.py @@ -10,6 +10,7 @@ from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict from libreoffice.linguistic.linguservice import get_spellchecker +from com.sun.star.lang import Locale class SpellingAndGrammarDialog(UITestCase): @@ -62,6 +63,8 @@ frog, dogg, catt""" self.ui_test.create_doc_in_start_center("writer") document = self.ui_test.get_component() cursor = document.getCurrentController().getViewCursor() +# Inserted text must be en_US, so make sure to set language in current location +cursor.CharLocale = Locale("en", "US", "") input_text = self.TDF46852_INPUT.replace('\n', '\r') # \r = para break document.Text.insertString(cursor, input_text, False) @@ -94,5 +97,6 @@ frog, dogg, catt""" ) ) -self.assertTrue(re.match(self.TDF46852_REGEX, document.Text.getString())) +output_text = document.Text.getString().replace('\r\n', '\n') +self.assertTrue(re.match(self.TDF46852_REGEX, output_text)) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/customizeDialog.py | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) New commits: commit b392d126335be68e0b601df39bfb840c4080d606 Author: Muhammet Kara AuthorDate: Fri Nov 8 22:10:23 2019 +0300 Commit: Muhammet Kara CommitDate: Fri Nov 8 21:16:22 2019 +0100 Add UI Test for tdf#128004 Change-Id: Id2b95d21799f8fa4b55a304afda739219fee06ff Reviewed-on: https://gerrit.libreoffice.org/82323 Tested-by: Jenkins Reviewed-by: Muhammet Kara diff --git a/uitest/writer_tests/customizeDialog.py b/uitest/writer_tests/customizeDialog.py index 8b61613a2e31..9d2311eb46a6 100644 --- a/uitest/writer_tests/customizeDialog.py +++ b/uitest/writer_tests/customizeDialog.py @@ -4,10 +4,12 @@ # 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/. +import time + from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict -import time +from uitest.uihelper.common import select_pos from uitest.debug import sleep class ConfigureDialog(UITestCase): @@ -56,4 +58,28 @@ class ConfigureDialog(UITestCase): self.ui_test.close_doc() +def test_category_listbox(self): +self.ui_test.create_doc_in_start_center("writer") +self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog") +xDialog = self.xUITest.getTopFocusWindow() + +xFunc = xDialog.getChild("functions") +xCategory = xDialog.getChild("commandcategorylist") + +initialEntryCount = get_state_as_dict(xFunc)["Children"] +self.assertTrue(initialEntryCount is not 0) + +select_pos(xCategory, "1") +filteredEntryCount = get_state_as_dict(xFunc)["Children"] +self.assertTrue(filteredEntryCount < initialEntryCount) + +select_pos(xCategory, "0") +finalEntryCount = get_state_as_dict(xFunc)["Children"] +self.assertEqual(initialEntryCount, finalEntryCount) + +xcancBtn = xDialog.getChild("cancel") #button Cancel +xcancBtn.executeAction("CLICK", tuple()) #click the button + +self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/autoredactDialog.py | 70 1 file changed, 70 insertions(+) New commits: commit 0a3a24a27bd7ed6792ec49f16a10ea2a05f1402a Author: Muhammet Kara AuthorDate: Fri Jul 12 10:34:31 2019 +0300 Commit: Muhammet Kara CommitDate: Fri Jul 12 10:21:03 2019 +0200 Add test_edit_target to AutoRedactDialog UITest Change-Id: I105ce2e5f4d72369b05f776624979c3e82950757 Reviewed-on: https://gerrit.libreoffice.org/75469 Tested-by: Jenkins Reviewed-by: Muhammet Kara diff --git a/uitest/writer_tests/autoredactDialog.py b/uitest/writer_tests/autoredactDialog.py index 69a6fbef8d20..015081431d7a 100644 --- a/uitest/writer_tests/autoredactDialog.py +++ b/uitest/writer_tests/autoredactDialog.py @@ -9,6 +9,7 @@ from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import type_text from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_text import time import re from uitest.debug import sleep @@ -124,5 +125,74 @@ class AutoRedactDialog(UITestCase): self.ui_test.close_doc() +def test_edit_target(self): +self.ui_test.create_doc_in_start_center("writer") +xDialog = self.launch_and_get_autoredact_dialog() +xAddBtn = xDialog.getChild("add") +xEditBtn = xDialog.getChild("edit") + +# Make sure we are starting with an empty targets list +self.clearTargetsbox(xDialog) + +# We first need to add a target so that we can edit it +def handle_add_dlg(dialog): #handle add target dialog - need special handling +xNewNameTxt=dialog.getChild("name") +xNewContentTxt=dialog.getChild("content") +xOKBtn = dialog.getChild("close") +xTypeList = dialog.getChild("type") #0: Text, 1: Regex, 2: Predefined + +select_pos(xTypeList, 0) #Text + self.assertEqual(int(get_state_as_dict(xTypeList)["SelectEntryPos"]), 0) + +type_text(xNewNameTxt, "TestTarget") +type_text(xNewContentTxt, "TestContent") + +self.ui_test.close_dialog_through_button(xOKBtn) + +self.ui_test.execute_blocking_action(xAddBtn.executeAction, args=('CLICK', ()), +dialog_handler=handle_add_dlg) #close add target dialog with OK button + +# Make sure target is added successfully +xTargetsListbox = xDialog.getChild("targets") +targets_box_state_dict = get_state_as_dict(xTargetsListbox) +self.assertEqual(int(targets_box_state_dict["Children"]), 1) + +# Select the added target +target_entry = xTargetsListbox.getChild(0) +target_entry.executeAction("SELECT", tuple()) + +# Now edit the target +def handle_edit_dlg(dialog): #handle add target dialog - need special handling +xNameTxt=dialog.getChild("name") +xContentTxt=dialog.getChild("content") +xOKBtn = dialog.getChild("close") + +xNameTxt.executeAction("CLEAR", tuple()) +xContentTxt.executeAction("CLEAR", tuple()) + +type_text(xNameTxt, "TestTargetEdited") +type_text(xContentTxt, "TestContentEdited") + +self.ui_test.close_dialog_through_button(xOKBtn) + +self.ui_test.execute_blocking_action(xEditBtn.executeAction, args=('CLICK', ()), +dialog_handler=handle_edit_dlg) #close add target dialog with OK button + +# Make sure target is still there +xTargetsListbox = xDialog.getChild("targets") +targets_box_state_dict = get_state_as_dict(xTargetsListbox) +self.assertEqual(int(targets_box_state_dict["Children"]), 1) + +# Make sure target has the new values +target_entry = xTargetsListbox.getChild(0) +target_text = self.parseTargetContent(target_entry) +self.assertEqual(target_text[0], "TestTargetEdited") #name +self.assertEqual(target_text[2], "TestContentEdited") #content + +xcancBtn = xDialog.getChild("cancel") +self.ui_test.close_dialog_through_button(xcancBtn) + +self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/autoredactDialog.py | 128 1 file changed, 128 insertions(+) New commits: commit 11b60ba223b3667eb4718e160c9c14072c07a5c7 Author: Muhammet Kara AuthorDate: Thu Jul 11 17:06:08 2019 +0300 Commit: Muhammet Kara CommitDate: Fri Jul 12 09:26:02 2019 +0200 Add UITest for AutoRedactDialog Includes: * test_open_AutoRedactDialog_writer() * test_add_target() Change-Id: Ia70f4cdf01f8a69aa42d0514eecc20d2a2ada530 Reviewed-on: https://gerrit.libreoffice.org/75429 Tested-by: Jenkins Reviewed-by: Muhammet Kara diff --git a/uitest/writer_tests/autoredactDialog.py b/uitest/writer_tests/autoredactDialog.py new file mode 100644 index ..69a6fbef8d20 --- /dev/null +++ b/uitest/writer_tests/autoredactDialog.py @@ -0,0 +1,128 @@ +# -*- 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 +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.common import type_text +from uitest.uihelper.common import select_pos +import time +import re +from uitest.debug import sleep + +class AutoRedactDialog(UITestCase): + +add_target_counter = 0 + +# Open the Auto Redact Dialog +def launch_and_get_autoredact_dialog(self): +self.ui_test.execute_dialog_through_command(".uno:AutoRedactDoc") +xDialog = self.xUITest.getTopFocusWindow() +self.assertTrue(xDialog is not None) +return xDialog + +def getText(self, xObj): +return get_state_as_dict(xObj)["Text"] + +def parseTargetContent(self, xObj): +return re.split(r'\t+', self.getText(xObj)) + +def clearTargetsbox(self, xDialog): +xTargetsListbox = xDialog.getChild("targets") +xDeleteBtn = xDialog.getChild("delete") + +child_count = len(xTargetsListbox.getChildren()) + +if child_count < 1: +return + +for i in range(0, child_count): +child = xTargetsListbox.getChild(0) +child.executeAction("SELECT", tuple()) +xDeleteBtn.executeAction("CLICK", tuple()) + +# Verify +self.assertEqual(len(xTargetsListbox.getChildren()), 0) + + +def test_open_AutoRedactDialog_writer(self): +self.ui_test.create_doc_in_start_center("writer") +xDialog = self.launch_and_get_autoredact_dialog() +xcancBtn = xDialog.getChild("cancel") +self.ui_test.close_dialog_through_button(xcancBtn) +self.ui_test.close_doc() + +def test_add_target(self): +self.ui_test.create_doc_in_start_center("writer") +xDialog = self.launch_and_get_autoredact_dialog() +xAddBtn = xDialog.getChild("add") + +# Make sure we are starting with an empty targets list +self.clearTargetsbox(xDialog) + +# Names need to be distinct +# ["target name", "target content"], +targets_list = [ +["target1", "content1"], +["target2", "content2"], +["target3", "content3"], +] + +def handle_add_dlg(dialog): #handle add target dialog - need special handling +xNewNameTxt=dialog.getChild("name") +xNewContentTxt=dialog.getChild("content") +xOKBtn = dialog.getChild("close") +xTypeList = dialog.getChild("type") #0: Text, 1: Regex, 2: Predefined + +select_pos(xTypeList, 0) #Text + self.assertEqual(int(get_state_as_dict(xTypeList)["SelectEntryPos"]), 0) + +type_text(xNewNameTxt, targets_list[self.add_target_counter][0]) +type_text(xNewContentTxt, targets_list[self.add_target_counter][1]) + +self.ui_test.close_dialog_through_button(xOKBtn) + +for i in range(0, len(targets_list)): +self.add_target_counter = i +self.ui_test.execute_blocking_action(xAddBtn.executeAction, args=('CLICK', ()), +dialog_handler=handle_add_dlg) #close add target dialog with OK button + +# Make sure targets are added successfully +xTargetsListbox = xDialog.getChild("targets") +targets_box_state_dict = get_state_as_dict(xTargetsListbox) +self.assertEqual(int(targets_box_state_dict["Children"]), len(targets_list)) + +# Make sure targets are added with correct names and contents +for i in range(0, len(targets_list)): +child = xTargetsListbox.getChild(i) +child_text = self.parseTargetContent(child) +self.assertEqual(child_text[0], targets_list[i][0]) #name +self.assertEqual(child_text[2], targets_list[i][1]) #content + +xcancBtn = xDialog.getChild("canc
[Libreoffice-commits] core.git: uitest/writer_tests vcl/source
uitest/writer_tests/customizeDialog.py | 56 + vcl/source/uitest/uiobject.cxx |6 +++ 2 files changed, 62 insertions(+) New commits: commit 89a3f789de928a08650de03681c45cbf544889ad Author: Muhammet Kara Date: Wed Apr 18 12:27:15 2018 +0300 Add UI test for the Customize dialog Change-Id: I00109ef54ec7cfc1f4976794daa92ded3cd6ce4b Reviewed-on: https://gerrit.libreoffice.org/53119 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/uitest/writer_tests/customizeDialog.py b/uitest/writer_tests/customizeDialog.py new file mode 100644 index ..e6fef69cb50e --- /dev/null +++ b/uitest/writer_tests/customizeDialog.py @@ -0,0 +1,56 @@ +# -*- 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 +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict +import time +from uitest.debug import sleep + +class ConfigureDialog(UITestCase): + +def test_open_ConfigureDialog_writer(self): + +self.ui_test.create_doc_in_start_center("writer") +self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog") +xDialog = self.xUITest.getTopFocusWindow() + +xcancBtn = xDialog.getChild("cancel") +xcancBtn.executeAction("CLICK", tuple()) + +self.ui_test.close_doc() + +def test_search_filter(self): +self.ui_test.create_doc_in_start_center("writer") +self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog") +xDialog = self.xUITest.getTopFocusWindow() + +xfunc = xDialog.getChild("functions") +xSearch = xDialog.getChild("searchEntry") + +initialEntryCount = get_state_as_dict(xfunc)["Children"] +self.assertTrue(initialEntryCount is not 0) + +xSearch.executeAction("SET", mkPropertyValues({"TEXT":"format"})) + +# Wait for the search/filter op to be completed +time.sleep(1) + +filteredEntryCount = get_state_as_dict(xfunc)["Children"] +self.assertTrue(filteredEntryCount < initialEntryCount) + +xSearch.executeAction("CLEAR", tuple()) + +finalEntryCount = get_state_as_dict(xfunc)["Children"] +self.assertEqual(initialEntryCount, finalEntryCount) + + +xcancBtn = xDialog.getChild("cancel") #button Cancel +xcancBtn.executeAction("CLICK", tuple()) #click the button + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index adf26cbb2ac8..e5ac0895dea8 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -659,6 +659,12 @@ void EditUIObject::execute(const OUString& rAction, mxEdit->SetSelection(aSelection); } } +else if (rAction == "CLEAR") +{ +mxEdit->SetText(""); +mxEdit->UpdateData(); +bHandled = true; +} else { bHandled = false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/data/3pages.odt |binary 1 file changed New commits: commit b03f7cdc04f9df778e2da93eadfe1d44f7665caf Author: Rene Engelhard Date: Sat Nov 25 15:27:25 2017 +0100 fix uitest/writer_tests/data/3pages.odt This in uitest/writer_tests/goToPage.py is supposed to be a uitest for "go to page 2 and 3" but uses hardoded enters until page flips over. Looks overly flaky to me. Replaced by proper page breaks Change-Id: I8c0ea5809bd24d4122cfd956fcd048af97c01480 diff --git a/uitest/writer_tests/data/3pages.odt b/uitest/writer_tests/data/3pages.odt index 73097d91305e..0f2512903981 100644 Binary files a/uitest/writer_tests/data/3pages.odt and b/uitest/writer_tests/data/3pages.odt differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/data/3pages.odt |binary uitest/writer_tests/goToPage.py | 40 2 files changed, 40 insertions(+) New commits: commit ee64bf10051f9dce5c9983e715e7dce9b3ca1535 Author: ZdenÄk Crhonek Date: Mon Nov 20 22:31:02 2017 +0100 uitest - writer Go to page dialog Change-Id: I3088bb4b802b533db46dc3ab1d9d2fd241aa1fb0 Reviewed-on: https://gerrit.libreoffice.org/45009 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/uitest/writer_tests/data/3pages.odt b/uitest/writer_tests/data/3pages.odt new file mode 100644 index ..73097d91305e Binary files /dev/null and b/uitest/writer_tests/data/3pages.odt differ diff --git a/uitest/writer_tests/goToPage.py b/uitest/writer_tests/goToPage.py new file mode 100644 index ..63a21f04d840 --- /dev/null +++ b/uitest/writer_tests/goToPage.py @@ -0,0 +1,40 @@ +# +# 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 +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict +import time +from uitest.path import get_srcdir_url + +def get_url_for_data_file(file_name): +return get_srcdir_url() + "/uitest/writer_tests/data/" + file_name + +class GoToPage_dialog(UITestCase): + + def test_go_to_page(self): +writer_doc = self.ui_test.load_file(get_url_for_data_file("3pages.odt")) +xWriterDoc = self.xUITest.getTopFocusWindow() +xWriterEdit = xWriterDoc.getChild("writer_edit") + +self.ui_test.execute_dialog_through_command(".uno:GotoPage") +xDialog = self.xUITest.getTopFocusWindow() +xPageText = xDialog.getChild("page") +xPageText.executeAction("TYPE", mkPropertyValues({"TEXT":"2"})) +xOkBtn = xDialog.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2") + +self.ui_test.execute_dialog_through_command(".uno:GotoPage") +xDialog = self.xUITest.getTopFocusWindow() +xPageText = xDialog.getChild("page") +xPageText.executeAction("TYPE", mkPropertyValues({"TEXT":"3a"})) +xOkBtn = xDialog.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "3") + +self.ui_test.close_doc() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/spellDialog.py | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) New commits: commit a00520d3ccf762154c2332a3941e072a604ac7aa Author: David Tardon Date: Fri Oct 13 09:31:26 2017 +0200 don't assume concrete spelling substitutions E.g., on my F-27 with system hunspell 1.5.4, the substitutions are dogg -> dodgy catt -> cat frogg -> frog which causes the test to fail... Change-Id: I6d192fcc74629c2f3b9d4780576499c47de96b26 diff --git a/uitest/writer_tests/spellDialog.py b/uitest/writer_tests/spellDialog.py index a5c2d5c7e7e2..9f69fc2c8fe3 100644 --- a/uitest/writer_tests/spellDialog.py +++ b/uitest/writer_tests/spellDialog.py @@ -4,6 +4,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # +import re + from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict @@ -41,14 +43,14 @@ frogg catt dogg dogg catt frog, dogg, catt""" -TDF46852_CORRECTED = """\ -dog -dog -tact dog -frog frog -frog tact dog -dog tact -frog, dog, tact""" +TDF46852_REGEX = """\ +([a-z]+) +\\1 +([a-z]+) \\1 +([a-z]+) \\3 +\\3 \\2 \\1 +\\1 \\2 +\\3, \\1, \\2""" def test_tdf46852(self): supported_locale = self.is_supported_locale("en", "US") @@ -92,5 +94,5 @@ frog, dog, tact""" ) ) -self.assertEqual(document.Text.getString(), self.TDF46852_CORRECTED) +self.assertTrue(re.match(self.TDF46852_REGEX, document.Text.getString())) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/spellDialog.py |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) New commits: commit a9e126204719cbec919cff0114e360d6d6939a5c Author: Stephan Bergmann Date: Tue Aug 8 15:59:55 2017 +0200 Fix UITest_writer_demo with --enable-ext-languagetool ...which would insert requests to fix duplicate "frog frog" and capitalize "frog" at the start of a paragraph, confusing test_tdf46852 Change-Id: I76704af9e2e87ffdb3093ae68f0949b67ef9bf9b diff --git a/uitest/writer_tests/spellDialog.py b/uitest/writer_tests/spellDialog.py index 41453fac2f33..a5c2d5c7e7e2 100644 --- a/uitest/writer_tests/spellDialog.py +++ b/uitest/writer_tests/spellDialog.py @@ -5,6 +5,7 @@ # from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict from libreoffice.linguistic.linguservice import get_spellchecker @@ -66,8 +67,13 @@ frog, dog, tact""" cursor.goUp(2, False) cursor.goLeft(1, False) -# Step 3: Initiate spellchecking +# Step 3: Initiate spellchecking, and make sure "Check grammar" is +# unchecked spell_dialog = self.launch_dialog() +checkgrammar = spell_dialog.getChild('checkgrammar') +if get_state_as_dict(checkgrammar)['Selected'] == 'true': +checkgrammar.executeAction('CLICK', ()) +self.assertTrue(get_state_as_dict(checkgrammar)['Selected'] == 'false') # Step 4: Repetitively click on "Correct all" for each misspelling # prompt until end of document is reached. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/pageDialog.py | 35 +++ 1 file changed, 31 insertions(+), 4 deletions(-) New commits: commit 134effd2494132495d0adb5453b8ddd9f803704e Author: Xisco Fauli Date: Thu Jun 15 17:32:58 2017 +0200 uitest: test page orientation Change-Id: I265730664cf7dfb1d4a105023ae1e3b4c1fca4f5 Reviewed-on: https://gerrit.libreoffice.org/38838 Reviewed-by: Xisco Faulà Tested-by: Jenkins diff --git a/uitest/writer_tests/pageDialog.py b/uitest/writer_tests/pageDialog.py index 88145e7a1b23..0845778d54a7 100644 --- a/uitest/writer_tests/pageDialog.py +++ b/uitest/writer_tests/pageDialog.py @@ -5,7 +5,7 @@ # from uitest.framework import UITestCase -from uitest.uihelper.common import select_pos +from uitest.uihelper.common import select_pos, get_state_as_dict from com.sun.star.uno import RuntimeException from com.sun.star.awt.GradientStyle import LINEAR from com.sun.star.drawing.HatchStyle import SINGLE @@ -14,8 +14,6 @@ from com.sun.star.drawing.RectanglePoint import MIDDLE_MIDDLE from libreoffice.uno.propertyvalue import mkPropertyValues -from uitest.uihelper.common import get_state_as_dict - class WriterPageDialog(UITestCase): def launch_dialog_and_select_tab(self, tab): @@ -149,7 +147,7 @@ class WriterPageDialog(UITestCase): self.ui_test.close_doc() -def test_page_tab(self): +def test_paper_format(self): lPaperFormat = ["A6", "A5", "A4", "A3", "B6 (ISO)", "B5 (ISO)", "B4 (ISO)", "Letter", "Legal", "Long Bond", "Tabloid", "B6 (JIS)", "B5 (JIS)", "B4 (JIS)", "16 Kai", @@ -173,4 +171,33 @@ class WriterPageDialog(UITestCase): self.ui_test.close_doc() +def test_orientation(self): + +self.ui_test.create_doc_in_start_center("writer") + +document = self.ui_test.get_component() + +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.IsLandscape, False) + +xDialog = self.launch_dialog_and_select_tab(1) + +self.click_button(xDialog, 'radiobuttonLandscape') + +self.click_button(xDialog, 'ok') + +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.IsLandscape, True) + +xDialog = self.launch_dialog_and_select_tab(1) + +self.click_button(xDialog, 'radiobuttonPortrait') + +self.click_button(xDialog, 'ok') + +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.IsLandscape, False) + +self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/pageDialog.py | 26 ++ 1 file changed, 26 insertions(+) New commits: commit 0254e70f99e6d0e96ef3e6cd7da173bcad7c933d Author: Xisco Fauli Date: Thu Jun 15 17:53:37 2017 +0200 uitest: Test text direction Change-Id: I66943e432eadedaf4a1bc362861ea8be67b076c3 Reviewed-on: https://gerrit.libreoffice.org/38839 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/pageDialog.py b/uitest/writer_tests/pageDialog.py index 0845778d54a7..84284f61dd45 100644 --- a/uitest/writer_tests/pageDialog.py +++ b/uitest/writer_tests/pageDialog.py @@ -200,4 +200,30 @@ class WriterPageDialog(UITestCase): self.ui_test.close_doc() +def test_text_direction(self): + +lTextDirection = ['Left-to-right (horizontal)', 'Right-to-left (horizontal)', +'Right-to-left (vertical)', 'Left-to-right (vertical)'] + +self.ui_test.create_doc_in_start_center("writer") + +document = self.ui_test.get_component() + +for i in range(4): +with self.subTest(i=i): +xDialog = self.launch_dialog_and_select_tab(1) + +xTextDirectionList = xDialog.getChild("comboTextFlowBox") +select_pos(xTextDirectionList, str(i)) + +self.assertEqual( +get_state_as_dict(xTextDirectionList)["SelectEntryText"], lTextDirection[i]) + +self.click_button(xDialog, 'ok') + +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.WritingMode, i) + +self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/pageDialog.py | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) New commits: commit 3459f778012d376e746be442167e2b85de18d6cc Author: Xisco Fauli Date: Wed Jun 14 14:46:12 2017 +0200 uitest: Using dimensions in assert isn't a good idea... ... as they're normally not equal across platforms and machines At least, check the paper format we choose Change-Id: I7f1047157f3b6135c2a037b9cc783889d17d3072 Reviewed-on: https://gerrit.libreoffice.org/38785 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/pageDialog.py b/uitest/writer_tests/pageDialog.py index 3f608cee97af..88145e7a1b23 100644 --- a/uitest/writer_tests/pageDialog.py +++ b/uitest/writer_tests/pageDialog.py @@ -14,7 +14,7 @@ from com.sun.star.drawing.RectanglePoint import MIDDLE_MIDDLE from libreoffice.uno.propertyvalue import mkPropertyValues -import unittest +from uitest.uihelper.common import get_state_as_dict class WriterPageDialog(UITestCase): @@ -149,34 +149,27 @@ class WriterPageDialog(UITestCase): self.ui_test.close_doc() -@unittest.skip("Currently broken") def test_page_tab(self): -size_list = [[10500,14801], [14801,21001], [21001,29700], [29700,42000], -[12501,17600], [17600,25000], [25000,35301], [21590,27940], -[21590,35560], [21590,33020], [27940,43180], [12801,18200], -[18200,25700], [25700,36400], [18399,26000], [13000,18399], -[14000,20301], [14000,20301], [11000,21999], [11400,16200], -[11400,22901], [16200,22901], [22901,32401], [9208,16510], -[9843,19050], [9843,22543], [10478,24130], [11430,26353]] +lPaperFormat = ["A6", "A5", "A4", "A3", "B6 (ISO)", "B5 (ISO)", "B4 (ISO)", "Letter", +"Legal", "Long Bond", "Tabloid", "B6 (JIS)", "B5 (JIS)", "B4 (JIS)", "16 Kai", +"32 Kai", "Big 32 Kai", "User", "DL Envelope", "C6 Envelope", "C6/5 Envelope", +"C5 Envelope", "C4 Envelope", "#6¾ Envelope", "#7¾ (Monarch) Envelope", +"#9 Envelope", "#10 Envelope", "#11 Envelope", "#12 Envelope", "Japanese Postcard"] self.ui_test.create_doc_in_start_center("writer") -for i in range(28): +for i in range(30): with self.subTest(i=i): xDialog = self.launch_dialog_and_select_tab(1) xFormatList = xDialog.getChild("comboPageFormat") select_pos(xFormatList, str(i)) -self.click_button(xDialog, 'ok') - -document = self.ui_test.get_component() - self.assertEqual( -document.StyleFamilies.PageStyles.Standard.Width, size_list[i][0]) -self.assertEqual( -document.StyleFamilies.PageStyles.Standard.Height, size_list[i][1]) +get_state_as_dict(xFormatList)["SelectEntryText"], lPaperFormat[i]) + +self.click_button(xDialog, 'ok') self.ui_test.close_doc() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/insertPageHeader.py | 72 1 file changed, 72 insertions(+) New commits: commit 6db84250d1c4e7ec5a54ff75e124ea9a84ff89d9 Author: Xisco Fauli Date: Wed Jun 14 10:38:05 2017 +0200 uitest: Add test for insertPageHeader and tdf#107427 Change-Id: I8dd7c1a802b021392f25e92d25d9122082f17722 Reviewed-on: https://gerrit.libreoffice.org/38770 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/insertPageHeader.py b/uitest/writer_tests/insertPageHeader.py new file mode 100644 index ..d510e726e669 --- /dev/null +++ b/uitest/writer_tests/insertPageHeader.py @@ -0,0 +1,72 @@ +# +# 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 + +class WriterInsertPageHeader(UITestCase): + +def insert_header(self): +document = self.ui_test.get_component() + +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False) + +self.xUITest.executeCommand( + ".uno:InsertPageHeader?PageStyle:string=Default%20Style&On:bool=true") + +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True) + +def delete_header(self): +document = self.ui_test.get_component() + +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True) + +self.ui_test.execute_dialog_through_command( + ".uno:InsertPageHeader?PageStyle:string=Default%20Style&On:bool=false") + +xDialog = self.xUITest.getTopFocusWindow() + +xOption = xDialog.getChild("yes") +xOption.executeAction("CLICK", tuple()) + +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False) + +def test_header(self): +self.ui_test.create_doc_in_start_center("writer") + +self.insert_header() + +self.delete_header() + +self.ui_test.close_doc() + +def test_tdf107427(self): +self.ui_test.create_doc_in_start_center("writer") + +self.insert_header() + +self.ui_test.execute_dialog_through_command(".uno:InsertTable") + +xInsertDlg = self.xUITest.getTopFocusWindow() + +xOkBtn = xInsertDlg.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +document = self.ui_test.get_component() + +tables = document.getTextTables() +self.assertEqual(len(tables[0].getRows()), 2) +self.assertEqual(len(tables[0].getColumns()), 2) + +self.xUITest.executeCommand(".uno:SelectAll") + +self.delete_header() + +self.ui_test.close_doc() + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/pageDialog.py |3 +++ 1 file changed, 3 insertions(+) New commits: commit e05f16e6bf36efbaab16dd2ed1427a750ce7cafd Author: Markus Mohrhard Date: Wed Jun 14 07:34:31 2017 +0200 disable UI test that does exact comparison Change-Id: I3e66a0574f6833fcd45a95a336fc07b523c0011c diff --git a/uitest/writer_tests/pageDialog.py b/uitest/writer_tests/pageDialog.py index 738f799f852b..3f608cee97af 100644 --- a/uitest/writer_tests/pageDialog.py +++ b/uitest/writer_tests/pageDialog.py @@ -14,6 +14,8 @@ from com.sun.star.drawing.RectanglePoint import MIDDLE_MIDDLE from libreoffice.uno.propertyvalue import mkPropertyValues +import unittest + class WriterPageDialog(UITestCase): def launch_dialog_and_select_tab(self, tab): @@ -147,6 +149,7 @@ class WriterPageDialog(UITestCase): self.ui_test.close_doc() +@unittest.skip("Currently broken") def test_page_tab(self): size_list = [[10500,14801], [14801,21001], [21001,29700], [29700,42000], ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/pageDialog.py | 83 ++ 1 file changed, 58 insertions(+), 25 deletions(-) New commits: commit a7309f17b34b97816b7d8f9ada5e8563d033aa82 Author: Xisco Fauli Date: Tue Jun 13 14:56:31 2017 +0200 uitest: Check default paper formats Change-Id: Iaf889339f6a757fa5a3e992fb4438df842ea76eb Reviewed-on: https://gerrit.libreoffice.org/38738 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/backgrounds.py b/uitest/writer_tests/pageDialog.py similarity index 72% rename from uitest/writer_tests/backgrounds.py rename to uitest/writer_tests/pageDialog.py index da49a7526dc2..738f799f852b 100644 --- a/uitest/writer_tests/backgrounds.py +++ b/uitest/writer_tests/pageDialog.py @@ -12,11 +12,26 @@ from com.sun.star.drawing.HatchStyle import SINGLE from com.sun.star.drawing.BitmapMode import REPEAT from com.sun.star.drawing.RectanglePoint import MIDDLE_MIDDLE -class WriterBackgrounds(UITestCase): +from libreoffice.uno.propertyvalue import mkPropertyValues -def checkDefaultBackground(self, btn): +class WriterPageDialog(UITestCase): + +def launch_dialog_and_select_tab(self, tab): +self.ui_test.execute_dialog_through_command(".uno:PageDialog") + +xDialog = self.xUITest.getTopFocusWindow() +tabcontrol = xDialog.getChild("tabcontrol") +select_pos(tabcontrol, str(tab)) + +return xDialog + +def click_button(self, dialog, button): +xButton = dialog.getChild(button) +xButton.executeAction("CLICK", tuple()) + +def check_default_area(self, btn): document = self.ui_test.get_component() -if btn == 'btnnone': +if btn == 'btnnone': self.assertEqual( document.StyleFamilies.PageStyles.Standard.BackColor, -1) elif btn == 'btncolor': @@ -107,41 +122,59 @@ class WriterBackgrounds(UITestCase): self.assertEqual( document.StyleFamilies.PageStyles.Standard.FillBitmapName, '5 Percent') - -def test_background_dialog(self): +def test_area_tab(self): self.ui_test.create_doc_in_start_center("writer") buttons = ['btnbitmap', 'btncolor', 'btngradient', 'btnhatch', 'btnpattern'] for index, button in enumerate(buttons): -self.ui_test.execute_dialog_through_command(".uno:PageStyleName") -xPageStyleDlg = self.xUITest.getTopFocusWindow() -tabcontrol = xPageStyleDlg.getChild("tabcontrol") -select_pos(tabcontrol, "2") +xDialog = self.launch_dialog_and_select_tab(2) + +self.click_button(xDialog, button) + +self.click_button(xDialog, 'ok') + +self.check_default_area(button) -xBtn = xPageStyleDlg.getChild(button) -xBtn.executeAction("CLICK", tuple()) +xDialog = self.launch_dialog_and_select_tab(2) + +self.click_button(xDialog, 'btnnone') + +self.click_button(xDialog, 'ok') + +self.check_default_area('btnnone') + +self.ui_test.close_doc() + +def test_page_tab(self): + +size_list = [[10500,14801], [14801,21001], [21001,29700], [29700,42000], +[12501,17600], [17600,25000], [25000,35301], [21590,27940], +[21590,35560], [21590,33020], [27940,43180], [12801,18200], +[18200,25700], [25700,36400], [18399,26000], [13000,18399], +[14000,20301], [14000,20301], [11000,21999], [11400,16200], +[11400,22901], [16200,22901], [22901,32401], [9208,16510], +[9843,19050], [9843,22543], [10478,24130], [11430,26353]] + +self.ui_test.create_doc_in_start_center("writer") -xOkBtn = xPageStyleDlg.getChild("ok") -xOkBtn.executeAction("CLICK", tuple()) +for i in range(28): +with self.subTest(i=i): +xDialog = self.launch_dialog_and_select_tab(1) -self.checkDefaultBackground(button) - -self.ui_test.execute_dialog_through_command(".uno:PageStyleName") +xFormatList = xDialog.getChild("comboPageFormat") +select_pos(xFormatList, str(i)) -xPageStyleDlg = self.xUITest.getTopFocusWindow() -tabcontrol = xPageStyleDlg.getChild("tabcontrol") -select_pos(tabcontrol, "2") +self.click_button(xDialog, 'ok') -xBtn = xPageStyleDlg.getChild('btnnone') -xBtn.executeAction("CLICK", tuple()) +document = self.ui_test.get_component() -xOkBtn = xPageStyleDlg.getChild("ok") -xOkBtn.executeAction("CLICK", tuple()) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.Width, size_list[i][0]) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.Height, size_list[i][1]) -
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/insertBreakDialog.py | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) New commits: commit 3c641c9c1f2ec01a9ae61e955ceb69c52e45f31e Author: Xisco Fauli Date: Tue Jun 13 16:06:59 2017 +0200 uitest: Use subtest here Change-Id: I0e54b950412b4130bb4155d93af2ccafb03d2950 Reviewed-on: https://gerrit.libreoffice.org/38744 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/insertBreakDialog.py b/uitest/writer_tests/insertBreakDialog.py index 47e073d297ad..1ec61aff2368 100644 --- a/uitest/writer_tests/insertBreakDialog.py +++ b/uitest/writer_tests/insertBreakDialog.py @@ -56,15 +56,16 @@ class WriterInsertBreakDialog(UITestCase): self.ui_test.create_doc_in_start_center("writer") for i in range(9): -xDialog = self.launch_dialog_and_select_option("pagerb") +with self.subTest(i=i): +xDialog = self.launch_dialog_and_select_option("pagerb") -xStyleList = xDialog.getChild("stylelb") -xStyleList.executeAction("SELECT", mkPropertyValues({"POS": str(i)})) +xStyleList = xDialog.getChild("stylelb") +xStyleList.executeAction("SELECT", mkPropertyValues({"POS": str(i)})) -xOkBtn = xDialog.getChild("ok") -xOkBtn.executeAction("CLICK", tuple()) +xOkBtn = xDialog.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) -self.getPages(i + 2) +self.getPages(i + 2) self.ui_test.close_doc() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/insertBreakDialog.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit afb8a2f49149fb407cc4a8d99a4b4a6f8a6b553a Author: Xisco Fauli Date: Wed Jun 7 14:24:29 2017 +0200 Fix uitest failure It doesn't break for me locally Change-Id: I61957fe4e7699937d17b74e8655efe2a6d1f6e6a Reviewed-on: https://gerrit.libreoffice.org/38502 Tested-by: Michael Stahl Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/insertBreakDialog.py b/uitest/writer_tests/insertBreakDialog.py index bdb4568e77c8..47e073d297ad 100644 --- a/uitest/writer_tests/insertBreakDialog.py +++ b/uitest/writer_tests/insertBreakDialog.py @@ -55,7 +55,7 @@ class WriterInsertBreakDialog(UITestCase): self.ui_test.create_doc_in_start_center("writer") -for i in range(11): +for i in range(9): xDialog = self.launch_dialog_and_select_option("pagerb") xStyleList = xDialog.getChild("stylelb") ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/insertBreakDialog.py | 71 +++ 1 file changed, 71 insertions(+) New commits: commit ed11b38a7efd3dafb9866327aa9c8e9ad1e73045 Author: Xisco Fauli Date: Tue Jun 6 23:03:54 2017 +0200 uitest: InsertBreak dialog Change-Id: Iab997ecedd11167cc079b3c5e3c4308383439448 Reviewed-on: https://gerrit.libreoffice.org/38468 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/insertBreakDialog.py b/uitest/writer_tests/insertBreakDialog.py new file mode 100644 index ..bdb4568e77c8 --- /dev/null +++ b/uitest/writer_tests/insertBreakDialog.py @@ -0,0 +1,71 @@ +# +# 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 +from libreoffice.uno.propertyvalue import mkPropertyValues + +class WriterInsertBreakDialog(UITestCase): + +def launch_dialog_and_select_option(self, child): + +self.ui_test.execute_dialog_through_command(".uno:InsertBreak") +xDialog = self.xUITest.getTopFocusWindow() + +xOption = xDialog.getChild(child) +xOption.executeAction("CLICK", tuple()) + +return xDialog + +def getPages(self, total): +document = self.ui_test.get_component() + +xCursor = document.getCurrentController().getViewCursor() +xCursor.jumpToLastPage() + +self.assertEqual(xCursor.getPage(), total) + +def test_insert_line_break(self): + +self.ui_test.create_doc_in_start_center("writer") + +xDialog = self.launch_dialog_and_select_option("linerb") +xOkBtn = xDialog.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +self.getPages(1) + +self.ui_test.close_doc() + +def test_insert_column_break(self): + +self.ui_test.create_doc_in_start_center("writer") + +xDialog = self.launch_dialog_and_select_option("columnrb") +xOkBtn = xDialog.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +self.getPages(1) + +self.ui_test.close_doc() + +def test_insert_page_break(self): + +self.ui_test.create_doc_in_start_center("writer") + +for i in range(11): +xDialog = self.launch_dialog_and_select_option("pagerb") + +xStyleList = xDialog.getChild("stylelb") +xStyleList.executeAction("SELECT", mkPropertyValues({"POS": str(i)})) + +xOkBtn = xDialog.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +self.getPages(i + 2) + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/insertTableDialog.py | 121 +++ uitest/writer_tests/tdf104158.py | 37 - uitest/writer_tests/tdf80663.py | 40 -- uitest/writer_tests/tdf87199.py | 56 -- uitest/writer_tests/tdf96067.py | 45 --- 5 files changed, 121 insertions(+), 178 deletions(-) New commits: commit dcd407d5227019371d3a261cd683bc9bbf1ae09e Author: Xisco Fauli Date: Wed Jun 7 00:34:16 2017 +0200 uitest: Combine all table tests in one file Change-Id: Ief374a02eabed4587874cb6182742ae86c084d62 Reviewed-on: https://gerrit.libreoffice.org/38474 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/insertTableDialog.py b/uitest/writer_tests/insertTableDialog.py new file mode 100644 index ..60bd9d3342a6 --- /dev/null +++ b/uitest/writer_tests/insertTableDialog.py @@ -0,0 +1,121 @@ +# +# 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 +from libreoffice.uno.propertyvalue import mkPropertyValues + +class WriterInsertTableDialog(UITestCase): + +def insert_table(self, name, rows, cols): + +self.ui_test.create_doc_in_start_center("writer") + +self.ui_test.execute_dialog_through_command(".uno:InsertTable") +xDialog = self.xUITest.getTopFocusWindow() + +xNameEdit = xDialog.getChild("nameedit") + +xNameEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) +xNameEdit.executeAction("TYPE", mkPropertyValues({"TEXT": name})) + +xColSpin = xDialog.getChild("colspin") +xColSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) +xColSpin.executeAction("TYPE", mkPropertyValues({"TEXT": str(cols)})) + +xRowSpin = xDialog.getChild("rowspin") +xRowSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) +xRowSpin.executeAction("TYPE", mkPropertyValues({"TEXT": str(rows)})) + +xOkBtn = xDialog.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +document = self.ui_test.get_component() + +tables = document.getTextTables() + +self.assertEqual(tables[0].getName(), name) +self.assertEqual(len(tables[0].getRows()), rows) +self.assertEqual(len(tables[0].getColumns()), cols) + +def insertTextIntoCell(self, table, cellName, text ): +tableText = table.getCellByName( cellName ) +tableText.setString( text ) + +def test_tdf80663(self): + +self.insert_table("Test1", 2, 2) + +document = self.ui_test.get_component() + +tables = document.getTextTables() +self.xUITest.executeCommand(".uno:DeleteRows") + +self.assertEqual(len(tables[0].getRows()), 1) +self.assertEqual(len(tables[0].getColumns()), 2) + +self.xUITest.executeCommand(".uno:Undo") + +self.assertEqual(len(tables[0].getRows()), 2) +self.assertEqual(len(tables[0].getColumns()), 2) + +self.ui_test.close_doc() + +def test_tdf96067(self): + +self.insert_table("Test2", 3, 3) + +self.xUITest.executeCommand(".uno:SelectTable") +self.xUITest.executeCommand(".uno:InsertRowsBefore") + +document = self.ui_test.get_component() +tables = document.getTextTables() +self.assertEqual(len(tables[0].getRows()), 6) +self.assertEqual(len(tables[0].getColumns()), 3) + +self.xUITest.executeCommand(".uno:Undo") + +self.ui_test.close_doc() + +def test_tdf104158(self): + +self.insert_table("Test3", 2, 2) + + self.ui_test.execute_dialog_through_command(".uno:TableNumberFormatDialog") + +xNumberFormatDlg = self.xUITest.getTopFocusWindow() + +xOkBtn = xNumberFormatDlg.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +self.ui_test.close_doc() + +def test_tdf87199(self): + +self.insert_table("Test4", 2, 1) + +document = self.ui_test.get_component() +tables = document.getTextTables() +self.insertTextIntoCell(tables[0], "A1", "test" ) +self.insertTextIntoCell(tables[0], "A2", "test" ) + +cursor = tables[0].getCellByName( "A1" ).createTextCursor() + +self.xUITest.executeCommand(".uno:EntireColumn") + +self.xUITest.executeCommand(".uno:MergeCells") + +tables = document.getTextTables() +self.assertEqual(len(tables[0].getRows()), 1) +self.assertEqual(len(tables[0].getColumns()), 1) + +self.xUITest.executeCommand(".uno:Undo") + +self.assertEqual(len(tables[0].getRows()), 2) +self.assertEqual(len(tables[0].getColumns()), 1) + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/uitest/w
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/data/tdf104649.docx |binary uitest/writer_tests/tdf104649.py| 35 2 files changed, 35 insertions(+) New commits: commit cdf6330ebc6f365a545c648eb6672aa51858c015 Author: Xisco Fauli Date: Sat Jan 14 11:12:26 2017 +0100 tdf#104649: Add uitest Change-Id: I0e1c757e4857ff11481230606a0f982d260c24c0 Reviewed-on: https://gerrit.libreoffice.org/33065 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/data/tdf104649.docx b/uitest/writer_tests/data/tdf104649.docx new file mode 100644 index ..7b1e4fd3cedc Binary files /dev/null and b/uitest/writer_tests/data/tdf104649.docx differ diff --git a/uitest/writer_tests/tdf104649.py b/uitest/writer_tests/tdf104649.py new file mode 100644 index ..a1593d387339 --- /dev/null +++ b/uitest/writer_tests/tdf104649.py @@ -0,0 +1,35 @@ +# +# 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 +from uitest.path import get_srcdir_url + +def get_url_for_data_file(file_name): +return get_srcdir_url() + "/uitest/writer_tests/data/" + file_name + +class tdf104649(UITestCase): + +def test_delete_and_undo(self): + +writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf104649.docx")) + +document = self.ui_test.get_component() + +self.assertEqual(document.Text.String[0:4], "Test") + +selection = self.xUITest.executeCommand(".uno:SelectAll") + +self.xUITest.executeCommand(".uno:Delete") + +self.assertEqual(document.Text.String, "") + +self.xUITest.executeCommand(".uno:Undo") + +self.assertEqual(document.Text.String[0:4], "Test") + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/backgrounds.py | 147 + 1 file changed, 147 insertions(+) New commits: commit 3a639085a43b886828c49a86cf761bc92f26e6e1 Author: Xisco Fauli Date: Thu Mar 9 16:34:48 2017 +0100 uitest: test backgrounds in writer Change-Id: If3bf2848bb9437c7cb7ffec37c315888fef47c88 Reviewed-on: https://gerrit.libreoffice.org/35008 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/backgrounds.py b/uitest/writer_tests/backgrounds.py new file mode 100644 index 000..da49a75 --- /dev/null +++ b/uitest/writer_tests/backgrounds.py @@ -0,0 +1,147 @@ +# +# 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 +from uitest.uihelper.common import select_pos +from com.sun.star.uno import RuntimeException +from com.sun.star.awt.GradientStyle import LINEAR +from com.sun.star.drawing.HatchStyle import SINGLE +from com.sun.star.drawing.BitmapMode import REPEAT +from com.sun.star.drawing.RectanglePoint import MIDDLE_MIDDLE + +class WriterBackgrounds(UITestCase): + +def checkDefaultBackground(self, btn): +document = self.ui_test.get_component() +if btn == 'btnnone': +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.BackColor, -1) +elif btn == 'btncolor': +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.BackColor, 7512015) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillColor, 7512015) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillColor, 7512015) +elif btn == 'btngradient': +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillGradient.Style, LINEAR) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillGradient.StartColor, 9101876) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillGradient.Angle, 300) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillGradient.Border, 0) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillGradient.XOffset, 0) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillGradient.YOffset, 0) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillGradient.StartIntensity, 100) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillGradient.EndIntensity, 100) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillGradientName, 'Tango Green') +elif btn == 'btnhatch': +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillHatch.Style, SINGLE ) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillHatch.Color, 0) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillHatch.Distance, 102) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillHatch.Angle, 0) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillHatchName, 'Black 0 Degrees') +elif btn == 'btnbitmap': +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillBitmapMode, REPEAT) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetX, 0) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetY, 0) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillBitmapRectanglePoint, MIDDLE_MIDDLE) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillBitmapStretch, False) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillBitmapTile, True) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetX, 0) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetY, 0) +self.assertEqual( + document.StyleFamilies.PageStyles.Standard.FillBitmapLogicalSize, True) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillBitmapSizeX, 0) +self.assertEqual( +document.StyleFamilies.PageStyles.Standard.FillBitmapSizeY, 0) +self.assertEqual( +document.StyleFa
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/tdf87199.py | 56 1 file changed, 56 insertions(+) New commits: commit bc327c15cc1218cacfa4597fe39225c38a535f8e Author: Xisco Fauli Date: Wed Mar 8 17:43:42 2017 +0100 tdf#87199: Add uitest Change-Id: Ib57d71777f3e8a1b17dfc8127365dbf2f6ad6102 Reviewed-on: https://gerrit.libreoffice.org/34981 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/tdf87199.py b/uitest/writer_tests/tdf87199.py new file mode 100644 index 000..d98761d --- /dev/null +++ b/uitest/writer_tests/tdf87199.py @@ -0,0 +1,56 @@ +# +# 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 + +class tdf87199(UITestCase): + +def insertTextIntoCell(self, table, cellName, text ): +tableText = table.getCellByName( cellName ) +tableText.setString( text ) + +def test_merge_column(self): + +self.ui_test.create_doc_in_start_center("writer") + +self.ui_test.execute_dialog_through_command(".uno:InsertTable") + +xInsertDlg = self.xUITest.getTopFocusWindow() + + +xColSpin = xInsertDlg.getChild("colspin") +xColSpin.executeAction("DOWN", tuple()) + +xOkBtn = xInsertDlg.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +document = self.ui_test.get_component() + +tables = document.getTextTables() +self.assertEqual(len(tables[0].getRows()), 2) +self.assertEqual(len(tables[0].getColumns()), 1) + +self.insertTextIntoCell(tables[0], "A1", "test" ) +self.insertTextIntoCell(tables[0], "A2", "test" ) + +cursor = tables[0].getCellByName( "A1" ).createTextCursor() + +self.xUITest.executeCommand(".uno:EntireColumn") + +self.xUITest.executeCommand(".uno:MergeCells") + +tables = document.getTextTables() +self.assertEqual(len(tables[0].getRows()), 1) +self.assertEqual(len(tables[0].getColumns()), 1) + +self.xUITest.executeCommand(".uno:Undo") + +self.assertEqual(len(tables[0].getRows()), 2) +self.assertEqual(len(tables[0].getColumns()), 1) + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/tdf79236.py | 124 1 file changed, 124 insertions(+) New commits: commit f9d0f55b2eefc1107d238774a00f7062a1e0d5c8 Author: Xisco Fauli Date: Tue Feb 7 16:28:30 2017 +0100 tdf#79236: Add uitest Change-Id: I916438d688ec24c67b581bf2e025215dda228e97 Reviewed-on: https://gerrit.libreoffice.org/34000 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/tdf79236.py b/uitest/writer_tests/tdf79236.py new file mode 100644 index 000..10e9b74 --- /dev/null +++ b/uitest/writer_tests/tdf79236.py @@ -0,0 +1,124 @@ +# +# 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 + +class tdf79236(UITestCase): + +def test_paragraph(self): + +self.ui_test.create_doc_in_start_center("writer") + +xWriterDoc = self.xUITest.getTopFocusWindow() +xWriterEdit = xWriterDoc.getChild("writer_edit") + +type_text(xWriterEdit, "Test for tdf79236") + +document = self.ui_test.get_component() + +selection = self.xUITest.executeCommand(".uno:SelectAll") + + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0) + +self.assertEqual(document.CurrentSelection.getByIndex(0).String, "Test for tdf79236") + +self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") + +xParagraphDlg = self.xUITest.getTopFocusWindow() + + +xLeftSpnBtn = xParagraphDlg.getChild("spinED_LEFTINDENT") +for _ in range(0,20): +xLeftSpnBtn.executeAction("UP", tuple()) + +xRightSpnBtn = xParagraphDlg.getChild("spinED_RIGHTINDENT") +for _ in range(0,20): +xRightSpnBtn.executeAction("UP", tuple()) + + +xLineSpnBtn = xParagraphDlg.getChild("spinED_FLINEINDENT") +for _ in range(0,20): +xLineSpnBtn.executeAction("UP", tuple()) + + +xBottomSpnBtn = xParagraphDlg.getChild("spinED_BOTTOMDIST") +for _ in range(0,20): +xBottomSpnBtn.executeAction("UP", tuple()) + +xTopSpnBtn = xParagraphDlg.getChild("spinED_TOPDIST") +for _ in range(0,20): +xTopSpnBtn.executeAction("UP", tuple()) + +xOkBtn = xParagraphDlg.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 3704) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 3704) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 5503) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 5503) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 3704) + +self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") + +xParagraphDlg = self.xUITest.getTopFocusWindow() + +xLeftSpnBtn = xParagraphDlg.getChild("spinED_LEFTINDENT") +for _ in range(0,20): +xLeftSpnBtn.executeAction("DOWN", tuple()) + +xRightSpnBtn = xParagraphDlg.getChild("spinED_RIGHTINDENT") +for _ in range(0,20): +xRightSpnBtn.executeAction("DOWN", tuple()) + + +xLineSpnBtn = xParagraphDlg.getChild("spinED_FLINEINDENT") +for _ in range(0,20): +xLineSpnBtn.executeAction("DOWN", tuple()) + +xBottomSpnBtn = xParagraphDlg.getChild("spinED_BOTTOMDIST") +for _ in range(0,20): +xBottomSpnBtn.executeAction("DOWN", tuple()) + +xTopSpnBtn = xParagraphDlg.getChild("spinED_TOPDIST") +for _ in range(0,20): +xTopSpnBtn.executeAction("DOWN", tuple()) + +xOkBtn = xParagraphDlg.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0) + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0) + +self.xUITest.executeCommand(".uno:Undo") + + self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 3704) + self.a
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/tdf80663.py | 40 1 file changed, 40 insertions(+) New commits: commit e033311c1a4fcfe594bc773d58da6cc06d4dd624 Author: Xisco Fauli Date: Sun Jan 15 18:20:25 2017 +0100 tdf#80663 Add uitest Change-Id: Icc9d7d84b44ecbd0531f538ec227b37998b1f5e2 Reviewed-on: https://gerrit.libreoffice.org/33097 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/tdf80663.py b/uitest/writer_tests/tdf80663.py new file mode 100644 index 000..916a49b --- /dev/null +++ b/uitest/writer_tests/tdf80663.py @@ -0,0 +1,40 @@ +# +# 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 + +class tdf80663(UITestCase): + +def test_delete_row_and_undo(self): + +self.ui_test.create_doc_in_start_center("writer") + +self.ui_test.execute_dialog_through_command(".uno:InsertTable") + +xInsertDlg = self.xUITest.getTopFocusWindow() + +xOkBtn = xInsertDlg.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +document = self.ui_test.get_component() + +tables = document.getTextTables() +self.assertEqual(len(tables[0].getRows()), 2) +self.assertEqual(len(tables[0].getColumns()), 2) + +self.xUITest.executeCommand(".uno:DeleteRows") + +self.assertEqual(len(tables[0].getRows()), 1) +self.assertEqual(len(tables[0].getColumns()), 2) + +self.xUITest.executeCommand(".uno:Undo") + +self.assertEqual(len(tables[0].getRows()), 2) +self.assertEqual(len(tables[0].getColumns()), 2) + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/tdf92611.py | 27 +++ 1 file changed, 27 insertions(+) New commits: commit 91f8766db597e25714be0eab8c69510e19865c04 Author: Xisco Fauli Date: Sun Jan 15 19:34:36 2017 +0100 tdf#92611: Add uitest Change-Id: I9b07b185fd1c3f43c06713d4e5fde8d97b2991ef Reviewed-on: https://gerrit.libreoffice.org/33099 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/tdf92611.py b/uitest/writer_tests/tdf92611.py new file mode 100644 index 000..0b6007b --- /dev/null +++ b/uitest/writer_tests/tdf92611.py @@ -0,0 +1,27 @@ +# +# 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 + +class tdf92611(UITestCase): + +def test_launch_and_close_bibliography(self): + +self.ui_test.create_doc_in_start_center("writer") + + +self.xUITest.executeCommand(".uno:BibliographyComponent") + +time.sleep(2) + +self.xUITest.executeCommand(".uno:CloseWin") + +time.sleep(2) + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/tdf96067.py | 45 1 file changed, 45 insertions(+) New commits: commit 0089da5af5ab1e1cbbba76b4635e8472c2678c5f Author: Xisco Fauli Date: Sat Jan 14 11:40:22 2017 +0100 tdf#96067 Add uitest Change-Id: Iac2690789c5a82bfdf140067c1b0dcdaa423a8ab Reviewed-on: https://gerrit.libreoffice.org/33066 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/tdf96067.py b/uitest/writer_tests/tdf96067.py new file mode 100644 index 000..12c3277 --- /dev/null +++ b/uitest/writer_tests/tdf96067.py @@ -0,0 +1,45 @@ +# +# 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 + +class tdf96067(UITestCase): + +def test_insert_row_and_undo(self): + +self.ui_test.create_doc_in_start_center("writer") + +self.ui_test.execute_dialog_through_command(".uno:InsertTable") + +xInsertDlg = self.xUITest.getTopFocusWindow() + +xRowSpin = xInsertDlg.getChild("rowspin") +xRowSpin.executeAction("UP", tuple()) + +xColSpin = xInsertDlg.getChild("colspin") +xColSpin.executeAction("UP", tuple()) + +xOkBtn = xInsertDlg.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +document = self.ui_test.get_component() + +tables = document.getTextTables() +self.assertEqual(len(tables[0].getRows()), 3) +self.assertEqual(len(tables[0].getColumns()), 3) + +self.xUITest.executeCommand(".uno:SelectTable") +self.xUITest.executeCommand(".uno:InsertRowsBefore") + +tables = document.getTextTables() +self.assertEqual(len(tables[0].getRows()), 6) +self.assertEqual(len(tables[0].getColumns()), 3) + +self.xUITest.executeCommand(".uno:Undo") + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/tdf104158.py |6 ++ 1 file changed, 6 insertions(+) New commits: commit 6e63f40dcc96fac62433fe62c5bbf7cf4378b498 Author: Xisco Fauli Date: Sat Jan 14 13:13:10 2017 +0100 Check number of columns and row in the inserted table Change-Id: I6c6c9b38a9eb1a2912373008564b4838bd3fc3f8 Reviewed-on: https://gerrit.libreoffice.org/33067 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/tdf104158.py b/uitest/writer_tests/tdf104158.py index fafbc24..8c0f1bd 100644 --- a/uitest/writer_tests/tdf104158.py +++ b/uitest/writer_tests/tdf104158.py @@ -19,6 +19,12 @@ class tdf104158(UITestCase): xOkBtn = xInsertDlg.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) +document = self.ui_test.get_component() + +tables = document.getTextTables() +self.assertEqual(len(tables[0].getRows()), 2) +self.assertEqual(len(tables[0].getColumns()), 2) + self.ui_test.execute_dialog_through_command(".uno:TableNumberFormatDialog") xNumberFormatDlg = self.xUITest.getTopFocusWindow() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: uitest/writer_tests
uitest/writer_tests/tdf104158.py | 31 +++ 1 file changed, 31 insertions(+) New commits: commit 5930cf87454940a0015e9e18f154759163caf929 Author: Xisco Fauli Date: Fri Jan 13 19:23:10 2017 +0100 tdf#104158: Add uitest Change-Id: If2391365e71df0e95dc1be177e3595a62e0d6eab Reviewed-on: https://gerrit.libreoffice.org/33057 Tested-by: Jenkins Reviewed-by: Xisco Faulà diff --git a/uitest/writer_tests/tdf104158.py b/uitest/writer_tests/tdf104158.py new file mode 100644 index 000..fafbc24 --- /dev/null +++ b/uitest/writer_tests/tdf104158.py @@ -0,0 +1,31 @@ +# +# 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 + +class tdf104158(UITestCase): + +def test_number_format_dialog(self): + +self.ui_test.create_doc_in_start_center("writer") + +self.ui_test.execute_dialog_through_command(".uno:InsertTable") + +xInsertDlg = self.xUITest.getTopFocusWindow() + +xOkBtn = xInsertDlg.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + + self.ui_test.execute_dialog_through_command(".uno:TableNumberFormatDialog") + +xNumberFormatDlg = self.xUITest.getTopFocusWindow() + +xOkBtn = xNumberFormatDlg.getChild("ok") +xOkBtn.executeAction("CLICK", tuple()) + +self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits