diff options
Diffstat (limited to 'sd/qa/uitest/impress_tests')
-rw-r--r-- | sd/qa/uitest/impress_tests/autocorrectOptions.py | 96 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/customSlideShow.py | 81 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/data/findReplace.odp | bin | 0 -> 12804 bytes | |||
-rw-r--r-- | sd/qa/uitest/impress_tests/documentProperties.py | 99 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/insertSlide.py | 55 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/masterElements.py | 52 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/renameSlide.py | 41 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/slideShowSettings.py | 62 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/tdf126605.py | 28 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/tdf130440.py | 57 | ||||
-rw-r--r-- | sd/qa/uitest/impress_tests/tdf91762.py | 48 |
11 files changed, 619 insertions, 0 deletions
diff --git a/sd/qa/uitest/impress_tests/autocorrectOptions.py b/sd/qa/uitest/impress_tests/autocorrectOptions.py new file mode 100644 index 000000000..759304e01 --- /dev/null +++ b/sd/qa/uitest/impress_tests/autocorrectOptions.py @@ -0,0 +1,96 @@ +# -*- 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 +from uitest.uihelper.common import select_pos + +class autocorrectOptions(UITestCase): + + def test_autocorrect_options_impress(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + document = self.ui_test.get_component() + + self.ui_test.execute_dialog_through_command(".uno:AutoCorrectDlg") + xDialog = self.xUITest.getTopFocusWindow() + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "0") #tab replace + origtext = xDialog.getChild("origtext") + newtext = xDialog.getChild("newtext") + xnew = xDialog.getChild("new") + xdelete = xDialog.getChild("delete") + xtabview = xDialog.getChild("tabview") + xreset = xDialog.getChild("reset") + nrRows = get_state_as_dict(xtabview)["VisibleCount"] + + #add new rule + origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + origtext.executeAction("TYPE", mkPropertyValues({"TEXT":"::::"})) + newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + newtext.executeAction("TYPE", mkPropertyValues({"TEXT":"dvojtecky"})) + xnew.executeAction("CLICK", tuple()) + nrRowsNew = get_state_as_dict(xtabview)["VisibleCount"] + nrRowsDiff = int(nrRowsNew) - int(nrRows) + self.assertEqual(nrRowsDiff, 1) #we have +1 rule + #delete rule + origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + origtext.executeAction("TYPE", mkPropertyValues({"TEXT":"::::"})) + newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + newtext.executeAction("TYPE", mkPropertyValues({"TEXT":"dvojtecky"})) + xdelete.executeAction("CLICK", tuple()) + self.assertEqual(get_state_as_dict(xtabview)["VisibleCount"], nrRows) #we have default nr of rules + + select_pos(xTabs, "1") #tab Exceptions + #abbreviations + abbrev = xDialog.getChild("abbrev") + newabbrev = xDialog.getChild("newabbrev") + delabbrev = xDialog.getChild("delabbrev") + abbrevlist = xDialog.getChild("abbrevlist") + + nrRowsAbb = get_state_as_dict(abbrevlist)["Children"] + abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + abbrev.executeAction("TYPE", mkPropertyValues({"TEXT":"qqqqq"})) + newabbrev.executeAction("CLICK", tuple()) + nrRowsAbbNew = get_state_as_dict(abbrevlist)["Children"] + nrRowsAbbDiff = int(nrRowsAbbNew) - int(nrRowsAbb) + self.assertEqual(nrRowsAbbDiff, 1) #we have +1 rule + delabbrev.executeAction("CLICK", tuple()) + self.assertEqual(get_state_as_dict(abbrevlist)["Children"], nrRowsAbb) #we have default nr of rules + + #words with two initial capitals + double = xDialog.getChild("double") + newdouble = xDialog.getChild("newdouble") + deldouble = xDialog.getChild("deldouble") + doublelist = xDialog.getChild("doublelist") + + nrRowsDouble = get_state_as_dict(doublelist)["Children"] + double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + double.executeAction("TYPE", mkPropertyValues({"TEXT":"QQqqq"})) + newdouble.executeAction("CLICK", tuple()) + nrRowsDoubleNew = get_state_as_dict(doublelist)["Children"] + nrRowsDoubleDiff = int(nrRowsDoubleNew) - int(nrRowsDouble) #convert string and + self.assertEqual(nrRowsDoubleDiff, 1) #we have +1 rule + deldouble.executeAction("CLICK", tuple()) + self.assertEqual(get_state_as_dict(doublelist)["Children"], nrRowsDouble) #we have default nr of rules + + xCancelButton = xDialog.getChild("cancel") + xCancelButton.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/qa/uitest/impress_tests/customSlideShow.py b/sd/qa/uitest/impress_tests/customSlideShow.py new file mode 100644 index 000000000..61b15cda8 --- /dev/null +++ b/sd/qa/uitest/impress_tests/customSlideShow.py @@ -0,0 +1,81 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +import importlib +from uitest.debug import sleep +from uitest.uihelper.common import select_pos +from uitest.uihelper.common import get_state_as_dict, type_text + +class customSlideShow(UITestCase): + def test_customSlideShow(self): + MainDoc = self.ui_test.create_doc_in_start_center("impress") + MainWindow = self.xUITest.getTopFocusWindow() + TemplateDialog = self.xUITest.getTopFocusWindow() + cancel = TemplateDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(cancel) + self.ui_test.execute_dialog_through_command(".uno:CustomShowDialog") + CustomSlideShows = self.xUITest.getTopFocusWindow() + new = CustomSlideShows.getChild("new") + ok = CustomSlideShows.getChild("ok") + + def handle_new_dlg(DefineCustomSlideShow): + customname = DefineCustomSlideShow.getChild("customname") + customname.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) + customname.executeAction("TYPE", mkPropertyValues({"TEXT": "a"})) + customname.executeAction("TYPE", mkPropertyValues({"TEXT": "a"})) + pages = DefineCustomSlideShow.getChild("pages") + xEntry = pages.getChild("0") + xEntry.executeAction("SELECT", tuple()) + add = DefineCustomSlideShow.getChild("add") + add.executeAction("CLICK",tuple()) + ok = DefineCustomSlideShow.getChild("ok") + self.ui_test.close_dialog_through_button(ok) + + self.ui_test.execute_blocking_action(new.executeAction, args=('CLICK', ()), + dialog_handler=handle_new_dlg) + self.ui_test.close_dialog_through_button(ok) + #verify + self.ui_test.execute_dialog_through_command(".uno:CustomShowDialog") + CustomSlideShows = self.xUITest.getTopFocusWindow() + edit = CustomSlideShows.getChild("edit") + customshowlist = CustomSlideShows.getChild("customshowlist") + self.assertEqual(get_state_as_dict(customshowlist)["SelectionCount"], "1") + select_pos(customshowlist, "1") + ok = CustomSlideShows.getChild("ok") + + def handle_edit_dlg(DefineCustomSlideShow): + customname = DefineCustomSlideShow.getChild("customname") + self.assertEqual(get_state_as_dict(customname)["Text"], "aa") +# print(DefineCustomSlideShow.getChildren()) + custompages = DefineCustomSlideShow.getChild("custompages") + pages = DefineCustomSlideShow.getChild("pages") + remove = DefineCustomSlideShow.getChild("remove") +# print(get_state_as_dict(custompages)) + self.assertEqual(get_state_as_dict(custompages)["Children"], "1") + self.assertEqual(get_state_as_dict(pages)["Children"], "1") + xEntry = custompages.getChild("0") + xEntry.executeAction("SELECT", tuple()) +# remove.executeAction("CLICK",tuple()) #tdf126951 + self.assertEqual(get_state_as_dict(custompages)["Children"], "1") + self.assertEqual(get_state_as_dict(pages)["Children"], "1") + cancel = DefineCustomSlideShow.getChild("cancel") + self.ui_test.close_dialog_through_button(cancel) + + self.ui_test.execute_blocking_action(edit.executeAction, args=('CLICK', ()), + dialog_handler=handle_edit_dlg) + + CustomSlideShows = self.xUITest.getTopFocusWindow() + delete = CustomSlideShows.getChild("delete") + customshowlist = CustomSlideShows.getChild("customshowlist") + self.assertEqual(get_state_as_dict(customshowlist)["Children"], "1") + +# delete.executeAction("CLICK",tuple()) +# self.assertEqual(get_state_as_dict(customshowlist)["Children"], "0") + + ok = CustomSlideShows.getChild("ok") + self.ui_test.close_dialog_through_button(ok) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/qa/uitest/impress_tests/data/findReplace.odp b/sd/qa/uitest/impress_tests/data/findReplace.odp Binary files differnew file mode 100644 index 000000000..6ccbfcfed --- /dev/null +++ b/sd/qa/uitest/impress_tests/data/findReplace.odp diff --git a/sd/qa/uitest/impress_tests/documentProperties.py b/sd/qa/uitest/impress_tests/documentProperties.py new file mode 100644 index 000000000..54ad2947b --- /dev/null +++ b/sd/qa/uitest/impress_tests/documentProperties.py @@ -0,0 +1,99 @@ +# -*- 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 +from uitest.uihelper.common import select_pos + + +class ImpressDocumentProperties(UITestCase): + + def test_open_document_properties_impress(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties") + xDialog = self.xUITest.getTopFocusWindow() + xResetBtn = xDialog.getChild("reset") + xResetBtn.executeAction("CLICK", tuple()) + xTabs = xDialog.getChild("tabcontrol") + + select_pos(xTabs, "0") #first tab + xUserDataCheckbox = xDialog.getChild("userdatacb") # apply user data + xUserDataCheckbox.executeAction("CLICK", tuple()) + xThumbSaveCheckbox = xDialog.getChild("thumbnailsavecb") # save preview image with document + xThumbSaveCheckbox.executeAction("CLICK", tuple()) + + #digital signature + xDigSignBtn = xDialog.getChild("signature") + def handle_sign_dlg(dialog): + xNoBtn = dialog.getChild("no") + self.ui_test.close_dialog_through_button(xNoBtn) + self.ui_test.execute_blocking_action(xDigSignBtn.executeAction, args=('CLICK', ()), + dialog_handler=handle_sign_dlg) + + select_pos(xTabs, "1") #tab Description + + xTitleText = xDialog.getChild("title") + xTitleText.executeAction("TYPE", mkPropertyValues({"TEXT":"Title text"})) + xSubjectText = xDialog.getChild("subject") + xSubjectText.executeAction("TYPE", mkPropertyValues({"TEXT":"Subject text"})) + xKeywordsText = xDialog.getChild("keywords") + xKeywordsText.executeAction("TYPE", mkPropertyValues({"TEXT":"Keywords text"})) + xCommentsText = xDialog.getChild("comments") + xCommentsText.executeAction("TYPE", mkPropertyValues({"TEXT":"Comments text"})) + + #Font tab + select_pos(xTabs, "4") #tab Fonts + xFontEmbedCheckbox = xDialog.getChild("embedFonts") + xFontEmbedCheckbox.executeAction("CLICK", tuple()) + + #Security tab + select_pos(xTabs, "3") #tab Security + xReadOnlyCheckbox = xDialog.getChild("readonly") + xReadOnlyCheckbox.executeAction("CLICK", tuple()) + + select_pos(xTabs, "2") #tab Custom properties + #add custom properties ------>>>>>>>>>>> not supported + xAddBtn = xDialog.getChild("add") + xAddBtn.executeAction("CLICK", tuple()) + + xOkBtn = xDialog.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) + + #now open the dialog again and read the properties + self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties") + xDialog = self.xUITest.getTopFocusWindow() + xTitleText = xDialog.getChild("title") + xSubjectText = xDialog.getChild("subject") + xKeywordsText = xDialog.getChild("keywords") + xCommentsText = xDialog.getChild("comments") + xReadOnlyCheckbox = xDialog.getChild("readonly") + xRecordChangesCheckbox = xDialog.getChild("recordchanges") + xFontEmbedCheckbox = xDialog.getChild("embedFonts") + xUserDataCheckbox = xDialog.getChild("userdatacb") + xThumbSaveCheckbox = xDialog.getChild("thumbnailsavecb") + self.assertEqual(get_state_as_dict(xTitleText)["Text"], "Title text") + self.assertEqual(get_state_as_dict(xSubjectText)["Text"], "Subject text") + self.assertEqual(get_state_as_dict(xKeywordsText)["Text"], "Keywords text") + self.assertEqual(get_state_as_dict(xReadOnlyCheckbox)["Selected"], "true") + self.assertEqual(get_state_as_dict(xReadOnlyCheckbox)["Selected"], "true") + self.assertEqual(get_state_as_dict(xFontEmbedCheckbox)["Selected"], "true") + self.assertEqual(get_state_as_dict(xUserDataCheckbox)["Selected"], "false") + self.assertEqual(get_state_as_dict(xThumbSaveCheckbox)["Selected"], "false") + self.assertEqual(get_state_as_dict(xCommentsText)["Text"], "Comments text") + xResetBtn = xDialog.getChild("reset") + xResetBtn.executeAction("CLICK", tuple()) + xCancBtn = xDialog.getChild("cancel") + xCancBtn.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/qa/uitest/impress_tests/insertSlide.py b/sd/qa/uitest/impress_tests/insertSlide.py new file mode 100644 index 000000000..396079d3f --- /dev/null +++ b/sd/qa/uitest/impress_tests/insertSlide.py @@ -0,0 +1,55 @@ +# -*- 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 +from uitest.uihelper.common import select_pos +#Bug 85360 - LibreOffice crashes and crashes desktop too on inserting 4th slide + +class insertSlide(UITestCase): + + def test_insert_slide(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + document = self.ui_test.get_component() + self.assertEqual(document.DrawPages.getCount(), 1) #nr. of pages + + self.xUITest.executeCommand(".uno:InsertPage") + + #verify + self.assertEqual(document.DrawPages.getCount(), 2) #nr. of pages + #undo + self.xUITest.executeCommand(".uno:Undo") + self.assertEqual(document.DrawPages.getCount(), 1) #nr. of pages + self.ui_test.close_doc() + + def test_tdf85360_insert_4th_slide(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + document = self.ui_test.get_component() + self.assertEqual(document.DrawPages.getCount(), 1) #nr. of pages + + self.xUITest.executeCommand(".uno:InsertPage") + self.xUITest.executeCommand(".uno:InsertPage") + self.xUITest.executeCommand(".uno:InsertPage") + self.xUITest.executeCommand(".uno:InsertPage") + #verify + self.assertEqual(document.DrawPages.getCount(), 5) #nr. of pages + #undo + self.xUITest.executeCommand(".uno:Undo") + self.xUITest.executeCommand(".uno:Undo") + self.xUITest.executeCommand(".uno:Undo") + self.xUITest.executeCommand(".uno:Undo") + self.assertEqual(document.DrawPages.getCount(), 1) #nr. of pages + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/qa/uitest/impress_tests/masterElements.py b/sd/qa/uitest/impress_tests/masterElements.py new file mode 100644 index 000000000..73c944074 --- /dev/null +++ b/sd/qa/uitest/impress_tests/masterElements.py @@ -0,0 +1,52 @@ +# -*- 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 +from uitest.uihelper.common import select_pos + +class masterElements(UITestCase): + + def test_master_elements(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + document = self.ui_test.get_component() + + self.ui_test.execute_dialog_through_command(".uno:MasterLayouts") + xDialog = self.xUITest.getTopFocusWindow() + + xpagenumber = xDialog.getChild("pagenumber") + xfooter = xDialog.getChild("footer") + datetime = xDialog.getChild("datetime") + xpagenumber.executeAction("CLICK", tuple()) + xfooter.executeAction("CLICK", tuple()) + datetime.executeAction("CLICK", tuple()) + + xOKButton = xDialog.getChild("ok") + xOKButton.executeAction("CLICK", tuple()) + + #verify + self.ui_test.execute_dialog_through_command(".uno:MasterLayouts") + xDialog = self.xUITest.getTopFocusWindow() + xfooter = xDialog.getChild("footer") + datetime = xDialog.getChild("datetime") + xpagenumber = xDialog.getChild("pagenumber") + + self.assertEqual(get_state_as_dict(xfooter)["Selected"], "false") + self.assertEqual(get_state_as_dict(datetime)["Selected"], "false") + self.assertEqual(get_state_as_dict(xpagenumber)["Selected"], "false") + + xOKButton = xDialog.getChild("ok") + xOKButton.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/qa/uitest/impress_tests/renameSlide.py b/sd/qa/uitest/impress_tests/renameSlide.py new file mode 100644 index 000000000..da203fd21 --- /dev/null +++ b/sd/qa/uitest/impress_tests/renameSlide.py @@ -0,0 +1,41 @@ +# -*- 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 +from uitest.uihelper.common import select_pos + +class renameSlide(UITestCase): + + def test_rename_slide(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + self.ui_test.execute_dialog_through_command(".uno:RenamePage") + xDialog = self.xUITest.getTopFocusWindow() + + name_entry = xDialog.getChild("name_entry") + name_entry.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName"})) + + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + #verify + self.ui_test.execute_dialog_through_command(".uno:RenamePage") + xDialog = self.xUITest.getTopFocusWindow() + + name_entry = xDialog.getChild("name_entry") + self.assertEqual(get_state_as_dict(name_entry)["Text"], "NewName") + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/qa/uitest/impress_tests/slideShowSettings.py b/sd/qa/uitest/impress_tests/slideShowSettings.py new file mode 100644 index 000000000..2d2a5920d --- /dev/null +++ b/sd/qa/uitest/impress_tests/slideShowSettings.py @@ -0,0 +1,62 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +import importlib +from uitest.debug import sleep +from uitest.uihelper.common import get_state_as_dict, type_text + +class slideShowSettings(UITestCase): + def test_slideShowSettings(self): + MainDoc = self.ui_test.create_doc_in_start_center("impress") + MainWindow = self.xUITest.getTopFocusWindow() + TemplateDialog = self.xUITest.getTopFocusWindow() + cancel = TemplateDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(cancel) + self.xUITest.executeCommand(".uno:InsertPage") + self.ui_test.execute_dialog_through_command(".uno:PresentationDialog") + PresentationDialog = self.xUITest.getTopFocusWindow() + + xfrom = PresentationDialog.getChild("from") + xfrom.executeAction("CLICK",tuple()) + from_cb = PresentationDialog.getChild("from_cb") + from_cb.executeAction("SELECT", mkPropertyValues({"POS": "0"})) + window = PresentationDialog.getChild("window") + window.executeAction("CLICK",tuple()) + manualslides = PresentationDialog.getChild("manualslides") + manualslides.executeAction("CLICK",tuple()) + pointervisible = PresentationDialog.getChild("pointervisible") + pointervisible.executeAction("CLICK",tuple()) + pointeraspen = PresentationDialog.getChild("pointeraspen") + pointeraspen.executeAction("CLICK",tuple()) + animationsallowed = PresentationDialog.getChild("animationsallowed") + animationsallowed.executeAction("CLICK",tuple()) + changeslidesbyclick = PresentationDialog.getChild("changeslidesbyclick") + changeslidesbyclick.executeAction("CLICK",tuple()) + + ok = PresentationDialog.getChild("ok") + self.ui_test.close_dialog_through_button(ok) + #verify + self.ui_test.execute_dialog_through_command(".uno:PresentationDialog") + PresentationDialog = self.xUITest.getTopFocusWindow() + xfrom = PresentationDialog.getChild("from") + self.assertEqual(get_state_as_dict(xfrom)["Checked"], "true") + from_cb = PresentationDialog.getChild("from_cb") + self.assertEqual(get_state_as_dict(from_cb)["SelectEntryText"], "Slide 1") + manualslides = PresentationDialog.getChild("manualslides") + self.assertEqual(get_state_as_dict(manualslides)["Selected"], "true") + pointervisible = PresentationDialog.getChild("pointervisible") + self.assertEqual(get_state_as_dict(pointervisible)["Selected"], "true") + pointeraspen = PresentationDialog.getChild("pointeraspen") + self.assertEqual(get_state_as_dict(pointeraspen)["Selected"], "true") + animationsallowed = PresentationDialog.getChild("animationsallowed") + self.assertEqual(get_state_as_dict(animationsallowed)["Selected"], "false") + changeslidesbyclick = PresentationDialog.getChild("changeslidesbyclick") + self.assertEqual(get_state_as_dict(changeslidesbyclick)["Selected"], "false") + + cancel = PresentationDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(cancel) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/qa/uitest/impress_tests/tdf126605.py b/sd/qa/uitest/impress_tests/tdf126605.py new file mode 100644 index 000000000..744324717 --- /dev/null +++ b/sd/qa/uitest/impress_tests/tdf126605.py @@ -0,0 +1,28 @@ +# -*- 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 + +class tdf126605(UITestCase): + + def test_run(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + xDoc = self.xUITest.getTopFocusWindow() + xEdit = xDoc.getChild("impress_win") + xEdit.executeAction("TYPE", mkPropertyValues({"TEXT":"test"})) + + # Without the accompanying fix in place, it would crash at this point + self.xUITest.executeCommand(".uno:ParaRightToLeft") + self.xUITest.executeCommand(".uno:ParaLeftToRight") + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/qa/uitest/impress_tests/tdf130440.py b/sd/qa/uitest/impress_tests/tdf130440.py new file mode 100644 index 000000000..348feb33c --- /dev/null +++ b/sd/qa/uitest/impress_tests/tdf130440.py @@ -0,0 +1,57 @@ +# -*- 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 + +class tdf129346(UITestCase): + + def test_run(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + + document = self.ui_test.get_component() + self.assertEqual(document.CurrentController.getCurrentPage().Number, 1) + self.xUITest.executeCommand(".uno:DuplicatePage") + xToolkit.processEventsToIdle() + self.assertEqual(document.CurrentController.getCurrentPage().Number, 2) + + xDoc = self.xUITest.getTopFocusWindow() + xEdit = xDoc.getChild("impress_win") + xEdit.executeAction("TYPE", mkPropertyValues({"TEXT":"test"})) + + self.xUITest.executeCommand(".uno:Undo") + xToolkit.processEventsToIdle() + self.assertEqual(document.CurrentController.getCurrentPage().Number, 2) + + self.xUITest.executeCommand(".uno:Undo") + xToolkit.processEventsToIdle() + self.assertEqual(document.CurrentController.getCurrentPage().Number, 2) + + self.xUITest.executeCommand(".uno:Undo") + xToolkit.processEventsToIdle() + self.assertEqual(document.CurrentController.getCurrentPage().Number, 1) + + self.xUITest.executeCommand(".uno:Redo") + xToolkit.processEventsToIdle() + self.assertEqual(document.CurrentController.getCurrentPage().Number, 2) + + self.xUITest.executeCommand(".uno:Redo") + + xDoc = self.xUITest.getTopFocusWindow() + xEdit = xDoc.getChild("impress_win") + xEdit.executeAction("TYPE", mkPropertyValues({"TEXT":"test"})) + + xToolkit.processEventsToIdle() + #Without the accompanying fix in place, it would fail with AssertionError: 2 != 1 + self.assertEqual(document.CurrentController.getCurrentPage().Number, 2) + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sd/qa/uitest/impress_tests/tdf91762.py b/sd/qa/uitest/impress_tests/tdf91762.py new file mode 100644 index 000000000..3c52b4ff9 --- /dev/null +++ b/sd/qa/uitest/impress_tests/tdf91762.py @@ -0,0 +1,48 @@ +# -*- 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 uitest.uihelper.common import get_state_as_dict +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf91762(UITestCase): + + def test_tdf91762(self): + self.ui_test.create_doc_in_start_center("impress") + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + self.xUITest.executeCommand(".uno:AssignLayout?WhatLayout:long=1") + + self.ui_test.execute_dialog_through_command(".uno:InsertTable") + xDialog = self.xUITest.getTopFocusWindow() + self.assertEqual('5', get_state_as_dict(xDialog.getChild('columns'))['Text']) + self.assertEqual('2', get_state_as_dict(xDialog.getChild('rows'))['Text']) + xOkBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) + + document = self.ui_test.get_component() + self.assertEqual(1929, document.DrawPages[0].getByIndex(1).BoundRect.Height) + self.assertEqual(25198, document.DrawPages[0].getByIndex(1).Size.Width) + self.assertEqual(1923, document.DrawPages[0].getByIndex(1).Size.Height) + + self.assertEqual(1400, document.DrawPages[0].getByIndex(1).Position.X) + self.assertEqual(3685, document.DrawPages[0].getByIndex(1).Position.Y) + + #The table is selected, use esc to start editing + xDoc = self.xUITest.getTopFocusWindow() + xEdit = xDoc.getChild("impress_win") + for i in range(5): + xEdit.executeAction("TYPE", mkPropertyValues({"TEXT":"test"})) + xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) + + # tdf#138011: Without the fix in place, this test would have failed with + self.assertEqual(5494, document.DrawPages[0].getByIndex(1).BoundRect.Height) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: |