uitest: guard the remaining create_doc_in_start_center
Mostly done by a script
for motivation, see 89aaa17a0a
< UITest: introduce guarded context managers >
Change-Id: I2a6149b318d1fdaa36efe5d65af4c238827eaaf5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118154
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
parent
57e8d25a40
commit
3874e092da
23 changed files with 462 additions and 508 deletions
|
@ -14,84 +14,79 @@ class Test(UITestCase):
|
|||
|
||||
def testSvxCharEffectsPage(self):
|
||||
# Start Impress.
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
template = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.close_dialog_through_button(template.getChild("close"))
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
editWin = doc.getChild("impress_win")
|
||||
# Select the title shape.
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress") as component:
|
||||
template = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.close_dialog_through_button(template.getChild("close"))
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
editWin = doc.getChild("impress_win")
|
||||
# Select the title shape.
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
|
||||
# Now use Format -> Character.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
|
||||
xTabs = xDialog.getChild("tabcontrol")
|
||||
# Select RID_SVXPAGE_CHAR_EFFECTS.
|
||||
select_pos(xTabs, "1")
|
||||
xFontTransparency = xDialog.getChild("fonttransparencymtr")
|
||||
for _ in range(5):
|
||||
xFontTransparency.executeAction("UP", tuple())
|
||||
# Now use Format -> Character.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
|
||||
xTabs = xDialog.getChild("tabcontrol")
|
||||
# Select RID_SVXPAGE_CHAR_EFFECTS.
|
||||
select_pos(xTabs, "1")
|
||||
xFontTransparency = xDialog.getChild("fonttransparencymtr")
|
||||
for _ in range(5):
|
||||
xFontTransparency.executeAction("UP", tuple())
|
||||
|
||||
# Verify the result.
|
||||
component = self.ui_test.get_component()
|
||||
drawPage = component.getDrawPages().getByIndex(0)
|
||||
shape = drawPage.getByIndex(0)
|
||||
# Verify the result.
|
||||
drawPage = component.getDrawPages().getByIndex(0)
|
||||
shape = drawPage.getByIndex(0)
|
||||
|
||||
# Without the accompanying fix in place, this test would have failed with:
|
||||
# AssertionError: 100 != 5
|
||||
# i.e. the dialog did not set transparency to 5%, instead it left the character color at
|
||||
# COL_AUTO.
|
||||
self.assertEqual(shape.CharTransparence, 5)
|
||||
self.ui_test.close_doc()
|
||||
# Without the accompanying fix in place, this test would have failed with:
|
||||
# AssertionError: 100 != 5
|
||||
# i.e. the dialog did not set transparency to 5%, instead it left the character color at
|
||||
# COL_AUTO.
|
||||
self.assertEqual(shape.CharTransparence, 5)
|
||||
|
||||
def testSvxCharEffectsPageWriter(self):
|
||||
# Start Writer.
|
||||
self.ui_test.create_doc_in_start_center("writer")
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
editWin = doc.getChild("writer_edit")
|
||||
# Type a character and select it.
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("writer") as component:
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
editWin = doc.getChild("writer_edit")
|
||||
# Type a character and select it.
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
|
||||
# Now use Format -> Character.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
|
||||
xTabs = xDialog.getChild("tabcontrol")
|
||||
# Select RID_SVXPAGE_CHAR_EFFECTS.
|
||||
select_pos(xTabs, "1")
|
||||
xFontTransparency = xDialog.getChild("fonttransparencymtr")
|
||||
# Without the accompanying fix in place, this test would have failed with:
|
||||
# AssertionError: 'false' != 'true'
|
||||
# i.e. the transparency widget was hidden.
|
||||
self.assertEqual(get_state_as_dict(xFontTransparency)["Visible"], "true")
|
||||
for _ in range(5):
|
||||
xFontTransparency.executeAction("UP", tuple())
|
||||
# Now use Format -> Character.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
|
||||
xTabs = xDialog.getChild("tabcontrol")
|
||||
# Select RID_SVXPAGE_CHAR_EFFECTS.
|
||||
select_pos(xTabs, "1")
|
||||
xFontTransparency = xDialog.getChild("fonttransparencymtr")
|
||||
# Without the accompanying fix in place, this test would have failed with:
|
||||
# AssertionError: 'false' != 'true'
|
||||
# i.e. the transparency widget was hidden.
|
||||
self.assertEqual(get_state_as_dict(xFontTransparency)["Visible"], "true")
|
||||
for _ in range(5):
|
||||
xFontTransparency.executeAction("UP", tuple())
|
||||
|
||||
# Verify the result.
|
||||
component = self.ui_test.get_component()
|
||||
paragraph = component.Text.createEnumeration().nextElement()
|
||||
# Verify the result.
|
||||
paragraph = component.Text.createEnumeration().nextElement()
|
||||
|
||||
self.assertEqual(paragraph.CharTransparence, 5)
|
||||
self.ui_test.close_doc()
|
||||
self.assertEqual(paragraph.CharTransparence, 5)
|
||||
|
||||
def testSvxCharEffectsPageWriterAutomatic(self):
|
||||
# Start Writer.
|
||||
self.ui_test.create_doc_in_start_center("writer")
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
editWin = doc.getChild("writer_edit")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("writer"):
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
editWin = doc.getChild("writer_edit")
|
||||
|
||||
# Use Format -> Character.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
|
||||
xTabs = xDialog.getChild("tabcontrol")
|
||||
# Select RID_SVXPAGE_CHAR_EFFECTS.
|
||||
select_pos(xTabs, "1")
|
||||
xFontColorLB = xDialog.getChild("fontcolorlb")
|
||||
# Without the accompanying fix in place, this test would have failed with:
|
||||
# AssertionError: 'White' != 'Automatic'
|
||||
# i.e. the auto color lost its alpha component and appeared as white.
|
||||
self.assertEqual(get_state_as_dict(xFontColorLB)["Text"], "Automatic")
|
||||
# Use Format -> Character.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
|
||||
xTabs = xDialog.getChild("tabcontrol")
|
||||
# Select RID_SVXPAGE_CHAR_EFFECTS.
|
||||
select_pos(xTabs, "1")
|
||||
xFontColorLB = xDialog.getChild("fontcolorlb")
|
||||
# Without the accompanying fix in place, this test would have failed with:
|
||||
# AssertionError: 'White' != 'Automatic'
|
||||
# i.e. the auto color lost its alpha component and appeared as white.
|
||||
self.assertEqual(get_state_as_dict(xFontColorLB)["Text"], "Automatic")
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -14,31 +14,30 @@ class Test(UITestCase):
|
|||
|
||||
def testGetFormat(self):
|
||||
# Copy a string in Impress.
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
template = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.close_dialog_through_button(template.getChild("close"))
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
editWin = doc.getChild("impress_win")
|
||||
# Select the title shape.
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
self.xUITest.executeCommand(".uno:Copy")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress"):
|
||||
template = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.close_dialog_through_button(template.getChild("close"))
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
editWin = doc.getChild("impress_win")
|
||||
# Select the title shape.
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
|
||||
editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
self.xUITest.executeCommand(".uno:Copy")
|
||||
|
||||
# Now use paste special to see what formats are offered.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial", close_button="cancel") as pasteSpecial:
|
||||
formats = pasteSpecial.getChild("list")
|
||||
entryCount = int(get_state_as_dict(formats)["Children"])
|
||||
items = []
|
||||
for index in range(entryCount):
|
||||
entry = formats.getChild(str(index))
|
||||
entry.executeAction("SELECT", tuple())
|
||||
items.append(get_state_as_dict(formats)["SelectEntryText"])
|
||||
# Now use paste special to see what formats are offered.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial", close_button="cancel") as pasteSpecial:
|
||||
formats = pasteSpecial.getChild("list")
|
||||
entryCount = int(get_state_as_dict(formats)["Children"])
|
||||
items = []
|
||||
for index in range(entryCount):
|
||||
entry = formats.getChild(str(index))
|
||||
entry.executeAction("SELECT", tuple())
|
||||
items.append(get_state_as_dict(formats)["SelectEntryText"])
|
||||
|
||||
# Make sure there is no RTF vs Richtext duplication.
|
||||
self.assertTrue("Rich text formatting (RTF)" in items)
|
||||
self.assertFalse("Rich text formatting (Richtext)" in items)
|
||||
# Make sure there is no RTF vs Richtext duplication.
|
||||
self.assertTrue("Rich text formatting (RTF)" in items)
|
||||
self.assertFalse("Rich text formatting (Richtext)" in items)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -13,28 +13,27 @@ from uitest.uihelper.common import get_state_as_dict
|
|||
class Test(UITestCase):
|
||||
|
||||
def test_tab_navigation(self):
|
||||
self.ui_test.create_doc_in_start_center("writer")
|
||||
xWriterDoc = self.xUITest.getTopFocusWindow()
|
||||
xWriterEdit = xWriterDoc.getChild("writer_edit")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("writer"):
|
||||
xWriterDoc = self.xUITest.getTopFocusWindow()
|
||||
xWriterEdit = xWriterDoc.getChild("writer_edit")
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog:
|
||||
|
||||
xTabs = xDialog.getChild("tabcontrol")
|
||||
select_pos(xTabs, "0")
|
||||
xTabs = xDialog.getChild("tabcontrol")
|
||||
select_pos(xTabs, "0")
|
||||
|
||||
for i in range(16):
|
||||
self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], str(i))
|
||||
for i in range(16):
|
||||
self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], str(i))
|
||||
|
||||
xTabs.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+PAGEDOWN"}))
|
||||
xTabs.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+PAGEDOWN"}))
|
||||
|
||||
self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], "0")
|
||||
self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], "0")
|
||||
|
||||
for i in reversed(range(16)):
|
||||
xTabs.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+PAGEUP"}))
|
||||
for i in reversed(range(16)):
|
||||
xTabs.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+PAGEUP"}))
|
||||
|
||||
self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], str(i))
|
||||
self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], str(i))
|
||||
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -14,66 +14,63 @@ class SvxTableControllerTest(UITestCase):
|
|||
|
||||
def testOnFormatTable(self):
|
||||
# Create an Impress document with a single table in it.
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
template = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.close_dialog_through_button(template.getChild("close"))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
self.xUITest.executeCommand(".uno:Delete")
|
||||
self.xUITest.executeCommand(".uno:InsertTable?Columns:short=2&Rows:short=2")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress") as component:
|
||||
template = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.close_dialog_through_button(template.getChild("close"))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
self.xUITest.executeCommand(".uno:Delete")
|
||||
self.xUITest.executeCommand(".uno:InsertTable?Columns:short=2&Rows:short=2")
|
||||
|
||||
# Enable shadow.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:TableDialog") as tableDialog:
|
||||
tabs = tableDialog.getChild("tabcontrol")
|
||||
# Select "shadow".
|
||||
select_pos(tabs, "4")
|
||||
shadowCheckbox = tableDialog.getChild("TSB_SHOW_SHADOW")
|
||||
shadowCheckbox.executeAction("CLICK", tuple())
|
||||
# Enable shadow.
|
||||
with self.ui_test.execute_dialog_through_command(".uno:TableDialog") as tableDialog:
|
||||
tabs = tableDialog.getChild("tabcontrol")
|
||||
# Select "shadow".
|
||||
select_pos(tabs, "4")
|
||||
shadowCheckbox = tableDialog.getChild("TSB_SHOW_SHADOW")
|
||||
shadowCheckbox.executeAction("CLICK", tuple())
|
||||
|
||||
# Check if the shadow was enabled.
|
||||
component = self.ui_test.get_component()
|
||||
drawPage = component.getDrawPages().getByIndex(0)
|
||||
shape = drawPage.getByIndex(0)
|
||||
# Without the accompanying fix in place, this test would have failed with:
|
||||
# AssertionError: False != True
|
||||
# i.e. the table still had no shadow.
|
||||
self.assertEqual(shape.Shadow, True)
|
||||
# Check if the shadow was enabled.
|
||||
drawPage = component.getDrawPages().getByIndex(0)
|
||||
shape = drawPage.getByIndex(0)
|
||||
# Without the accompanying fix in place, this test would have failed with:
|
||||
# AssertionError: False != True
|
||||
# i.e. the table still had no shadow.
|
||||
self.assertEqual(shape.Shadow, True)
|
||||
|
||||
# Close the document.
|
||||
self.ui_test.close_doc()
|
||||
# Close the document.
|
||||
|
||||
def testUndoCrash(self):
|
||||
# Given an Impress document with a single table in it:
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
template = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.close_dialog_through_button(template.getChild("close"))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
self.xUITest.executeCommand(".uno:Delete")
|
||||
self.xUITest.executeCommand(".uno:InsertTable?Columns:short=3&Rows:short=3")
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress"):
|
||||
template = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.close_dialog_through_button(template.getChild("close"))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
self.xUITest.executeCommand(".uno:Delete")
|
||||
self.xUITest.executeCommand(".uno:InsertTable?Columns:short=3&Rows:short=3")
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
|
||||
# When enabling shadow on the shape while text edit is active:
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
impress = doc.getChild("impress_win")
|
||||
impress.executeAction("TYPE", mkPropertyValues({"TEXT": "A1"}))
|
||||
for i in range(6):
|
||||
impress.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+TAB"}))
|
||||
impress.executeAction("TYPE", mkPropertyValues({"TEXT": "A3"}))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
with self.ui_test.execute_dialog_through_command(".uno:TableDialog") as tableDialog:
|
||||
tabs = tableDialog.getChild("tabcontrol")
|
||||
# Select "shadow".
|
||||
select_pos(tabs, "4")
|
||||
shadowCheckbox = tableDialog.getChild("TSB_SHOW_SHADOW")
|
||||
shadowCheckbox.executeAction("CLICK", tuple())
|
||||
# When enabling shadow on the shape while text edit is active:
|
||||
doc = self.xUITest.getTopFocusWindow()
|
||||
impress = doc.getChild("impress_win")
|
||||
impress.executeAction("TYPE", mkPropertyValues({"TEXT": "A1"}))
|
||||
for i in range(6):
|
||||
impress.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+TAB"}))
|
||||
impress.executeAction("TYPE", mkPropertyValues({"TEXT": "A3"}))
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
with self.ui_test.execute_dialog_through_command(".uno:TableDialog") as tableDialog:
|
||||
tabs = tableDialog.getChild("tabcontrol")
|
||||
# Select "shadow".
|
||||
select_pos(tabs, "4")
|
||||
shadowCheckbox = tableDialog.getChild("TSB_SHOW_SHADOW")
|
||||
shadowCheckbox.executeAction("CLICK", tuple())
|
||||
|
||||
# Then make sure we don't crash:
|
||||
# Without the accompanying fix in place, this test would have failed crashed due to a
|
||||
# use-after-free: text edit ended but an undo action of the text edit remained on the undo
|
||||
# stack.
|
||||
for i in range(2):
|
||||
self.xUITest.executeCommand(".uno:Undo")
|
||||
# Then make sure we don't crash:
|
||||
# Without the accompanying fix in place, this test would have failed crashed due to a
|
||||
# use-after-free: text edit ended but an undo action of the text edit remained on the undo
|
||||
# stack.
|
||||
for i in range(2):
|
||||
self.xUITest.executeCommand(".uno:Undo")
|
||||
|
||||
# Close the document.
|
||||
self.ui_test.close_doc()
|
||||
# Close the document.
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -11,15 +11,14 @@ from uitest.framework import UITestCase
|
|||
class CharDialogText(UITestCase):
|
||||
|
||||
def test_select_char(self):
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:InsertSymbol", close_button="cancel") as xCharDialog:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:InsertSymbol", close_button="cancel") as xCharDialog:
|
||||
|
||||
xCharSet = xCharDialog.getChild("showcharset")
|
||||
xCharSet = xCharDialog.getChild("showcharset")
|
||||
|
||||
xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "2", "ROW": "2"}))
|
||||
xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "2", "ROW": "2"}))
|
||||
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -13,13 +13,12 @@ class CheckBoxTest(UITestCase):
|
|||
|
||||
def test_toggle_checkbox(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
xNegativeNumRedCB = xCellsDlg.getChild("negnumred")
|
||||
xNegativeNumRedCB.executeAction("CLICK",tuple())
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
xNegativeNumRedCB = xCellsDlg.getChild("negnumred")
|
||||
xNegativeNumRedCB.executeAction("CLICK",tuple())
|
||||
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -14,17 +14,16 @@ class ComboBoxTest(UITestCase):
|
|||
|
||||
def test_select_entry_pos(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
|
||||
xAddNameDlg = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
|
||||
xAddNameDlg = self.xUITest.getTopFocusWindow()
|
||||
|
||||
scopeCB = xAddNameDlg.getChild("scope")
|
||||
select_pos(scopeCB, "1")
|
||||
scopeCB = xAddNameDlg.getChild("scope")
|
||||
select_pos(scopeCB, "1")
|
||||
|
||||
xCancelBtn = xAddNameDlg.getChild("cancel")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
xCancelBtn = xAddNameDlg.getChild("cancel")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -12,13 +12,12 @@ class CommandWithParametersTest(UITestCase):
|
|||
|
||||
def test_text_color_change(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("writer")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("writer"):
|
||||
|
||||
self.xUITest.executeCommandWithParameters(".uno:Color",
|
||||
mkPropertyValues({"Color": 16776960}))
|
||||
xWriterEdit = self.xUITest.getTopFocusWindow().getChild("writer_edit")
|
||||
type_text(xWriterEdit, "LibreOffice")
|
||||
self.xUITest.executeCommandWithParameters(".uno:Color",
|
||||
mkPropertyValues({"Color": 16776960}))
|
||||
xWriterEdit = self.xUITest.getTopFocusWindow().getChild("writer_edit")
|
||||
type_text(xWriterEdit, "LibreOffice")
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -16,40 +16,38 @@ class EditTest(UITestCase):
|
|||
|
||||
def test_type_text(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
|
||||
xAddNameDlg = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
|
||||
xAddNameDlg = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xEdit = xAddNameDlg.getChild("edit")
|
||||
xEdit = xAddNameDlg.getChild("edit")
|
||||
|
||||
type_text(xEdit, "simpleRangeName")
|
||||
type_text(xEdit, "simpleRangeName")
|
||||
|
||||
xAddBtn = xAddNameDlg.getChild("cancel")
|
||||
self.ui_test.close_dialog_through_button(xAddBtn)
|
||||
xAddBtn = xAddNameDlg.getChild("cancel")
|
||||
self.ui_test.close_dialog_through_button(xAddBtn)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_select_text(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
|
||||
xAddNameDlg = self.xUITest.getTopFocusWindow()
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
|
||||
xAddNameDlg = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xEdit = xAddNameDlg.getChild("edit")
|
||||
xEdit = xAddNameDlg.getChild("edit")
|
||||
|
||||
type_text(xEdit, "simpleRangeName")
|
||||
xEdit.executeAction("SELECT", mkPropertyValues({"FROM": "2", "TO": "9"}))
|
||||
type_text(xEdit, "otherChars")
|
||||
self.assertEqual("siotherCharsgeName", get_state_as_dict(xEdit)["Text"])
|
||||
type_text(xEdit, "simpleRangeName")
|
||||
xEdit.executeAction("SELECT", mkPropertyValues({"FROM": "2", "TO": "9"}))
|
||||
type_text(xEdit, "otherChars")
|
||||
self.assertEqual("siotherCharsgeName", get_state_as_dict(xEdit)["Text"])
|
||||
|
||||
select_text(xEdit, from_pos="2", to="12")
|
||||
self.assertEqual("otherChars", get_state_as_dict(xEdit)["SelectedText"])
|
||||
select_text(xEdit, from_pos="2", to="12")
|
||||
self.assertEqual("otherChars", get_state_as_dict(xEdit)["SelectedText"])
|
||||
|
||||
xAddBtn = xAddNameDlg.getChild("cancel")
|
||||
self.ui_test.close_dialog_through_button(xAddBtn)
|
||||
xAddBtn = xAddNameDlg.getChild("cancel")
|
||||
self.ui_test.close_dialog_through_button(xAddBtn)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -13,39 +13,36 @@ class GridWinTest(UITestCase):
|
|||
|
||||
def test_select_cell(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
xCalcDoc = self.xUITest.getTopFocusWindow()
|
||||
xGridWindow = xCalcDoc.getChild("grid_window")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
xCalcDoc = self.xUITest.getTopFocusWindow()
|
||||
xGridWindow = xCalcDoc.getChild("grid_window")
|
||||
|
||||
selectProps = mkPropertyValues({"CELL": "B10"})
|
||||
xGridWindow.executeAction("SELECT", selectProps)
|
||||
selectProps = mkPropertyValues({"CELL": "B10"})
|
||||
xGridWindow.executeAction("SELECT", selectProps)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_select_range(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
xCalcDoc = self.xUITest.getTopFocusWindow()
|
||||
xGridWindow = xCalcDoc.getChild("grid_window")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
xCalcDoc = self.xUITest.getTopFocusWindow()
|
||||
xGridWindow = xCalcDoc.getChild("grid_window")
|
||||
|
||||
selectProps = mkPropertyValues({"RANGE": "B10:C20"})
|
||||
xGridWindow.executeAction("SELECT", selectProps)
|
||||
selectProps = mkPropertyValues({"RANGE": "B10:C20"})
|
||||
xGridWindow.executeAction("SELECT", selectProps)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_extend_range(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
xTopWindow = self.xUITest.getTopFocusWindow()
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
xTopWindow = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xGridWindow = xTopWindow.getChild("grid_window")
|
||||
xGridWindow = xTopWindow.getChild("grid_window")
|
||||
|
||||
selectProps = mkPropertyValues({"RANGE": "B10:C20"})
|
||||
xGridWindow.executeAction("SELECT", selectProps)
|
||||
selectProps = mkPropertyValues({"RANGE": "B10:C20"})
|
||||
xGridWindow.executeAction("SELECT", selectProps)
|
||||
|
||||
select2Props = mkPropertyValues({"RANGE": "D3:F5", "EXTEND": "true"})
|
||||
xGridWindow.executeAction("SELECT", select2Props)
|
||||
select2Props = mkPropertyValues({"RANGE": "D3:F5", "EXTEND": "true"})
|
||||
xGridWindow.executeAction("SELECT", select2Props)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -15,18 +15,17 @@ class CheckBoxTest(UITestCase):
|
|||
|
||||
def test_get_json(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:About", close_button="btnClose") as xAboutDlg:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:About", close_button="btnClose") as xAboutDlg:
|
||||
|
||||
|
||||
json_string = xAboutDlg.getHierarchy()
|
||||
print(json_string)
|
||||
json_content = json.loads(json_string)
|
||||
print(json_content)
|
||||
print(json.dumps(json_content, indent=4))
|
||||
json_string = xAboutDlg.getHierarchy()
|
||||
print(json_string)
|
||||
json_content = json.loads(json_string)
|
||||
print(json_content)
|
||||
print(json.dumps(json_content, indent=4))
|
||||
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -14,20 +14,18 @@ class ListBoxTest(UITestCase):
|
|||
|
||||
def test_select_entry_pos(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog"):
|
||||
pass
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog"):
|
||||
pass
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_select_entry_text(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog"):
|
||||
pass
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog"):
|
||||
pass
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -25,13 +25,12 @@ class RadioButtonTest(UITestCase):
|
|||
|
||||
def test_toggle_radiobutton(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
xNegativeNumRedCB = xCellsDlg.getChild("negnumred")
|
||||
xNegativeNumRedCB.executeAction("CLICK",tuple())
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
xNegativeNumRedCB = xCellsDlg.getChild("negnumred")
|
||||
xNegativeNumRedCB.executeAction("CLICK",tuple())
|
||||
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -14,53 +14,50 @@ class SpinFieldTest(UITestCase):
|
|||
|
||||
def test_up(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
|
||||
xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
|
||||
xDecimalPlaces.executeAction("UP", tuple())
|
||||
xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
|
||||
xDecimalPlaces.executeAction("UP", tuple())
|
||||
|
||||
decimal_places_state = get_state_as_dict(xDecimalPlaces)
|
||||
assert(decimal_places_state["Text"] == "2")
|
||||
decimal_places_state = get_state_as_dict(xDecimalPlaces)
|
||||
assert(decimal_places_state["Text"] == "2")
|
||||
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_down(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
|
||||
xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
|
||||
xDecimalPlaces.executeAction("UP", tuple())
|
||||
xDecimalPlaces.executeAction("UP", tuple())
|
||||
xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
|
||||
xDecimalPlaces.executeAction("UP", tuple())
|
||||
xDecimalPlaces.executeAction("UP", tuple())
|
||||
|
||||
decimal_places_state = get_state_as_dict(xDecimalPlaces)
|
||||
assert(decimal_places_state["Text"] == "3")
|
||||
decimal_places_state = get_state_as_dict(xDecimalPlaces)
|
||||
assert(decimal_places_state["Text"] == "3")
|
||||
|
||||
xDecimalPlaces.executeAction("DOWN", tuple())
|
||||
xDecimalPlaces.executeAction("DOWN", tuple())
|
||||
|
||||
decimal_places_state = get_state_as_dict(xDecimalPlaces)
|
||||
assert(decimal_places_state["Text"] == "2")
|
||||
decimal_places_state = get_state_as_dict(xDecimalPlaces)
|
||||
assert(decimal_places_state["Text"] == "2")
|
||||
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_text(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg:
|
||||
|
||||
xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
|
||||
type_text(xDecimalPlaces, "4")
|
||||
xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
|
||||
type_text(xDecimalPlaces, "4")
|
||||
|
||||
decimal_places_state = get_state_as_dict(xDecimalPlaces)
|
||||
assert(decimal_places_state["Text"] == "41")
|
||||
decimal_places_state = get_state_as_dict(xDecimalPlaces)
|
||||
assert(decimal_places_state["Text"] == "41")
|
||||
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -16,23 +16,22 @@ class TabControlTest(UITestCase):
|
|||
|
||||
def test_select_pos(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
xCalcDoc = self.xUITest.getTopFocusWindow()
|
||||
xGridWindow = xCalcDoc.getChild("grid_window")
|
||||
enter_text_to_cell(xGridWindow, "B2", "=2+3+4")
|
||||
xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
|
||||
xCalcDoc = self.xUITest.getTopFocusWindow()
|
||||
xGridWindow = xCalcDoc.getChild("grid_window")
|
||||
enter_text_to_cell(xGridWindow, "B2", "=2+3+4")
|
||||
xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
|
||||
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
|
||||
|
||||
xFunctionDlg = self.xUITest.getTopFocusWindow()
|
||||
xFunctionDlg = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xTabs = xFunctionDlg.getChild("tabcontrol")
|
||||
select_pos(xTabs, "1")
|
||||
xTabs = xFunctionDlg.getChild("tabcontrol")
|
||||
select_pos(xTabs, "1")
|
||||
|
||||
xCancelBtn = xFunctionDlg.getChild("cancel")
|
||||
xCancelBtn.executeAction("CLICK", tuple())
|
||||
xCancelBtn = xFunctionDlg.getChild("cancel")
|
||||
xCancelBtn.executeAction("CLICK", tuple())
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -14,20 +14,18 @@ class TabDialogTest(UITestCase):
|
|||
|
||||
def test_select_tab_page_pos(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog"):
|
||||
pass
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog"):
|
||||
pass
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_select_tab_page_name(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog"):
|
||||
pass
|
||||
with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog"):
|
||||
pass
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -16,31 +16,30 @@ class TreeListTest(UITestCase):
|
|||
|
||||
def test_expand(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("calc")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("calc"):
|
||||
|
||||
xCalcDoc = self.xUITest.getTopFocusWindow()
|
||||
xGridWindow = xCalcDoc.getChild("grid_window")
|
||||
enter_text_to_cell(xGridWindow, "B2", "=2+3+4")
|
||||
xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
|
||||
xCalcDoc = self.xUITest.getTopFocusWindow()
|
||||
xGridWindow = xCalcDoc.getChild("grid_window")
|
||||
enter_text_to_cell(xGridWindow, "B2", "=2+3+4")
|
||||
xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
|
||||
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
|
||||
self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
|
||||
|
||||
xFunctionDlg = self.xUITest.getTopFocusWindow()
|
||||
xFunctionDlg = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xTabs = xFunctionDlg.getChild("tabcontrol")
|
||||
select_pos(xTabs, "1")
|
||||
xTabs = xFunctionDlg.getChild("tabcontrol")
|
||||
select_pos(xTabs, "1")
|
||||
|
||||
xTreelist = xTabs.getChild("struct")
|
||||
xTreelist = xTabs.getChild("struct")
|
||||
|
||||
xTreeEntry = xTreelist.getChild('0')
|
||||
xTreeEntry = xTreelist.getChild('0')
|
||||
|
||||
xTreeEntry.executeAction("COLLAPSE", tuple())
|
||||
xTreeEntry.executeAction("COLLAPSE", tuple())
|
||||
|
||||
xTreeEntry.executeAction("EXPAND", tuple())
|
||||
xTreeEntry.executeAction("EXPAND", tuple())
|
||||
|
||||
xCancelBtn = xFunctionDlg.getChild("cancel")
|
||||
xCancelBtn.executeAction("CLICK", tuple())
|
||||
xCancelBtn = xFunctionDlg.getChild("cancel")
|
||||
xCancelBtn.executeAction("CLICK", tuple())
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -105,38 +105,37 @@ class ImpressBackgrounds(UITestCase):
|
|||
|
||||
def test_background_dialog(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress"):
|
||||
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
|
||||
buttons = ['btnbitmap', 'btncolor', 'btngradient', 'btnhatch', 'btnpattern']
|
||||
for index, button in enumerate(buttons):
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PageSetup") as xPageSetupDlg:
|
||||
buttons = ['btnbitmap', 'btncolor', 'btngradient', 'btnhatch', 'btnpattern']
|
||||
for index, button in enumerate(buttons):
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PageSetup") as xPageSetupDlg:
|
||||
|
||||
tabcontrol = xPageSetupDlg.getChild("tabcontrol")
|
||||
select_pos(tabcontrol, "1")
|
||||
tabcontrol = xPageSetupDlg.getChild("tabcontrol")
|
||||
select_pos(tabcontrol, "1")
|
||||
|
||||
xBtn = xPageSetupDlg.getChild(button)
|
||||
xBtn.executeAction("CLICK", tuple())
|
||||
xBtn = xPageSetupDlg.getChild(button)
|
||||
xBtn.executeAction("CLICK", tuple())
|
||||
|
||||
# tdf#100024: Without the fix in place, this test would have crashed here
|
||||
# changing the background to bitmap
|
||||
# tdf#100024: Without the fix in place, this test would have crashed here
|
||||
# changing the background to bitmap
|
||||
|
||||
self.checkDefaultBackground(button)
|
||||
self.checkDefaultBackground(button)
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PageSetup") as xPageSetupDlg:
|
||||
with self.ui_test.execute_dialog_through_command(".uno:PageSetup") as xPageSetupDlg:
|
||||
|
||||
tabcontrol = xPageSetupDlg.getChild("tabcontrol")
|
||||
select_pos(tabcontrol, "1")
|
||||
tabcontrol = xPageSetupDlg.getChild("tabcontrol")
|
||||
select_pos(tabcontrol, "1")
|
||||
|
||||
xBtn = xPageSetupDlg.getChild('btnnone')
|
||||
xBtn.executeAction("CLICK", tuple())
|
||||
xBtn = xPageSetupDlg.getChild('btnnone')
|
||||
xBtn.executeAction("CLICK", tuple())
|
||||
|
||||
|
||||
self.checkDefaultBackground('btnnone')
|
||||
self.checkDefaultBackground('btnnone')
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -13,134 +13,128 @@ from uitest.framework import UITestCase
|
|||
class ImpressDrawinglayerTest(UITestCase):
|
||||
|
||||
def test_move_object(self):
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress") as document:
|
||||
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
|
||||
change_measurement_unit(self, 'Centimeter')
|
||||
change_measurement_unit(self, 'Centimeter')
|
||||
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
document = self.ui_test.get_component()
|
||||
self.assertEqual(1400, document.DrawPages[0].getByIndex(0).Position.X)
|
||||
self.assertEqual(628, document.DrawPages[0].getByIndex(0).Position.Y)
|
||||
self.assertEqual(1400, document.DrawPages[0].getByIndex(1).Position.X)
|
||||
self.assertEqual(3685, document.DrawPages[0].getByIndex(1).Position.Y)
|
||||
self.assertEqual(1400, document.DrawPages[0].getByIndex(0).Position.X)
|
||||
self.assertEqual(628, document.DrawPages[0].getByIndex(0).Position.Y)
|
||||
self.assertEqual(1400, document.DrawPages[0].getByIndex(1).Position.X)
|
||||
self.assertEqual(3685, document.DrawPages[0].getByIndex(1).Position.Y)
|
||||
|
||||
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
xDrawinglayerObject = xEditWin.getChild("Unnamed Drawinglayer object 1")
|
||||
xDrawinglayerObject.executeAction("MOVE", mkPropertyValues({"X": "1000", "Y":"1000"}))
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
xDrawinglayerObject = xEditWin.getChild("Unnamed Drawinglayer object 1")
|
||||
xDrawinglayerObject.executeAction("MOVE", mkPropertyValues({"X": "1000", "Y":"1000"}))
|
||||
|
||||
self.assertEqual(1400, document.DrawPages[0].getByIndex(0).Position.X)
|
||||
self.assertEqual(628, document.DrawPages[0].getByIndex(0).Position.Y)
|
||||
self.assertEqual(2400, document.DrawPages[0].getByIndex(1).Position.X)
|
||||
self.assertEqual(4685, document.DrawPages[0].getByIndex(1).Position.Y)
|
||||
self.assertEqual(1400, document.DrawPages[0].getByIndex(0).Position.X)
|
||||
self.assertEqual(628, document.DrawPages[0].getByIndex(0).Position.Y)
|
||||
self.assertEqual(2400, document.DrawPages[0].getByIndex(1).Position.X)
|
||||
self.assertEqual(4685, document.DrawPages[0].getByIndex(1).Position.Y)
|
||||
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
|
||||
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"}))
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"}))
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:Size") as xDialog:
|
||||
self.assertEqual('25.2', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value'])
|
||||
self.assertEqual('9.13', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value'])
|
||||
self.assertEqual('2.4', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value'])
|
||||
self.assertEqual('4.69', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value'])
|
||||
self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
|
||||
with self.ui_test.execute_dialog_through_command(".uno:Size") as xDialog:
|
||||
self.assertEqual('25.2', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value'])
|
||||
self.assertEqual('9.13', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value'])
|
||||
self.assertEqual('2.4', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value'])
|
||||
self.assertEqual('4.69', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value'])
|
||||
self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
|
||||
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
xEditWin.executeAction("DESELECT", tuple())
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
xEditWin.executeAction("DESELECT", tuple())
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_resize_object(self):
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress") as document:
|
||||
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
|
||||
change_measurement_unit(self, 'Centimeter')
|
||||
change_measurement_unit(self, 'Centimeter')
|
||||
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
document = self.ui_test.get_component()
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(0).Size.Width)
|
||||
self.assertEqual(2629, document.DrawPages[0].getByIndex(0).Size.Height)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(1).Size.Width)
|
||||
self.assertEqual(9134, document.DrawPages[0].getByIndex(1).Size.Height)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(0).Size.Width)
|
||||
self.assertEqual(2629, document.DrawPages[0].getByIndex(0).Size.Height)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(1).Size.Width)
|
||||
self.assertEqual(9134, document.DrawPages[0].getByIndex(1).Size.Height)
|
||||
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
|
||||
xDrawinglayerObject = xEditWin.getChild("Unnamed Drawinglayer object 1")
|
||||
xDrawinglayerObject.executeAction("RESIZE", mkPropertyValues({"X": "500", "Y":"4000", "FRAC_X": "0.5", "FRAC_Y": "0.5"}))
|
||||
xDrawinglayerObject = xEditWin.getChild("Unnamed Drawinglayer object 1")
|
||||
xDrawinglayerObject.executeAction("RESIZE", mkPropertyValues({"X": "500", "Y":"4000", "FRAC_X": "0.5", "FRAC_Y": "0.5"}))
|
||||
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(0).Size.Width)
|
||||
self.assertEqual(2629, document.DrawPages[0].getByIndex(0).Size.Height)
|
||||
self.assertEqual(12600, document.DrawPages[0].getByIndex(1).Size.Width)
|
||||
self.assertEqual(4568, document.DrawPages[0].getByIndex(1).Size.Height)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(0).Size.Width)
|
||||
self.assertEqual(2629, document.DrawPages[0].getByIndex(0).Size.Height)
|
||||
self.assertEqual(12600, document.DrawPages[0].getByIndex(1).Size.Width)
|
||||
self.assertEqual(4568, document.DrawPages[0].getByIndex(1).Size.Height)
|
||||
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
|
||||
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"}))
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"}))
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:Size") as xDialog:
|
||||
self.assertEqual('12.6', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value'])
|
||||
self.assertEqual('4.57', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value'])
|
||||
self.assertEqual('0.95', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value'])
|
||||
self.assertEqual('3.84', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value'])
|
||||
self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
|
||||
with self.ui_test.execute_dialog_through_command(".uno:Size") as xDialog:
|
||||
self.assertEqual('12.6', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value'])
|
||||
self.assertEqual('4.57', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value'])
|
||||
self.assertEqual('0.95', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value'])
|
||||
self.assertEqual('3.84', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value'])
|
||||
self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
|
||||
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
xEditWin.executeAction("DESELECT", tuple())
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
xEditWin.executeAction("DESELECT", tuple())
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_rotate_object(self):
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress") as document:
|
||||
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
document = self.ui_test.get_component()
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(0).Size.Width)
|
||||
self.assertEqual(2629, document.DrawPages[0].getByIndex(0).Size.Height)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(1).Size.Width)
|
||||
self.assertEqual(9134, document.DrawPages[0].getByIndex(1).Size.Height)
|
||||
self.assertEqual(0, document.DrawPages[0].getByIndex(1).RotateAngle)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(0).Size.Width)
|
||||
self.assertEqual(2629, document.DrawPages[0].getByIndex(0).Size.Height)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(1).Size.Width)
|
||||
self.assertEqual(9134, document.DrawPages[0].getByIndex(1).Size.Height)
|
||||
self.assertEqual(0, document.DrawPages[0].getByIndex(1).RotateAngle)
|
||||
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
|
||||
xDrawinglayerObject = xEditWin.getChild("Unnamed Drawinglayer object 1")
|
||||
xDrawinglayerObject.executeAction("ROTATE", mkPropertyValues({"X": "500", "Y":"4000", "ANGLE": "3000"}))
|
||||
xDrawinglayerObject = xEditWin.getChild("Unnamed Drawinglayer object 1")
|
||||
xDrawinglayerObject.executeAction("ROTATE", mkPropertyValues({"X": "500", "Y":"4000", "ANGLE": "3000"}))
|
||||
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(0).Size.Width)
|
||||
self.assertEqual(2629, document.DrawPages[0].getByIndex(0).Size.Height)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(1).Size.Width)
|
||||
self.assertEqual(9134, document.DrawPages[0].getByIndex(1).Size.Height)
|
||||
self.assertEqual(3000, document.DrawPages[0].getByIndex(1).RotateAngle)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(0).Size.Width)
|
||||
self.assertEqual(2629, document.DrawPages[0].getByIndex(0).Size.Height)
|
||||
self.assertEqual(25199, document.DrawPages[0].getByIndex(1).Size.Width)
|
||||
self.assertEqual(9134, document.DrawPages[0].getByIndex(1).Size.Height)
|
||||
self.assertEqual(3000, document.DrawPages[0].getByIndex(1).RotateAngle)
|
||||
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
|
||||
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"}))
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"}))
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
|
||||
with self.ui_test.execute_dialog_through_command(".uno:Size") as xDialog:
|
||||
self.assertEqual('30', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
|
||||
with self.ui_test.execute_dialog_through_command(".uno:Size") as xDialog:
|
||||
self.assertEqual('30', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
|
||||
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
xEditWin.executeAction("DESELECT", tuple())
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
|
||||
xEditWin.executeAction("DESELECT", tuple())
|
||||
self.assertIsNone(document.CurrentSelection)
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -11,33 +11,32 @@ class ImpressLayouts(UITestCase):
|
|||
|
||||
def test_impress_layouts(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress"):
|
||||
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
|
||||
layouts= (".uno:AssignLayout?WhatLayout:long=20", ".uno:AssignLayout?WhatLayout:long=19",
|
||||
".uno:AssignLayout?WhatLayout:long=0", ".uno:AssignLayout?WhatLayout:long=1",
|
||||
".uno:AssignLayout?WhatLayout:long=32", ".uno:AssignLayout?WhatLayout:long=3",
|
||||
".uno:AssignLayout?WhatLayout:long=12", ".uno:AssignLayout?WhatLayout:long=15",
|
||||
".uno:AssignLayout?WhatLayout:long=14", ".uno:AssignLayout?WhatLayout:long=16",
|
||||
".uno:AssignLayout?WhatLayout:long=18", ".uno:AssignLayout?WhatLayout:long=34",
|
||||
".uno:AssignLayout?WhatLayout:long=28", ".uno:AssignLayout?WhatLayout:long=27",
|
||||
".uno:AssignLayout?WhatLayout:long=29", ".uno:AssignLayout?WhatLayout:long=30")
|
||||
layouts= (".uno:AssignLayout?WhatLayout:long=20", ".uno:AssignLayout?WhatLayout:long=19",
|
||||
".uno:AssignLayout?WhatLayout:long=0", ".uno:AssignLayout?WhatLayout:long=1",
|
||||
".uno:AssignLayout?WhatLayout:long=32", ".uno:AssignLayout?WhatLayout:long=3",
|
||||
".uno:AssignLayout?WhatLayout:long=12", ".uno:AssignLayout?WhatLayout:long=15",
|
||||
".uno:AssignLayout?WhatLayout:long=14", ".uno:AssignLayout?WhatLayout:long=16",
|
||||
".uno:AssignLayout?WhatLayout:long=18", ".uno:AssignLayout?WhatLayout:long=34",
|
||||
".uno:AssignLayout?WhatLayout:long=28", ".uno:AssignLayout?WhatLayout:long=27",
|
||||
".uno:AssignLayout?WhatLayout:long=29", ".uno:AssignLayout?WhatLayout:long=30")
|
||||
|
||||
for i in layouts:
|
||||
self.xUITest.executeCommand(i)
|
||||
for i in layouts:
|
||||
self.xUITest.executeCommand(i)
|
||||
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
|
||||
# There's a layout with 7 objects
|
||||
for j in range(0,6):
|
||||
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object " + str(j)}))
|
||||
xEditWin.executeAction("DESELECT", tuple())
|
||||
# There's a layout with 7 objects
|
||||
for j in range(0,6):
|
||||
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object " + str(j)}))
|
||||
xEditWin.executeAction("DESELECT", tuple())
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -12,43 +12,41 @@ from uitest.framework import UITestCase
|
|||
class SimpleImpressTest(UITestCase):
|
||||
def test_start_impress(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress"):
|
||||
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
xEditWin.executeAction("SET", mkPropertyValues({"ZOOM": "200"}))
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
xEditWin.executeAction("SET", mkPropertyValues({"ZOOM": "200"}))
|
||||
|
||||
self.assertEqual(get_state_as_dict(xEditWin)["Zoom"], "200")
|
||||
self.assertEqual(get_state_as_dict(xEditWin)["Zoom"], "200")
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_select_page(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("impress")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("impress"):
|
||||
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
xTemplateDlg = self.xUITest.getTopFocusWindow()
|
||||
xCancelBtn = xTemplateDlg.getChild("close")
|
||||
self.ui_test.close_dialog_through_button(xCancelBtn)
|
||||
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
xImpressDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
xEditWin = xImpressDoc.getChild("impress_win")
|
||||
|
||||
self.assertEqual(get_state_as_dict(xEditWin)["CurrentSlide"], "1")
|
||||
self.assertEqual(get_state_as_dict(xEditWin)["CurrentSlide"], "1")
|
||||
|
||||
self.xUITest.executeCommand(".uno:InsertPage")
|
||||
self.xUITest.executeCommand(".uno:InsertPage")
|
||||
|
||||
self.assertEqual(get_state_as_dict(xEditWin)["CurrentSlide"], "2")
|
||||
self.assertEqual(get_state_as_dict(xEditWin)["CurrentSlide"], "2")
|
||||
|
||||
xEditWin.executeAction("GOTO", mkPropertyValues({"PAGE": "1"}))
|
||||
xEditWin.executeAction("GOTO", mkPropertyValues({"PAGE": "1"}))
|
||||
|
||||
self.assertEqual(get_state_as_dict(xEditWin)["CurrentSlide"], "1")
|
||||
self.assertEqual(get_state_as_dict(xEditWin)["CurrentSlide"], "1")
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -18,74 +18,69 @@ class SimpleMathTest(UITestCase):
|
|||
|
||||
def test_start_math(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("math")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("math"):
|
||||
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_docking_window_listbox(self):
|
||||
|
||||
self.ui_test.create_doc_in_start_center("math")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("math"):
|
||||
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xList = xMathDoc.getChild("listbox")
|
||||
state = get_state_as_dict(xList)
|
||||
self.assertEqual(state["SelectEntryText"], "Unary/Binary Operators")
|
||||
select_pos(xList, "1")
|
||||
state = get_state_as_dict(xList)
|
||||
self.assertEqual(state["SelectEntryText"], "Relations")
|
||||
xList = xMathDoc.getChild("listbox")
|
||||
state = get_state_as_dict(xList)
|
||||
self.assertEqual(state["SelectEntryText"], "Unary/Binary Operators")
|
||||
select_pos(xList, "1")
|
||||
state = get_state_as_dict(xList)
|
||||
self.assertEqual(state["SelectEntryText"], "Relations")
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_math_edit(self):
|
||||
self.ui_test.create_doc_in_start_center("math")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("math"):
|
||||
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xMathEdit = xMathDoc.getChild("math_edit")
|
||||
xMathEdit = xMathDoc.getChild("math_edit")
|
||||
|
||||
type_text(xMathEdit, "E=mc^2")
|
||||
type_text(xMathEdit, "E=mc^2")
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
def test_math_selector(self):
|
||||
self.ui_test.create_doc_in_start_center("math")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("math"):
|
||||
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xMathSelector = xMathDoc.getChild("element_selector")
|
||||
xMathSelector = xMathDoc.getChild("element_selector")
|
||||
|
||||
xElement = xMathSelector.getChild("1")
|
||||
xElement.executeAction("SELECT", tuple())
|
||||
xElement = xMathSelector.getChild("1")
|
||||
xElement.executeAction("SELECT", tuple())
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
@unittest.skip("on windows the f4 does not always work")
|
||||
def test_complete_math(self):
|
||||
self.ui_test.create_doc_in_start_center("math")
|
||||
with self.ui_test.create_doc_in_start_center_guarded("math"):
|
||||
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
xMathDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
xList = xMathDoc.getChild("listbox")
|
||||
state = get_state_as_dict(xList)
|
||||
self.assertEqual(state["SelectEntryText"], "Unary/Binary Operators")
|
||||
select_pos(xList, "1")
|
||||
xList = xMathDoc.getChild("listbox")
|
||||
state = get_state_as_dict(xList)
|
||||
self.assertEqual(state["SelectEntryText"], "Unary/Binary Operators")
|
||||
select_pos(xList, "1")
|
||||
|
||||
xMathSelector = xMathDoc.getChild("element_selector")
|
||||
xMathSelector = xMathDoc.getChild("element_selector")
|
||||
|
||||
xElement = xMathSelector.getChild("1")
|
||||
xElement.executeAction("SELECT", tuple())
|
||||
xElement = xMathSelector.getChild("1")
|
||||
xElement.executeAction("SELECT", tuple())
|
||||
|
||||
xMathEdit = xMathDoc.getChild("math_edit")
|
||||
type_text(xMathEdit, "1")
|
||||
xMathEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F4"}))
|
||||
type_text(xMathEdit, "2")
|
||||
xMathEdit = xMathDoc.getChild("math_edit")
|
||||
type_text(xMathEdit, "1")
|
||||
xMathEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F4"}))
|
||||
type_text(xMathEdit, "2")
|
||||
|
||||
edit_state = get_state_as_dict(xMathEdit)
|
||||
self.assertEqual("1 <> 2 ", edit_state["Text"])
|
||||
edit_state = get_state_as_dict(xMathEdit)
|
||||
self.assertEqual("1 <> 2 ", edit_state["Text"])
|
||||
|
||||
self.ui_test.close_doc()
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
|
@ -12,22 +12,21 @@ from uitest.uihelper.common import get_state_as_dict
|
|||
# and if there is an "OK" button open the dialog again and close it by using the OK button
|
||||
# the test only checks if LibreOffice crashes by opening the dialog
|
||||
def testDialog(UITestCase, app, dialog):
|
||||
doc = UITestCase.ui_test.create_doc_in_start_center(app)
|
||||
with UITestCase.ui_test.execute_dialog_through_command(dialog['command'], close_button=dialog['closeButton']) as xDialog:
|
||||
if 'skipTestOK' in dialog and dialog['skipTestOK'] == True:
|
||||
xOKBtn = None
|
||||
else:
|
||||
try:
|
||||
xOKBtn = xDialog.getChild("ok")
|
||||
if (get_state_as_dict(xOKBtn)["Enabled"] != "true"):
|
||||
xOKBtn = None
|
||||
except:
|
||||
with UITestCase.ui_test.create_doc_in_start_center_guarded(app):
|
||||
with UITestCase.ui_test.execute_dialog_through_command(dialog['command'], close_button=dialog['closeButton']) as xDialog:
|
||||
if 'skipTestOK' in dialog and dialog['skipTestOK'] == True:
|
||||
xOKBtn = None
|
||||
else:
|
||||
try:
|
||||
xOKBtn = xDialog.getChild("ok")
|
||||
if (get_state_as_dict(xOKBtn)["Enabled"] != "true"):
|
||||
xOKBtn = None
|
||||
except:
|
||||
xOKBtn = None
|
||||
|
||||
if (xOKBtn != None):
|
||||
print("check also OK button")
|
||||
with UITestCase.ui_test.execute_dialog_through_command(dialog['command']):
|
||||
pass
|
||||
UITestCase.ui_test.close_doc()
|
||||
if (xOKBtn != None):
|
||||
print("check also OK button")
|
||||
with UITestCase.ui_test.execute_dialog_through_command(dialog['command']):
|
||||
pass
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
||||
|
|
Loading…
Reference in a new issue