summaryrefslogtreecommitdiff
path: root/sw/qa/uitest
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/uitest')
-rw-r--r--sw/qa/uitest/chapterNumbering/chapterNumbering.py127
-rw-r--r--sw/qa/uitest/chapterNumbering/tdf140528.py50
-rw-r--r--sw/qa/uitest/chart/tdf138556.py71
-rw-r--r--sw/qa/uitest/classification/classification.py251
-rw-r--r--sw/qa/uitest/findBar/findbar.py80
-rw-r--r--sw/qa/uitest/findBar/tdf136941.py66
-rw-r--r--sw/qa/uitest/findBar/tdf138232.py46
-rw-r--r--sw/qa/uitest/findBar/tdf88608.py52
-rw-r--r--sw/qa/uitest/findReplace/findReplace.py80
-rw-r--r--sw/qa/uitest/findReplace/tdf106099.py47
-rw-r--r--sw/qa/uitest/findReplace/tdf119462.py45
-rw-r--r--sw/qa/uitest/librelogo/run.py118
-rw-r--r--sw/qa/uitest/macro_tests/tdf124413.py56
-rw-r--r--sw/qa/uitest/macro_tests/tdf64690.py78
-rw-r--r--sw/qa/uitest/navigator/tdf137274.py62
-rw-r--r--sw/qa/uitest/navigator/tdf140257.py116
-rw-r--r--sw/qa/uitest/options/optionsDialog.py64
-rw-r--r--sw/qa/uitest/options/tdf131581.py34
-rw-r--r--sw/qa/uitest/options/tdf78133.py61
-rw-r--r--sw/qa/uitest/sidebar/stylesSidebar.py86
-rw-r--r--sw/qa/uitest/sidebar/tdf133189.py124
-rw-r--r--sw/qa/uitest/sidebar/tdf135590.py90
-rw-r--r--sw/qa/uitest/styleInspector/tdf137105.py48
-rw-r--r--sw/qa/uitest/styleInspector/tdf137513.py66
-rw-r--r--sw/qa/uitest/table/insertTableDialog.py84
-rw-r--r--sw/qa/uitest/table/sheetToTable.py22
-rw-r--r--sw/qa/uitest/table/tdf115026.py29
-rw-r--r--sw/qa/uitest/table/tdf116737.py71
-rwxr-xr-xsw/qa/uitest/table/tdf128593.py44
-rw-r--r--sw/qa/uitest/table/textToTable.py46
-rw-r--r--sw/qa/uitest/ui/fmtui/fmtui.py35
-rw-r--r--sw/qa/uitest/ui/index/index.py71
-rw-r--r--sw/qa/uitest/writer_tests/comments.py240
-rw-r--r--sw/qa/uitest/writer_tests/insertCaption.py84
-rw-r--r--sw/qa/uitest/writer_tests/tdf134734.py134
-rw-r--r--sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py24
-rw-r--r--sw/qa/uitest/writer_tests/tdf53460.py111
-rw-r--r--sw/qa/uitest/writer_tests/tdf78068.py29
-rw-r--r--sw/qa/uitest/writer_tests/tdf93068.py65
-rw-r--r--sw/qa/uitest/writer_tests/trackedChanges.py196
-rw-r--r--sw/qa/uitest/writer_tests/watermark.py95
-rw-r--r--sw/qa/uitest/writer_tests/wordCount.py307
-rw-r--r--sw/qa/uitest/writer_tests2/asianPhoneticGuide.py41
-rw-r--r--sw/qa/uitest/writer_tests2/bookmark.py180
-rw-r--r--sw/qa/uitest/writer_tests2/deleteAllComments.py45
-rw-r--r--sw/qa/uitest/writer_tests2/documentProperties.py192
-rw-r--r--sw/qa/uitest/writer_tests2/exchangeDatabase.py54
-rw-r--r--sw/qa/uitest/writer_tests2/fontworks.py36
-rw-r--r--sw/qa/uitest/writer_tests2/formatBulletsNumbering.py591
-rw-r--r--sw/qa/uitest/writer_tests2/formatCharacter.py486
-rw-r--r--sw/qa/uitest/writer_tests2/formatParagraph.py1171
-rw-r--r--sw/qa/uitest/writer_tests2/horizontalLine.py39
-rw-r--r--sw/qa/uitest/writer_tests2/insertFootnote.py35
-rw-r--r--sw/qa/uitest/writer_tests2/pasteSpecial.py36
-rw-r--r--sw/qa/uitest/writer_tests2/tdf116474.py65
-rw-r--r--sw/qa/uitest/writer_tests3/autoredactDialog.py209
-rw-r--r--sw/qa/uitest/writer_tests3/customizeDialog.py169
-rw-r--r--sw/qa/uitest/writer_tests3/hyperlinkdialog.py109
-rw-r--r--sw/qa/uitest/writer_tests3/insertEndnote.py35
-rw-r--r--sw/qa/uitest/writer_tests3/insertEnvelope.py47
-rw-r--r--sw/qa/uitest/writer_tests3/insertFootEndnote.py105
-rw-r--r--sw/qa/uitest/writer_tests3/insertPageFooter.py33
-rw-r--r--sw/qa/uitest/writer_tests3/insertQrCodeGen.py113
-rw-r--r--sw/qa/uitest/writer_tests3/insertSignatureLine.py155
-rw-r--r--sw/qa/uitest/writer_tests3/lineNumbering.py146
-rw-r--r--sw/qa/uitest/writer_tests3/pageDialog.py112
-rw-r--r--sw/qa/uitest/writer_tests3/sort.py89
-rw-r--r--sw/qa/uitest/writer_tests3/specialCharacter.py105
-rw-r--r--sw/qa/uitest/writer_tests3/tdf79236.py148
-rw-r--r--sw/qa/uitest/writer_tests4/insertBreakDialog.py58
-rw-r--r--sw/qa/uitest/writer_tests4/insertPageHeader.py34
-rw-r--r--sw/qa/uitest/writer_tests4/spellDialog.py74
-rw-r--r--sw/qa/uitest/writer_tests4/start.py32
-rw-r--r--sw/qa/uitest/writer_tests4/tdf113252.py47
-rw-r--r--sw/qa/uitest/writer_tests4/tdf115572.py109
-rw-r--r--sw/qa/uitest/writer_tests4/tdf115573.py211
-rw-r--r--sw/qa/uitest/writer_tests4/tdf51352.py71
-rw-r--r--sw/qa/uitest/writer_tests4/tdf92611.py8
-rw-r--r--sw/qa/uitest/writer_tests5/about_test.py12
-rw-r--r--sw/qa/uitest/writer_tests5/autocorrectOptions.py166
-rw-r--r--sw/qa/uitest/writer_tests5/columns.py66
-rw-r--r--sw/qa/uitest/writer_tests5/tdf107494.py123
-rw-r--r--sw/qa/uitest/writer_tests5/tdf122045.py36
-rw-r--r--sw/qa/uitest/writer_tests5/tdf122722.py97
-rw-r--r--sw/qa/uitest/writer_tests5/tdf123378.py17
-rw-r--r--sw/qa/uitest/writer_tests5/tdf123446.py53
-rw-r--r--sw/qa/uitest/writer_tests5/titlePage.py44
-rw-r--r--sw/qa/uitest/writer_tests5/xwindow.py189
-rw-r--r--sw/qa/uitest/writer_tests5/zoom.py164
-rw-r--r--sw/qa/uitest/writer_tests6/infobar.py59
-rw-r--r--sw/qa/uitest/writer_tests6/tdf107847.py39
-rw-r--r--sw/qa/uitest/writer_tests6/tdf118883.py35
-rw-r--r--sw/qa/uitest/writer_tests6/tdf125104.py70
-rw-r--r--sw/qa/uitest/writer_tests6/tdf126168.py61
-rw-r--r--sw/qa/uitest/writer_tests6/tdf128431.py52
-rw-r--r--sw/qa/uitest/writer_tests6/tdf131041.py50
-rw-r--r--sw/qa/uitest/writer_tests6/tdf44837.py55
-rw-r--r--sw/qa/uitest/writer_tests7/tdf109083.py95
-rw-r--r--sw/qa/uitest/writer_tests7/tdf115853.py34
-rw-r--r--sw/qa/uitest/writer_tests7/tdf119661.py102
-rw-r--r--sw/qa/uitest/writer_tests7/tdf133348.py94
-rw-r--r--sw/qa/uitest/writer_tests7/tdf140731.py81
-rw-r--r--sw/qa/uitest/writer_tests7/tdf140863.py76
-rw-r--r--sw/qa/uitest/writer_tests7/tdf90401.py2
104 files changed, 5473 insertions, 5194 deletions
diff --git a/sw/qa/uitest/chapterNumbering/chapterNumbering.py b/sw/qa/uitest/chapterNumbering/chapterNumbering.py
index 24e9f4eb22c5..b72e6b458ef2 100644
--- a/sw/qa/uitest/chapterNumbering/chapterNumbering.py
+++ b/sw/qa/uitest/chapterNumbering/chapterNumbering.py
@@ -17,74 +17,75 @@ from uitest.uihelper.common import change_measurement_unit
class WriterChapterNumbering(UITestCase):
def test_chapter_numbering_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
- change_measurement_unit(self, "Millimeter")
+ change_measurement_unit(self, "Millimeter")
- self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xstyle = xDialog.getChild("style")
- xnumbering = xDialog.getChild("numbering")
- xcharstyle = xDialog.getChild("charstyle")
- xprefix = xDialog.getChild("prefix")
- xsuffix = xDialog.getChild("suffix")
- xstartat = xDialog.getChild("startat")
- xtab = xDialog.getChild("tabcontrol")
- #second tab
- xalignedatmf = xDialog.getChild("alignedatmf")
- xnum2alignlb = xDialog.getChild("num2alignlb")
- xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
- xatmf = xDialog.getChild("atmf")
- xindentatmf = xDialog.getChild("indentatmf")
- select_pos(xtab, "0") #first tab
- select_by_text(xstyle, "Heading")
- select_by_text(xnumbering, "1, 2, 3, ...")
- select_by_text(xcharstyle, "Bullets")
- xprefix.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
- xsuffix.executeAction("TYPE", mkPropertyValues({"TEXT":"B"}))
- xstartat.executeAction("UP", tuple())
+ self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xstyle = xDialog.getChild("style")
+ xnumbering = xDialog.getChild("numbering")
+ xcharstyle = xDialog.getChild("charstyle")
+ xprefix = xDialog.getChild("prefix")
+ xsuffix = xDialog.getChild("suffix")
+ xstartat = xDialog.getChild("startat")
+ xtab = xDialog.getChild("tabcontrol")
+ #second tab
+ xalignedatmf = xDialog.getChild("alignedatmf")
+ xnum2alignlb = xDialog.getChild("num2alignlb")
+ xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
+ xatmf = xDialog.getChild("atmf")
+ xindentatmf = xDialog.getChild("indentatmf")
+ select_pos(xtab, "0") #first tab
+ select_by_text(xstyle, "Heading")
+ select_by_text(xnumbering, "1, 2, 3, ...")
+ select_by_text(xcharstyle, "Bullets")
+ xprefix.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
+ xsuffix.executeAction("TYPE", mkPropertyValues({"TEXT":"B"}))
+ xstartat.executeAction("UP", tuple())
- select_pos(xtab, "1") #second tab Position
- xalignedatmf.executeAction("UP", tuple())
- select_by_text(xnum2alignlb, "Centered")
- select_by_text(xnumfollowedbylb, "Tab stop")
- xatmf.executeAction("UP", tuple())
- xindentatmf.executeAction("UP", tuple())
+ select_pos(xtab, "1") #second tab Position
+ xalignedatmf.executeAction("UP", tuple())
+ select_by_text(xnum2alignlb, "Centered")
+ select_by_text(xnumfollowedbylb, "Tab stop")
+ xatmf.executeAction("UP", tuple())
+ xindentatmf.executeAction("UP", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- xstyle = xDialog.getChild("style")
- xnumbering = xDialog.getChild("numbering")
- xcharstyle = xDialog.getChild("charstyle")
- xprefix = xDialog.getChild("prefix")
- xsuffix = xDialog.getChild("suffix")
- xstartat = xDialog.getChild("startat")
- xtab = xDialog.getChild("tabcontrol")
- #second tab
- xalignedatmf = xDialog.getChild("alignedatmf")
- xnum2alignlb = xDialog.getChild("num2alignlb")
- xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
- xatmf = xDialog.getChild("atmf")
- xindentatmf = xDialog.getChild("indentatmf")
- select_pos(xtab, "0")
- self.assertEqual(get_state_as_dict(xstyle)["SelectEntryText"], "Heading")
- self.assertEqual(get_state_as_dict(xnumbering)["SelectEntryText"], "1, 2, 3, ...")
- self.assertEqual(get_state_as_dict(xcharstyle)["SelectEntryText"], "Bullets")
- self.assertEqual(get_state_as_dict(xprefix)["Text"], "A")
- self.assertEqual(get_state_as_dict(xsuffix)["Text"], "B")
- self.assertEqual(get_state_as_dict(xstartat)["Text"], "2")
- select_pos(xtab, "1") #second tab Position
- self.assertEqual(get_state_as_dict(xalignedatmf)["Text"], "0.1 mm")
- self.assertEqual(get_state_as_dict(xnum2alignlb)["SelectEntryText"], "Centered")
- self.assertEqual(get_state_as_dict(xnumfollowedbylb)["SelectEntryText"], "Tab stop")
- self.assertEqual(get_state_as_dict(xatmf)["Text"], "0.1 mm")
- self.assertEqual(get_state_as_dict(xindentatmf)["Text"], "0.1 mm")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ xstyle = xDialog.getChild("style")
+ xnumbering = xDialog.getChild("numbering")
+ xcharstyle = xDialog.getChild("charstyle")
+ xprefix = xDialog.getChild("prefix")
+ xsuffix = xDialog.getChild("suffix")
+ xstartat = xDialog.getChild("startat")
+ xtab = xDialog.getChild("tabcontrol")
+ #second tab
+ xalignedatmf = xDialog.getChild("alignedatmf")
+ xnum2alignlb = xDialog.getChild("num2alignlb")
+ xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
+ xatmf = xDialog.getChild("atmf")
+ xindentatmf = xDialog.getChild("indentatmf")
+ select_pos(xtab, "0")
+ self.assertEqual(get_state_as_dict(xstyle)["SelectEntryText"], "Heading")
+ self.assertEqual(get_state_as_dict(xnumbering)["SelectEntryText"], "1, 2, 3, ...")
+ self.assertEqual(get_state_as_dict(xcharstyle)["SelectEntryText"], "Bullets")
+ self.assertEqual(get_state_as_dict(xprefix)["Text"], "A")
+ self.assertEqual(get_state_as_dict(xsuffix)["Text"], "B")
+ self.assertEqual(get_state_as_dict(xstartat)["Text"], "2")
+ select_pos(xtab, "1") #second tab Position
+ self.assertEqual(get_state_as_dict(xalignedatmf)["Text"], "0.1 mm")
+ self.assertEqual(get_state_as_dict(xnum2alignlb)["SelectEntryText"], "Centered")
+ self.assertEqual(get_state_as_dict(xnumfollowedbylb)["SelectEntryText"], "Tab stop")
+ self.assertEqual(get_state_as_dict(xatmf)["Text"], "0.1 mm")
+ self.assertEqual(get_state_as_dict(xindentatmf)["Text"], "0.1 mm")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/chapterNumbering/tdf140528.py b/sw/qa/uitest/chapterNumbering/tdf140528.py
index 6abf2b1f2838..c34d33c409b3 100644
--- a/sw/qa/uitest/chapterNumbering/tdf140528.py
+++ b/sw/qa/uitest/chapterNumbering/tdf140528.py
@@ -13,40 +13,42 @@ from uitest.uihelper.common import select_pos
class Tdf140528(UITestCase):
def test_tdf140528(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- xTab = xDialog.getChild("tabcontrol")
- select_pos(xTab, "0")
+ xTab = xDialog.getChild("tabcontrol")
+ select_pos(xTab, "0")
- xFormat = xDialog.getChild("format")
+ xFormat = xDialog.getChild("format")
- with self.ui_test.execute_blocking_action(xFormat.executeAction, args=('OPENFROMLIST', mkPropertyValues({"POS": "10"}))) as dialog:
- xEntry = dialog.getChild("entry")
- self.assertEqual("Untitled 1", get_state_as_dict(xEntry)['Text'])
+ with self.ui_test.execute_blocking_action(xFormat.executeAction, args=('OPENFROMLIST', mkPropertyValues({"POS": "10"}))) as dialog:
+ xEntry = dialog.getChild("entry")
+ self.assertEqual("Untitled 1", get_state_as_dict(xEntry)['Text'])
- xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xEntry.executeAction("TYPE", mkPropertyValues({"TEXT" : "newFormat"}))
+ xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xEntry.executeAction("TYPE", mkPropertyValues({"TEXT" : "newFormat"}))
- self.assertEqual("saveas", get_state_as_dict(xFormat)['CurrentItem'])
+ self.assertEqual("saveas", get_state_as_dict(xFormat)['CurrentItem'])
- # Go to Position tab
- select_pos(xTab, "1")
+ # Go to Position tab
+ select_pos(xTab, "1")
- # Go back to Numbering tab
- select_pos(xTab, "0")
+ # Go back to Numbering tab
+ select_pos(xTab, "0")
- xFormat.executeAction('OPENFROMLIST', mkPropertyValues({"POS": "0"}))
- self.assertEqual("form1", get_state_as_dict(xFormat)['CurrentItem'])
+ xFormat.executeAction('OPENFROMLIST', mkPropertyValues({"POS": "0"}))
+ self.assertEqual("form1", get_state_as_dict(xFormat)['CurrentItem'])
- # Without the fix in place, this test would have crashed here
- select_pos(xTab, "1")
+ # Without the fix in place, this test would have crashed here
+ select_pos(xTab, "1")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ 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/sw/qa/uitest/chart/tdf138556.py b/sw/qa/uitest/chart/tdf138556.py
index 2396d644bb57..4a7f325c8df4 100644
--- a/sw/qa/uitest/chart/tdf138556.py
+++ b/sw/qa/uitest/chart/tdf138556.py
@@ -17,38 +17,39 @@ class tdf138556( UITestCase ):
def test_stock_chart13_insert_series( self ):
#Start LibreOffice Writer
- with self.ui_test.create_doc_in_start_center( "writer" ):
- xMainTop = self.xUITest.getTopFocusWindow()
-
- #Insert Chart
- self.xUITest.executeCommand( ".uno:InsertObjectChart" )
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild( "chart_window" )
- xChart = xChartMain.getChild( "CID/Page=" )
-
- #Change Chart Type to Stock 1
- #TODO: test other subtypes
- self.ui_test.execute_dialog_through_action( xChart, "COMMAND",
- mkPropertyValues({ "COMMAND" : "DiagramType" }))
- xDialog = self.xUITest.getTopFocusWindow()
- xChartType = xDialog.getChild( "charttype" )
- xStockType = xChartType.getChild( "8" )
- xStockType.executeAction( "SELECT", tuple())
- xOKBtn = xDialog.getChild( "ok" )
- self.ui_test.close_dialog_through_button( xOKBtn )
-
- #Insert Data Series
- self.ui_test.execute_dialog_through_action( xChart, "COMMAND",
- mkPropertyValues({ "COMMAND" : "DiagramData" }))
- xDialog = self.xUITest.getTopFocusWindow()
- xToolbar = xDialog.getChild( "toolbar" )
- xToolbar.executeAction( "CLICK", mkPropertyValues({ "POS" : "1" }))
- xOKBtn = xDialog.getChild( "close" )
- self.ui_test.close_dialog_through_button( xOKBtn )
-
- #Check Number of Sequences
- xDocument = self.ui_test.get_component()
- nSequences = len( xDocument.FirstDiagram.
- CoordinateSystems[0].ChartTypes[0].DataSeries[0].DataSequences )
- self.assertEqual( nSequences, 3 )
-
+ xDocument = self.ui_test.create_doc_in_start_center( "writer" )
+ xMainTop = self.xUITest.getTopFocusWindow()
+
+ #Insert Chart
+ self.xUITest.executeCommand( ".uno:InsertObjectChart" )
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild( "chart_window" )
+ xChart = xChartMain.getChild( "CID/Page=" )
+
+ #Change Chart Type to Stock 1
+ #TODO: test other subtypes
+ self.ui_test.execute_dialog_through_action( xChart, "COMMAND",
+ mkPropertyValues({ "COMMAND" : "DiagramType" }))
+ xDialog = self.xUITest.getTopFocusWindow()
+ xChartType = xDialog.getChild( "charttype" )
+ xStockType = xChartType.getChild( "8" )
+ xStockType.executeAction( "SELECT", tuple())
+ xOKBtn = xDialog.getChild( "ok" )
+ self.ui_test.close_dialog_through_button( xOKBtn )
+
+ #Insert Data Series
+ self.ui_test.execute_dialog_through_action( xChart, "COMMAND",
+ mkPropertyValues({ "COMMAND" : "DiagramData" }))
+ xDialog = self.xUITest.getTopFocusWindow()
+ xToolbar = xDialog.getChild( "toolbar" )
+ xToolbar.executeAction( "CLICK", mkPropertyValues({ "POS" : "1" }))
+ xOKBtn = xDialog.getChild( "close" )
+ self.ui_test.close_dialog_through_button( xOKBtn )
+
+ #Check Number of Sequences
+ xDocument = self.ui_test.get_component()
+ nSequences = len( xDocument.FirstDiagram.
+ CoordinateSystems[0].ChartTypes[0].DataSeries[0].DataSequences )
+ self.assertEqual( nSequences, 3 )
+
+ self.ui_test.close_doc()
diff --git a/sw/qa/uitest/classification/classification.py b/sw/qa/uitest/classification/classification.py
index 37feb02c5a42..72f7dd16bb8a 100644
--- a/sw/qa/uitest/classification/classification.py
+++ b/sw/qa/uitest/classification/classification.py
@@ -38,131 +38,136 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class classification(UITestCase):
def test_document_classification_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_dialog_through_command(".uno:ClassificationDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- classificationEditWindow = xDialog.getChild("classificationEditWindow")
- recentlyUsedCB = xDialog.getChild("recentlyUsedCB")
- classificationCB = xDialog.getChild("classificationCB")
- internationalClassificationCB = xDialog.getChild("internationalClassificationCB")
- intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
- intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
-
- select_by_text(classificationCB, "Confidential")
- #verify International is set too
- self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential")
- #verify textBox Content
- # self.assertEqual(get_state_as_dict(classificationEditWindow)["Text"], "Conf")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- header = document.StyleFamilies.PageStyles.Standard.HeaderText.createEnumeration().nextElement()
- self.assertEqual(header.String, "Confidential")
-
- controller = self.ui_test.get_component().getCurrentController()
- self.assertTrue(controller.hasInfobar("classification"))
-
- #verify watermark
- #Bug 122586 - Classification: by using the dialog, Watermark text from policy is not placed in the document
- self.ui_test.execute_dialog_through_command(".uno:Watermark")
- xDialog = self.xUITest.getTopFocusWindow()
- xTextInput = xDialog.getChild("TextInput")
- xAngle = xDialog.getChild("Angle")
- xTransparency = xDialog.getChild("Transparency")
- self.assertEqual(get_state_as_dict(xTextInput)["Text"], "Confidential")
- self.assertEqual(get_state_as_dict(xAngle)["Text"], "45°")
- self.assertEqual((get_state_as_dict(xTransparency)["Text"])[0:2], "50")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- #TODO
- #open dialog and add intellectualProperty text, save
- #verify
- #reopen and verify classification and Content
-
- #do the same for Paragraph classification
- self.ui_test.execute_dialog_through_command(".uno:ParagraphClassificationDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- classificationEditWindow = xDialog.getChild("classificationEditWindow")
- recentlyUsedCB = xDialog.getChild("recentlyUsedCB")
- classificationCB = xDialog.getChild("classificationCB")
- internationalClassificationCB = xDialog.getChild("internationalClassificationCB")
- intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
- intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
-
- select_by_text(classificationCB, "Confidential")
- #verify International is set too
- self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential")
- #verify textBox Content TODO textbox not supported
- #self.assertEqual(get_state_as_dict(classificationEditWindow)["Text"], "Conf")
- # print(get_state_as_dict(classificationEditWindow))
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(document.Text.String[0:6], "(Conf)")
- self.assertEqual(header.String, "Confidential")
- self.assertTrue(controller.hasInfobar("classification"))
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:ClassificationDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ classificationEditWindow = xDialog.getChild("classificationEditWindow")
+ recentlyUsedCB = xDialog.getChild("recentlyUsedCB")
+ classificationCB = xDialog.getChild("classificationCB")
+ internationalClassificationCB = xDialog.getChild("internationalClassificationCB")
+ intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
+ intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
+
+ select_by_text(classificationCB, "Confidential")
+ #verify International is set too
+ self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential")
+ #verify textBox Content
+ # self.assertEqual(get_state_as_dict(classificationEditWindow)["Text"], "Conf")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ header = document.StyleFamilies.PageStyles.Standard.HeaderText.createEnumeration().nextElement()
+ self.assertEqual(header.String, "Confidential")
+
+ controller = self.ui_test.get_component().getCurrentController()
+ self.assertTrue(controller.hasInfobar("classification"))
+
+ #verify watermark
+ #Bug 122586 - Classification: by using the dialog, Watermark text from policy is not placed in the document
+ self.ui_test.execute_dialog_through_command(".uno:Watermark")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTextInput = xDialog.getChild("TextInput")
+ xAngle = xDialog.getChild("Angle")
+ xTransparency = xDialog.getChild("Transparency")
+ self.assertEqual(get_state_as_dict(xTextInput)["Text"], "Confidential")
+ self.assertEqual(get_state_as_dict(xAngle)["Text"], "45°")
+ self.assertEqual((get_state_as_dict(xTransparency)["Text"])[0:2], "50")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+
+ #TODO
+ #open dialog and add intellectualProperty text, save
+ #verify
+ #reopen and verify classification and Content
+
+ #do the same for Paragraph classification
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphClassificationDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ classificationEditWindow = xDialog.getChild("classificationEditWindow")
+ recentlyUsedCB = xDialog.getChild("recentlyUsedCB")
+ classificationCB = xDialog.getChild("classificationCB")
+ internationalClassificationCB = xDialog.getChild("internationalClassificationCB")
+ intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
+ intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
+
+ select_by_text(classificationCB, "Confidential")
+ #verify International is set too
+ self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential")
+ #verify textBox Content TODO textbox not supported
+ #self.assertEqual(get_state_as_dict(classificationEditWindow)["Text"], "Conf")
+ # print(get_state_as_dict(classificationEditWindow))
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(document.Text.String[0:6], "(Conf)")
+ self.assertEqual(header.String, "Confidential")
+ self.assertTrue(controller.hasInfobar("classification"))
+
+ self.ui_test.close_doc()
def test_paragraph_classification_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #+ new file and do it only for Paragraph classification (no watermark!)
- self.ui_test.execute_dialog_through_command(".uno:ParagraphClassificationDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- classificationEditWindow = xDialog.getChild("classificationEditWindow")
- recentlyUsedCB = xDialog.getChild("recentlyUsedCB")
- classificationCB = xDialog.getChild("classificationCB")
- internationalClassificationCB = xDialog.getChild("internationalClassificationCB")
- intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
- intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
-
- select_by_text(classificationCB, "Confidential")
- #verify International is set too
- self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential")
- #verify textBox Content TODO - texbox not supported yet
- # self.assertEqual(get_state_as_dict(classificationEditWindow)["Text"], "Conf")
- # print(get_state_as_dict(classificationEditWindow))
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- controller = self.ui_test.get_component().getCurrentController()
- self.assertEqual(document.Text.String[0:6], "(Conf)")
- self.assertFalse(controller.hasInfobar("classification"))
- self.assertFalse(document.StyleFamilies.PageStyles.Standard.HeaderIsOn)
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #+ new file and do it only for Paragraph classification (no watermark!)
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphClassificationDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ classificationEditWindow = xDialog.getChild("classificationEditWindow")
+ recentlyUsedCB = xDialog.getChild("recentlyUsedCB")
+ classificationCB = xDialog.getChild("classificationCB")
+ internationalClassificationCB = xDialog.getChild("internationalClassificationCB")
+ intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
+ intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
+
+ select_by_text(classificationCB, "Confidential")
+ #verify International is set too
+ self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Confidential")
+ #verify textBox Content TODO - texbox not supported yet
+ # self.assertEqual(get_state_as_dict(classificationEditWindow)["Text"], "Conf")
+ # print(get_state_as_dict(classificationEditWindow))
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ controller = self.ui_test.get_component().getCurrentController()
+ self.assertEqual(document.Text.String[0:6], "(Conf)")
+ self.assertFalse(controller.hasInfobar("classification"))
+ self.assertFalse(document.StyleFamilies.PageStyles.Standard.HeaderIsOn)
+
+ self.ui_test.close_doc()
def test_paragraph_classification_dialog_text(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #+ new file and do it only for Paragraph classification (no watermark!)
- self.ui_test.execute_dialog_through_command(".uno:ParagraphClassificationDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- classificationEditWindow = xDialog.getChild("classificationEditWindow")
- recentlyUsedCB = xDialog.getChild("recentlyUsedCB")
- classificationCB = xDialog.getChild("classificationCB")
- internationalClassificationCB = xDialog.getChild("internationalClassificationCB")
- intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
- intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
- #type text AA
- intellectualPropertyPartEntry.executeAction("TYPE", mkPropertyValues({"TEXT":"AA"}))
- intellectualPropertyPartAddButton.executeAction("CLICK", tuple())
- select_by_text(classificationCB, "Internal Only")
- #verify International is set too
- self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Internal Only")
- #verify textBox Content TODO - texbox not supported yet
- # self.assertEqual(get_state_as_dict(classificationEditWindow)["Text"], "Conf")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- controller = self.ui_test.get_component().getCurrentController()
- self.assertEqual(document.Text.String[0:6], "(AAIO)")
- self.assertFalse(controller.hasInfobar("classification"))
- self.assertFalse(document.StyleFamilies.PageStyles.Standard.HeaderIsOn)
-
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #+ new file and do it only for Paragraph classification (no watermark!)
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphClassificationDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ classificationEditWindow = xDialog.getChild("classificationEditWindow")
+ recentlyUsedCB = xDialog.getChild("recentlyUsedCB")
+ classificationCB = xDialog.getChild("classificationCB")
+ internationalClassificationCB = xDialog.getChild("internationalClassificationCB")
+ intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
+ intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
+ #type text AA
+ intellectualPropertyPartEntry.executeAction("TYPE", mkPropertyValues({"TEXT":"AA"}))
+ intellectualPropertyPartAddButton.executeAction("CLICK", tuple())
+ select_by_text(classificationCB, "Internal Only")
+ #verify International is set too
+ self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Internal Only")
+ #verify textBox Content TODO - texbox not supported yet
+ # self.assertEqual(get_state_as_dict(classificationEditWindow)["Text"], "Conf")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ controller = self.ui_test.get_component().getCurrentController()
+ self.assertEqual(document.Text.String[0:6], "(AAIO)")
+ self.assertFalse(controller.hasInfobar("classification"))
+ self.assertFalse(document.StyleFamilies.PageStyles.Standard.HeaderIsOn)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/findBar/findbar.py b/sw/qa/uitest/findBar/findbar.py
index e539a1934ae9..75bfbb33abd9 100644
--- a/sw/qa/uitest/findBar/findbar.py
+++ b/sw/qa/uitest/findBar/findbar.py
@@ -16,52 +16,54 @@ class FindBar(UITestCase):
def test_find_bar(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- # Type some lines to search for words on them
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "LibreOffice"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "LibreOffice Writer"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "LibreOffice Calc"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "The Document Foundation"}))
+ # Type some lines to search for words on them
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "LibreOffice"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "LibreOffice Writer"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "LibreOffice Calc"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "The Document Foundation"}))
- # open the Find Bar
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+f"}))
+ # open the Find Bar
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+f"}))
- # Type the Word that we want to search for it
- xfind = xWriterDoc.getChild("find")
- xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "Libre"}))
+ # Type the Word that we want to search for it
+ xfind = xWriterDoc.getChild("find")
+ xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "Libre"}))
- # Select the Find Bar
- xfind_bar = xWriterDoc.getChild("FindBar")
- self.assertEqual(get_state_as_dict(xfind_bar)["ItemCount"], "14")
+ # Select the Find Bar
+ xfind_bar = xWriterDoc.getChild("FindBar")
+ self.assertEqual(get_state_as_dict(xfind_bar)["ItemCount"], "14")
- # Press on FindAll in the Find Bar
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "5") # 5 is FindAll id for Pos 4
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find All")
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:FindAll")
- self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "LibreLibreLibre")
+ # Press on FindAll in the Find Bar
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "5") # 5 is FindAll id for Pos 4
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find All")
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:FindAll")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "LibreLibreLibre")
- # Press on Find Next in the Find Bar
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"})) # 3 is Find Next pos
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "4")
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Next")
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:DownSearch")
- self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "Libre")
+ # Press on Find Next in the Find Bar
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"})) # 3 is Find Next pos
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "4")
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Next")
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:DownSearch")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "Libre")
- # Press on Find Previous in the Find Bar
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "2"})) # 2 is Find Previous pos
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "3")
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Previous")
- self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:UpSearch")
- self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "Libre")
+ # Press on Find Previous in the Find Bar
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "2"})) # 2 is Find Previous pos
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemID"], "3")
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemText"], "Find Previous")
+ self.assertEqual(get_state_as_dict(xfind_bar)["CurrSelectedItemCommand"], ".uno:UpSearch")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "Libre")
- # Close the Find Bar
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 0 is pos for close
+ # Close the Find Bar
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 0 is pos for close
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/findBar/tdf136941.py b/sw/qa/uitest/findBar/tdf136941.py
index e60073e3021f..c77a7e2a2277 100644
--- a/sw/qa/uitest/findBar/tdf136941.py
+++ b/sw/qa/uitest/findBar/tdf136941.py
@@ -12,53 +12,55 @@ class tdf136941(UITestCase):
def test_tdf136941(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello World"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello World"}))
- self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar")
+ self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar")
- xfind = xWriterDoc.getChild("find")
- xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello"}))
+ xfind = xWriterDoc.getChild("find")
+ xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello"}))
- self.assertEqual("Hello", get_state_as_dict(xfind)['Text'])
+ self.assertEqual("Hello", get_state_as_dict(xfind)['Text'])
- xfind_bar = xWriterDoc.getChild("FindBar")
+ xfind_bar = xWriterDoc.getChild("FindBar")
- # Search Next
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
+ # Search Next
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
- # Close button
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "0"}))
+ # Close button
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "0"}))
- # Check the toolbar is closed
- self.assertTrue("find" not in xWriterDoc.getChildren())
- self.assertEqual("Hello", get_state_as_dict(xWriterEdit)['SelectedText'])
+ # Check the toolbar is closed
+ self.assertTrue("find" not in xWriterDoc.getChildren())
+ self.assertEqual("Hello", get_state_as_dict(xWriterEdit)['SelectedText'])
- self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar")
+ self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar")
- xfind = xWriterDoc.getChild("find")
- self.ui_test.wait_until_property_is_updated(xfind, 'SelectedText', "Hello")
- self.assertEqual("Hello", get_state_as_dict(xfind)['SelectedText'])
+ xfind = xWriterDoc.getChild("find")
+ self.ui_test.wait_until_property_is_updated(xfind, 'SelectedText', "Hello")
+ self.assertEqual("Hello", get_state_as_dict(xfind)['SelectedText'])
- xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "World"}))
+ xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "World"}))
- # Without the fix in place, this test would have failed with
- # AssertionError: 'World' != 'WorldHello'
- self.assertEqual("World", get_state_as_dict(xfind)['Text'])
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'World' != 'WorldHello'
+ self.assertEqual("World", get_state_as_dict(xfind)['Text'])
- xfind_bar = xWriterDoc.getChild("FindBar")
+ xfind_bar = xWriterDoc.getChild("FindBar")
- # Search Next
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
+ # Search Next
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
- # Close button
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "0"}))
+ # Close button
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "0"}))
- # Check the toolbar is closed
- self.assertTrue("find" not in xWriterDoc.getChildren())
- self.assertEqual("World", get_state_as_dict(xWriterEdit)['SelectedText'])
+ # Check the toolbar is closed
+ self.assertTrue("find" not in xWriterDoc.getChildren())
+ self.assertEqual("World", get_state_as_dict(xWriterEdit)['SelectedText'])
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/findBar/tdf138232.py b/sw/qa/uitest/findBar/tdf138232.py
index 21d1b011860f..62a79824ea4d 100644
--- a/sw/qa/uitest/findBar/tdf138232.py
+++ b/sw/qa/uitest/findBar/tdf138232.py
@@ -12,38 +12,40 @@ class tdf138232(UITestCase):
def test_tdf138232(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello"}))
- self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar")
+ self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar")
- xfind = xWriterDoc.getChild("find")
- self.ui_test.wait_until_property_is_updated(xfind, 'HasFocus', "true")
- self.assertEqual("true", get_state_as_dict(xfind)['HasFocus'])
+ xfind = xWriterDoc.getChild("find")
+ self.ui_test.wait_until_property_is_updated(xfind, 'HasFocus', "true")
+ self.assertEqual("true", get_state_as_dict(xfind)['HasFocus'])
- xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello"}))
- self.assertEqual("Hello", get_state_as_dict(xfind)['Text'])
+ xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello"}))
+ self.assertEqual("Hello", get_state_as_dict(xfind)['Text'])
- xfind_bar = xWriterDoc.getChild("FindBar")
+ xfind_bar = xWriterDoc.getChild("FindBar")
- # Click on Find All
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
+ # Click on Find All
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
- self.assertEqual("HelloHello", get_state_as_dict(xWriterEdit)['SelectedText'])
+ self.assertEqual("HelloHello", get_state_as_dict(xWriterEdit)['SelectedText'])
- xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "World"}))
+ xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "World"}))
- # Without the fix in place, this test would have failed with
- # AssertionError: 'HelloWorld' != 'World'
- self.assertEqual("HelloWorld", get_state_as_dict(xfind)['Text'])
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'HelloWorld' != 'World'
+ self.assertEqual("HelloWorld", get_state_as_dict(xfind)['Text'])
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "4"}))
- self.assertEqual("", get_state_as_dict(xWriterEdit)['SelectedText'])
+ self.assertEqual("", get_state_as_dict(xWriterEdit)['SelectedText'])
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/findBar/tdf88608.py b/sw/qa/uitest/findBar/tdf88608.py
index 920f0b4fb43f..b3576ec7587e 100644
--- a/sw/qa/uitest/findBar/tdf88608.py
+++ b/sw/qa/uitest/findBar/tdf88608.py
@@ -12,42 +12,44 @@ class tdf88608(UITestCase):
def test_tdf88608(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello World"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello World"}))
- self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar")
+ self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar")
- # Search a word that doesn't exist
- xfind = xWriterDoc.getChild("find")
- xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "X"}))
- self.assertEqual("X", get_state_as_dict(xfind)['Text'])
+ # Search a word that doesn't exist
+ xfind = xWriterDoc.getChild("find")
+ xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "X"}))
+ self.assertEqual("X", get_state_as_dict(xfind)['Text'])
- xfind_bar = xWriterDoc.getChild("FindBar")
- self.assertEqual('', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
+ xfind_bar = xWriterDoc.getChild("FindBar")
+ self.assertEqual('', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
- # Search Next
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
+ # Search Next
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
- self.assertEqual('Search key not found', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
+ self.assertEqual('Search key not found', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
- self.assertEqual("", get_state_as_dict(xWriterEdit)['SelectedText'])
+ self.assertEqual("", get_state_as_dict(xWriterEdit)['SelectedText'])
- xfind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"}))
- xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "World"}))
- self.assertEqual("World", get_state_as_dict(xfind)['Text'])
+ xfind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"}))
+ xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "World"}))
+ self.assertEqual("World", get_state_as_dict(xfind)['Text'])
- # Without the fix in place, this test would have failed with
- # AssertionError: '' != 'Search key not found'
- self.assertEqual('', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '' != 'Search key not found'
+ self.assertEqual('', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
- # Search Next
- xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
+ # Search Next
+ xfind_bar.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
- self.assertEqual('Reached the end of the document', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
+ self.assertEqual('Reached the end of the document', get_state_as_dict(xfind_bar.getChild('label'))['Text'])
- self.assertEqual("World", get_state_as_dict(xWriterEdit)['SelectedText'])
+ self.assertEqual("World", get_state_as_dict(xWriterEdit)['SelectedText'])
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/findReplace/findReplace.py b/sw/qa/uitest/findReplace/findReplace.py
index 4db87ddd9e4e..0ef4f22ac1d9 100644
--- a/sw/qa/uitest/findReplace/findReplace.py
+++ b/sw/qa/uitest/findReplace/findReplace.py
@@ -95,28 +95,30 @@ class findReplace(UITestCase):
#Bug 39022 - find-replace->$1, not pattern
def test_tdf39022_replace_regexp(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "test number1 testnot")
-
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"T(est|other)\\>"})) #find
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"replaced$1"})) #replace
- regexp = xDialog.getChild("regexp")
- regexp.executeAction("CLICK", tuple()) #regular expressions
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
- #verify
- self.assertEqual(document.Text.String[0:27], "replacedest number1 testnot")
- regexp.executeAction("CLICK", tuple())
-
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ type_text(xWriterEdit, "test number1 testnot")
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"T(est|other)\\>"})) #find
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"replaced$1"})) #replace
+ regexp = xDialog.getChild("regexp")
+ regexp.executeAction("CLICK", tuple()) #regular expressions
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
+ #verify
+ self.assertEqual(document.Text.String[0:27], "replacedest number1 testnot")
+ regexp.executeAction("CLICK", tuple())
+
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
+
+ self.ui_test.close_doc()
#tdf116242 ţ ț
def test_tdf116242_replace_t_with_cedilla(self):
@@ -168,32 +170,34 @@ class findReplace(UITestCase):
self.ui_test.close_dialog_through_button(xcloseBtn)
def test_tdf136577(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- type_text(xWriterEdit, "x")
+ type_text(xWriterEdit, "x")
- self.assertEqual(document.Text.String, "x")
+ self.assertEqual(document.Text.String, "x")
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"x"}))
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"x"}))
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
+
+ self.assertEqual(document.Text.String, "")
- self.assertEqual(document.Text.String, "")
+ self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Undo")
+ # Without the fix in place, this test would have failed with AssertionError: '' != 'x'
+ self.assertEqual(document.Text.String, "x")
- # Without the fix in place, this test would have failed with AssertionError: '' != 'x'
- self.assertEqual(document.Text.String, "x")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/findReplace/tdf106099.py b/sw/qa/uitest/findReplace/tdf106099.py
index 0778520a7a6e..d0c1ad76f251 100644
--- a/sw/qa/uitest/findReplace/tdf106099.py
+++ b/sw/qa/uitest/findReplace/tdf106099.py
@@ -13,29 +13,30 @@ from uitest.uihelper.common import get_state_as_dict
class tdf106099(UITestCase):
def test_tdf106099_find_format_underline(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #Find and replace
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- #2. Choose Format
- format = xDialog.getChild("format")
- with self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ())) as dialog:
- #Font effects - Underline Single. OK.
- xTabs = dialog.getChild("tabcontrol")
- select_pos(xTabs, "1") #tab font effects
- underlinelb = dialog.getChild("underlinelb")
- select_by_text(underlinelb, "Single")
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #Find and replace
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #2. Choose Format
+ format = xDialog.getChild("format")
+ with self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ())) as dialog:
+ #Font effects - Underline Single. OK.
+ xTabs = dialog.getChild("tabcontrol")
+ select_pos(xTabs, "1") #tab font effects
+ underlinelb = dialog.getChild("underlinelb")
+ select_by_text(underlinelb, "Single")
- #verify label searchdesc
- searchdesc = xDialog.getChild("searchdesc")
- print(get_state_as_dict(searchdesc))
- self.assertEqual(get_state_as_dict(searchdesc)["Text"], "Single underline")
- noformat = xDialog.getChild("noformat")
- noformat.executeAction("CLICK", tuple()) #click No format button
- self.assertEqual(get_state_as_dict(searchdesc)["Text"], "")
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ #verify label searchdesc
+ searchdesc = xDialog.getChild("searchdesc")
+ print(get_state_as_dict(searchdesc))
+ self.assertEqual(get_state_as_dict(searchdesc)["Text"], "Single underline")
+ noformat = xDialog.getChild("noformat")
+ noformat.executeAction("CLICK", tuple()) #click No format button
+ self.assertEqual(get_state_as_dict(searchdesc)["Text"], "")
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/findReplace/tdf119462.py b/sw/qa/uitest/findReplace/tdf119462.py
index 2bd183b53ab1..4402d1acaedd 100644
--- a/sw/qa/uitest/findReplace/tdf119462.py
+++ b/sw/qa/uitest/findReplace/tdf119462.py
@@ -13,28 +13,29 @@ from uitest.uihelper.common import get_state_as_dict
class tdf119462(UITestCase):
def test_tdf119462_find_format(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #1. Choose Edit > Find and Replace
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- #2. Choose Format
- format = xDialog.getChild("format")
- with self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ())) as dialog:
- #3. Choose Bold
- xTabs = dialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xweststylelbcjk = dialog.getChild("weststylelb-cjk")
- xweststylelbcjk.executeAction("TYPE", mkPropertyValues({"TEXT":"Bold"}))
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #1. Choose Edit > Find and Replace
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #2. Choose Format
+ format = xDialog.getChild("format")
+ with self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ())) as dialog:
+ #3. Choose Bold
+ xTabs = dialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xweststylelbcjk = dialog.getChild("weststylelb-cjk")
+ xweststylelbcjk.executeAction("TYPE", mkPropertyValues({"TEXT":"Bold"}))
- #verify label searchdesc
- searchdesc = xDialog.getChild("searchdesc")
- self.assertEqual(get_state_as_dict(searchdesc)["Text"], "bold")
- noformat = xDialog.getChild("noformat")
- noformat.executeAction("CLICK", tuple()) #click No format button
- self.assertEqual(get_state_as_dict(searchdesc)["Text"], "")
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ #verify label searchdesc
+ searchdesc = xDialog.getChild("searchdesc")
+ self.assertEqual(get_state_as_dict(searchdesc)["Text"], "bold")
+ noformat = xDialog.getChild("noformat")
+ noformat.executeAction("CLICK", tuple()) #click No format button
+ self.assertEqual(get_state_as_dict(searchdesc)["Text"], "")
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/librelogo/run.py b/sw/qa/uitest/librelogo/run.py
index 11bc4dd3c3d1..26b8f5c7df44 100644
--- a/sw/qa/uitest/librelogo/run.py
+++ b/sw/qa/uitest/librelogo/run.py
@@ -28,68 +28,70 @@ class LibreLogoTest(UITestCase):
self.xUITest.executeCommand(self.LIBRELOGO_PATH %command)
def test_librelogo(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- # to check the state of LibreLogo program execution
- xIsAlive = self.getScript("__is_alive__")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ # to check the state of LibreLogo program execution
+ xIsAlive = self.getScript("__is_alive__")
- # run a program with basic drawing commands FORWARD and RIGHT
- # using their abbreviated names FD and RT
- type_text(xWriterEdit, "fd 100 rt 45 fd 100")
- self.logo("run")
- # wait for LibreLogo program termination
- while xIsAlive.invoke((), (), ())[0]:
- pass
- # check shape count for
- # a) program running:
- # - turtle shape: result of program start
- # - line shape: result of turtle drawing
- # b) continuous line drawing (the regression
- # related to the fix of tdf#106792 resulted shorter line
- # segments than the turtle path and non-continuous line
- # drawing, ie. in this example, three line shapes
- # instead of a single one. See its fix in
- # commit 502e8785085f9e8b54ee383080442c2dcaf95b15)
- self.assertEqual(document.DrawPage.getCount(), 2)
+ # run a program with basic drawing commands FORWARD and RIGHT
+ # using their abbreviated names FD and RT
+ type_text(xWriterEdit, "fd 100 rt 45 fd 100")
+ self.logo("run")
+ # wait for LibreLogo program termination
+ while xIsAlive.invoke((), (), ())[0]:
+ pass
+ # check shape count for
+ # a) program running:
+ # - turtle shape: result of program start
+ # - line shape: result of turtle drawing
+ # b) continuous line drawing (the regression
+ # related to the fix of tdf#106792 resulted shorter line
+ # segments than the turtle path and non-continuous line
+ # drawing, ie. in this example, three line shapes
+ # instead of a single one. See its fix in
+ # commit 502e8785085f9e8b54ee383080442c2dcaf95b15)
+ self.assertEqual(document.DrawPage.getCount(), 2)
- # check formatting by "magic wand"
- self.logo("__translate__")
- # a) check expansion of abbreviated commands : fd -> FORWARD, rt -> RIGHT,
- # b) check line breaking (fix for tdf#100941: new line instead of the text "\" and "n")
- self.assertEqual(document.Text.String.replace('\r\n', '\n'), "\nFORWARD 100 RIGHT 45 FORWARD 100")
- # c) check usage of real paragraphs instead of line break (tdf#120422)
- # first paragraph is empty (for working page break)
- self.assertEqual(document.Text.createEnumeration().nextElement().String, "")
+ # check formatting by "magic wand"
+ self.logo("__translate__")
+ # a) check expansion of abbreviated commands : fd -> FORWARD, rt -> RIGHT,
+ # b) check line breaking (fix for tdf#100941: new line instead of the text "\" and "n")
+ self.assertEqual(document.Text.String.replace('\r\n', '\n'), "\nFORWARD 100 RIGHT 45 FORWARD 100")
+ # c) check usage of real paragraphs instead of line break (tdf#120422)
+ # first paragraph is empty (for working page break)
+ self.assertEqual(document.Text.createEnumeration().nextElement().String, "")
- # function definitions and calls can be in arbitrary order
- document.Text.String = """
- ; dragon curve
- TO x n
- IF n = 0 [ STOP ]
- x n-1
- RIGHT 90
- y n-1 ; it worked only as "y(n-1)"
- FORWARD 10
- END
+ # function definitions and calls can be in arbitrary order
+ document.Text.String = """
+; dragon curve
+TO x n
+IF n = 0 [ STOP ]
+x n-1
+RIGHT 90
+y n-1 ; it worked only as "y(n-1)"
+FORWARD 10
+END
- TO y n
- IF n = 0 [ STOP ]
- FORWARD 10
- x n-1
- LEFT 90
- y n-1
- END
+TO y n
+IF n = 0 [ STOP ]
+FORWARD 10
+x n-1
+LEFT 90
+y n-1
+END
- PICTURE ; start new line draw
- x 3 ; draw only a few levels
- """
- self.logo("run")
- # wait for LibreLogo program termination
- while xIsAlive.invoke((), (), ())[0]:
- pass
- # new shape + previous two ones = 3
- self.assertEqual(document.DrawPage.getCount(), 3)
+PICTURE ; start new line draw
+x 3 ; draw only a few levels
+"""
+ self.logo("run")
+ # wait for LibreLogo program termination
+ while xIsAlive.invoke((), (), ())[0]:
+ pass
+ # new shape + previous two ones = 3
+ self.assertEqual(document.DrawPage.getCount(), 3)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/macro_tests/tdf124413.py b/sw/qa/uitest/macro_tests/tdf124413.py
index a30afa6dedee..d0aaccd03929 100644
--- a/sw/qa/uitest/macro_tests/tdf124413.py
+++ b/sw/qa/uitest/macro_tests/tdf124413.py
@@ -12,32 +12,34 @@ class tdf124413(UITestCase):
def test_copy_paste_overwriting_undo_redo_in_macro_editor_tdf124413(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- #Start LibreOffice. Go to Tools > Macros > Organize Macros > Basic
- self.ui_test.execute_dialog_through_command(".uno:MacroDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- #Open Editor
- xEditBtn = xDialog.getChild("edit")
- xEditBtn.executeAction("CLICK", tuple())
-
- resultText = "REM ***** BASIC *****\n\nSub Main\n\nEnd Sub\n"
-
- xMacroWin = self.xUITest.getTopFocusWindow()
- xEditWin = xMacroWin.getChild('EditorWindow')
-
- self.assertEqual(get_state_as_dict(xEditWin)['Text'], resultText)
-
- self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Copy")
- self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Paste")
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Redo")
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Redo")
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Redo")
-
- self.assertEqual(get_state_as_dict(xEditWin)['Text'], resultText)
+ self.ui_test.create_doc_in_start_center("writer")
+ #Start LibreOffice. Go to Tools > Macros > Organize Macros > Basic
+ self.ui_test.execute_dialog_through_command(".uno:MacroDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Open Editor
+ xEditBtn = xDialog.getChild("edit")
+ xEditBtn.executeAction("CLICK", tuple())
+
+ resultText = "REM ***** BASIC *****\n\nSub Main\n\nEnd Sub\n"
+
+ xMacroWin = self.xUITest.getTopFocusWindow()
+ xEditWin = xMacroWin.getChild('EditorWindow')
+
+ self.assertEqual(get_state_as_dict(xEditWin)['Text'], resultText)
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Paste")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Redo")
+
+ self.assertEqual(get_state_as_dict(xEditWin)['Text'], resultText)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/macro_tests/tdf64690.py b/sw/qa/uitest/macro_tests/tdf64690.py
index fcb09fa74546..7798e3bbc995 100644
--- a/sw/qa/uitest/macro_tests/tdf64690.py
+++ b/sw/qa/uitest/macro_tests/tdf64690.py
@@ -13,61 +13,63 @@ class tdf64690(UITestCase):
def test_tdf64690(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.ui_test.execute_dialog_through_command(".uno:MacroDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:MacroDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- xEditBtn = xDialog.getChild("edit")
- xEditBtn.executeAction("CLICK", tuple())
+ xEditBtn = xDialog.getChild("edit")
+ xEditBtn.executeAction("CLICK", tuple())
- xMacroWin = self.xUITest.getTopFocusWindow()
- xEditWin = xMacroWin.getChild('EditorWindow')
+ xMacroWin = self.xUITest.getTopFocusWindow()
+ xEditWin = xMacroWin.getChild('EditorWindow')
- self.xUITest.executeCommand(".uno:SelectAll")
- xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ self.xUITest.executeCommand(".uno:SelectAll")
+ xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- self.assertEqual("\n", get_state_as_dict(xEditWin)['Text'])
+ self.assertEqual("\n", get_state_as_dict(xEditWin)['Text'])
- xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"'abc"}))
- xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
- xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"'def"}))
+ xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"'abc"}))
+ xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+ xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"'def"}))
- self.assertEqual("'abc\n'def\n", get_state_as_dict(xEditWin)['Text'])
+ self.assertEqual("'abc\n'def\n", get_state_as_dict(xEditWin)['Text'])
- self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:SelectAll")
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"ABC"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"ABC"}))
- regexp = xDialog.getChild("regexp")
- if get_state_as_dict(regexp)['Selected'] == 'false':
- regexp.executeAction("CLICK", tuple())
- self.assertEqual("true", get_state_as_dict(regexp)['Selected'])
+ regexp = xDialog.getChild("regexp")
+ if get_state_as_dict(regexp)['Selected'] == 'false':
+ regexp.executeAction("CLICK", tuple())
+ self.assertEqual("true", get_state_as_dict(regexp)['Selected'])
- selection = xDialog.getChild("selection")
- if get_state_as_dict(selection)['Selected'] == 'false':
- selection.executeAction("CLICK", tuple())
- self.assertEqual("true", get_state_as_dict(selection)['Selected'])
+ selection = xDialog.getChild("selection")
+ if get_state_as_dict(selection)['Selected'] == 'false':
+ selection.executeAction("CLICK", tuple())
+ self.assertEqual("true", get_state_as_dict(selection)['Selected'])
- replaceall = xDialog.getChild("replaceall")
+ replaceall = xDialog.getChild("replaceall")
- # Without the fix in place, this test would have hung here
- with self.ui_test.execute_blocking_action(replaceall.executeAction, args=('CLICK', ())):
- pass
+ # Without the fix in place, this test would have hung here
+ with self.ui_test.execute_blocking_action(replaceall.executeAction, args=('CLICK', ())):
+ pass
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
- self.assertEqual("ABCABCABCABC\nABCABCABCABC\n", get_state_as_dict(xEditWin)['Text'])
+ self.assertEqual("ABCABCABCABC\nABCABCABCABC\n", get_state_as_dict(xEditWin)['Text'])
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/navigator/tdf137274.py b/sw/qa/uitest/navigator/tdf137274.py
index 4d36b38458e0..36f25f4c2d7a 100644
--- a/sw/qa/uitest/navigator/tdf137274.py
+++ b/sw/qa/uitest/navigator/tdf137274.py
@@ -12,52 +12,54 @@ class tdf137274(UITestCase):
def test_tdf137274(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ xMainDoc = self.ui_test.create_doc_in_start_center("writer")
- xMainWindow = self.xUITest.getTopFocusWindow()
- xWriterEdit = xMainWindow.getChild("writer_edit")
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xMainWindow.getChild("writer_edit")
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Test"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Test"}))
- # Insert first comment
- xArgs = mkPropertyValues({"Text": "C1"})
- self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
+ # Insert first comment
+ xArgs = mkPropertyValues({"Text": "C1"})
+ self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
- # wait until the comment is available
- self.ui_test.wait_until_child_is_available('Comment1')
+ # wait until the comment is available
+ self.ui_test.wait_until_child_is_available('Comment1')
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
- # wait until the navigator panel is available
- xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
+ # wait until the navigator panel is available
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
- xContentTree = xNavigatorPanel.getChild("contenttree")
- xComments = xContentTree.getChild('10')
- self.assertEqual('Comments', get_state_as_dict(xComments)['Text'])
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xComments = xContentTree.getChild('10')
+ self.assertEqual('Comments', get_state_as_dict(xComments)['Text'])
- xComments.executeAction("EXPAND", tuple())
+ xComments.executeAction("EXPAND", tuple())
- self.assertEqual(1, len(xComments.getChildren()))
- self.assertEqual('C1', get_state_as_dict(xComments.getChild('0'))['Text'])
+ self.assertEqual(1, len(xComments.getChildren()))
+ self.assertEqual('C1', get_state_as_dict(xComments.getChild('0'))['Text'])
- xComments.executeAction("COLLAPSE", tuple())
+ xComments.executeAction("COLLAPSE", tuple())
- xArgs = mkPropertyValues({"Text": "C2"})
- self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
+ xArgs = mkPropertyValues({"Text": "C2"})
+ self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
- # wait until the second comment is available
- self.ui_test.wait_until_child_is_available('Comment2')
+ # wait until the second comment is available
+ self.ui_test.wait_until_child_is_available('Comment2')
- xComments.executeAction("EXPAND", tuple())
+ xComments.executeAction("EXPAND", tuple())
- # Without the fix in place, this test would have failed with AssertionError: 2 != 0
- self.assertEqual(2, len(xComments.getChildren()))
- self.assertEqual('C1', get_state_as_dict(xComments.getChild('0'))['Text'])
+ # Without the fix in place, this test would have failed with AssertionError: 2 != 0
+ self.assertEqual(2, len(xComments.getChildren()))
+ self.assertEqual('C1', get_state_as_dict(xComments.getChild('0'))['Text'])
- xComments.executeAction("COLLAPSE", tuple())
+ xComments.executeAction("COLLAPSE", tuple())
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/navigator/tdf140257.py b/sw/qa/uitest/navigator/tdf140257.py
index 796a9e92a35d..9c923bedee4d 100644
--- a/sw/qa/uitest/navigator/tdf140257.py
+++ b/sw/qa/uitest/navigator/tdf140257.py
@@ -27,87 +27,89 @@ class Tdf140257(UITestCase):
self.ui_test.close_dialog_through_button(xOKBtn)
def test_tdf140257(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xMainWindow = self.xUITest.getTopFocusWindow()
- xWriterEdit = xMainWindow.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xMainWindow.getChild("writer_edit")
- self.change_outline_level("Level 1")
+ self.change_outline_level("Level 1")
- for i in range(4):
- type_text(xWriterEdit, 'P' + str(i + 1))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ for i in range(4):
+ type_text(xWriterEdit, 'P' + str(i + 1))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- type_text(xWriterEdit, 'P5')
+ type_text(xWriterEdit, 'P5')
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
- # wait until the navigator panel is available
- xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
+ # wait until the navigator panel is available
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
- xContentTree = xNavigatorPanel.getChild("contenttree")
- xHeadings = xContentTree.getChild('0')
- self.assertEqual('Headings', get_state_as_dict(xHeadings)['Text'])
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xHeadings = xContentTree.getChild('0')
+ self.assertEqual('Headings', get_state_as_dict(xHeadings)['Text'])
- xHeadings.executeAction("EXPAND", tuple())
+ xHeadings.executeAction("EXPAND", tuple())
- self.assertEqual(5, len(xHeadings.getChildren()))
+ self.assertEqual(5, len(xHeadings.getChildren()))
- for i in range(5):
- self.assertEqual('P' + str(i + 1), get_state_as_dict(xHeadings.getChild(str(i)))['Text'])
+ for i in range(5):
+ self.assertEqual('P' + str(i + 1), get_state_as_dict(xHeadings.getChild(str(i)))['Text'])
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
- document = self.ui_test.get_component()
- cursor = document.getCurrentController().getViewCursor()
+ document = self.ui_test.get_component()
+ cursor = document.getCurrentController().getViewCursor()
- # Use Adding Selection
- selectionProperty = mkPropertyValues({"SelectionMode": 2})
- self.xUITest.executeCommandWithParameters(".uno:SelectionMode", selectionProperty)
+ # Use Adding Selection
+ selectionProperty = mkPropertyValues({"SelectionMode": 2})
+ self.xUITest.executeCommandWithParameters(".uno:SelectionMode", selectionProperty)
- # Go to P2 and select it
- cursor.goUp(3, False)
- cursor.gotoStartOfLine(False)
- cursor.gotoEndOfLine(True)
+ # Go to P2 and select it
+ cursor.goUp(3, False)
+ cursor.gotoStartOfLine(False)
+ cursor.gotoEndOfLine(True)
- # Go to P4 and select it
- cursor.goDown(2, False)
- cursor.gotoStartOfLine(False)
- cursor.gotoEndOfLine(True)
+ # Go to P4 and select it
+ cursor.goDown(2, False)
+ cursor.gotoStartOfLine(False)
+ cursor.gotoEndOfLine(True)
- self.change_outline_level("Level 2")
+ self.change_outline_level("Level 2")
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
- # wait until the navigator panel is available
- xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
+ # wait until the navigator panel is available
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
- xContentTree = xNavigatorPanel.getChild("contenttree")
- xHeadings = xContentTree.getChild('0')
- self.assertEqual('Headings', get_state_as_dict(xHeadings)['Text'])
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xHeadings = xContentTree.getChild('0')
+ self.assertEqual('Headings', get_state_as_dict(xHeadings)['Text'])
- xHeadings.executeAction("EXPAND", tuple())
+ xHeadings.executeAction("EXPAND", tuple())
- # Without the fix in place, this test would have failed with
- # AssertionError: 3 != 4
- self.assertEqual(3, len(xHeadings.getChildren()))
- xChild1 = xHeadings.getChild('0')
- self.assertEqual('P1', get_state_as_dict(xChild1)['Text'])
- xChild1.executeAction("EXPAND", tuple())
- self.assertEqual(1, len(xChild1.getChildren()))
- self.assertEqual('P2', get_state_as_dict(xChild1.getChild('0'))['Text'])
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 3 != 4
+ self.assertEqual(3, len(xHeadings.getChildren()))
+ xChild1 = xHeadings.getChild('0')
+ self.assertEqual('P1', get_state_as_dict(xChild1)['Text'])
+ xChild1.executeAction("EXPAND", tuple())
+ self.assertEqual(1, len(xChild1.getChildren()))
+ self.assertEqual('P2', get_state_as_dict(xChild1.getChild('0'))['Text'])
- xChild2 = xHeadings.getChild('1')
- self.assertEqual('P3', get_state_as_dict(xChild2)['Text'])
- xChild2.executeAction("EXPAND", tuple())
- self.assertEqual(1, len(xChild2.getChildren()))
- self.assertEqual('P4', get_state_as_dict(xChild2.getChild('0'))['Text'])
+ xChild2 = xHeadings.getChild('1')
+ self.assertEqual('P3', get_state_as_dict(xChild2)['Text'])
+ xChild2.executeAction("EXPAND", tuple())
+ self.assertEqual(1, len(xChild2.getChildren()))
+ self.assertEqual('P4', get_state_as_dict(xChild2.getChild('0'))['Text'])
- self.assertEqual('P5', get_state_as_dict(xHeadings.getChild('2'))['Text'])
+ self.assertEqual('P5', get_state_as_dict(xHeadings.getChild('2'))['Text'])
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/options/optionsDialog.py b/sw/qa/uitest/options/optionsDialog.py
index 57a3ad4d82bb..92494ab81ab1 100644
--- a/sw/qa/uitest/options/optionsDialog.py
+++ b/sw/qa/uitest/options/optionsDialog.py
@@ -9,46 +9,50 @@ from uitest.framework import UITestCase
class optionsDialog(UITestCase):
def test_moreIconsDialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xPages = xDialog.getChild("pages")
- xLOEntry = xPages.getChild('0')
- xLOEntry.executeAction("EXPAND", tuple())
- xViewEntry = xLOEntry.getChild('2')
- xViewEntry.executeAction("SELECT", tuple())
+ xDialog = self.xUITest.getTopFocusWindow()
+ xPages = xDialog.getChild("pages")
+ xLOEntry = xPages.getChild('0')
+ xLOEntry.executeAction("EXPAND", tuple())
+ xViewEntry = xLOEntry.getChild('2')
+ xViewEntry.executeAction("SELECT", tuple())
- xMoreIconsBtn = xDialog.getChild("btnMoreIcons")
+ xMoreIconsBtn = xDialog.getChild("btnMoreIcons")
- with self.ui_test.execute_blocking_action(xMoreIconsBtn.executeAction, args=('CLICK', ()), close_button="buttonClose") as dialog:
- # Check it doesn't crash while opening it
- xCloseBtn = dialog.getChild("buttonClose")
- self.ui_test.wait_until_property_is_updated(xCloseBtn, "Enabled", "true")
+ with self.ui_test.execute_blocking_action(xMoreIconsBtn.executeAction, args=('CLICK', ()), close_button="buttonClose") as dialog:
+ # Check it doesn't crash while opening it
+ xCloseBtn = dialog.getChild("buttonClose")
+ self.ui_test.wait_until_property_is_updated(xCloseBtn, "Enabled", "true")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.ui_test.close_doc()
def test_tdf138596(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xPages = xDialog.getChild("pages")
+ xWriterEntry = xPages.getChild('3')
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xFormattingAidsEntry = xWriterEntry.getChild('2')
+ xFormattingAidsEntry.executeAction("SELECT", tuple())
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xPages = xDialog.getChild("pages")
- xWriterEntry = xPages.getChild('3')
- xWriterEntry.executeAction("EXPAND", tuple())
- xFormattingAidsEntry = xWriterEntry.getChild('2')
- xFormattingAidsEntry.executeAction("SELECT", tuple())
+ xApplyBtn = xDialog.getChild("apply")
- xApplyBtn = xDialog.getChild("apply")
+ # Click apply button twice
+ # Without the fix in place, this test would have crashed here
+ xApplyBtn.executeAction("CLICK", tuple())
+ xApplyBtn.executeAction("CLICK", tuple())
- # Click apply button twice
- # Without the fix in place, this test would have crashed here
- xApplyBtn.executeAction("CLICK", tuple())
- xApplyBtn.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- 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/sw/qa/uitest/options/tdf131581.py b/sw/qa/uitest/options/tdf131581.py
index 840f0305ba12..3acebd4ce507 100644
--- a/sw/qa/uitest/options/tdf131581.py
+++ b/sw/qa/uitest/options/tdf131581.py
@@ -10,27 +10,29 @@ from uitest.framework import UITestCase
class tdf131581(UITestCase):
def test_tdf131581(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.xUITest.getTopFocusWindow()
+ self.xUITest.getTopFocusWindow()
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xLOEntry = xPages.getChild('0')
- xLOEntry.executeAction("EXPAND", tuple())
- xAdvancedEntry = xLOEntry.getChild('10')
- xAdvancedEntry.executeAction("SELECT", tuple())
+ xPages = xDialogOpt.getChild("pages")
+ xLOEntry = xPages.getChild('0')
+ xLOEntry.executeAction("EXPAND", tuple())
+ xAdvancedEntry = xLOEntry.getChild('10')
+ xAdvancedEntry.executeAction("SELECT", tuple())
- xExpertBtn = xDialogOpt.getChild("expertconfig")
+ xExpertBtn = xDialogOpt.getChild("expertconfig")
- with self.ui_test.execute_blocking_action(xExpertBtn.executeAction, args=('CLICK', ())) as dialog:
- # Without the fix in place, this would have hung
- xSearchBtn = dialog.getChild("searchButton")
- xSearchBtn.executeAction("CLICK", tuple())
+ with self.ui_test.execute_blocking_action(xExpertBtn.executeAction, args=('CLICK', ())) as dialog:
+ # Without the fix in place, this would have hung
+ xSearchBtn = dialog.getChild("searchButton")
+ xSearchBtn.executeAction("CLICK", tuple())
- xOKBtn = xDialogOpt.getChild("ok")
- xOKBtn.executeAction("CLICK", tuple())
+ xOKBtn = xDialogOpt.getChild("ok")
+ xOKBtn.executeAction("CLICK", tuple())
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/options/tdf78133.py b/sw/qa/uitest/options/tdf78133.py
index df9affcf79e8..883c38231aa9 100644
--- a/sw/qa/uitest/options/tdf78133.py
+++ b/sw/qa/uitest/options/tdf78133.py
@@ -14,37 +14,38 @@ class tdf78133(UITestCase):
def test_tdf78133_options_app_colors(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- #New text document
- #open option, go to App colors
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ #New text document
+ #open option, go to App colors
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialog = self.xUITest.getTopFocusWindow()
- xPages = xDialog.getChild("pages")
- xLOEntry = xPages.getChild('0') # Lo Dev
- xLOEntry.executeAction("EXPAND", tuple())
- xLoAppColorsEntry = xLOEntry.getChild('8')
- xLoAppColorsEntry.executeAction("SELECT", tuple()) #Applications Colors
- #change text boundaries checkbox, save
- docboundaries = xDialog.getChild("docboundaries")
- docboundaries.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify - reopen dialog and check if "text boundaries" is still unchecked
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialog = self.xUITest.getTopFocusWindow()
+ xPages = xDialog.getChild("pages")
+ xLOEntry = xPages.getChild('0') # Lo Dev
+ xLOEntry.executeAction("EXPAND", tuple())
+ xLoAppColorsEntry = xLOEntry.getChild('8')
+ xLoAppColorsEntry.executeAction("SELECT", tuple()) #Applications Colors
+ #change text boundaries checkbox, save
+ docboundaries = xDialog.getChild("docboundaries")
+ docboundaries.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify - reopen dialog and check if "text boundaries" is still unchecked
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialog = self.xUITest.getTopFocusWindow()
- xPages = xDialog.getChild("pages")
- xLOEntry = xPages.getChild('0') # Lo Dev
- xLOEntry.executeAction("EXPAND", tuple())
- xLoAppColorsEntry = xLOEntry.getChild('8')
- xLoAppColorsEntry.executeAction("SELECT", tuple()) #Applications Colors
- #change text boundaries checkbox, save
- docboundaries = xDialog.getChild("docboundaries")
- self.assertEqual(get_state_as_dict(docboundaries)["Selected"], "false")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xPages = xDialog.getChild("pages")
+ xLOEntry = xPages.getChild('0') # Lo Dev
+ xLOEntry.executeAction("EXPAND", tuple())
+ xLoAppColorsEntry = xLOEntry.getChild('8')
+ xLoAppColorsEntry.executeAction("SELECT", tuple()) #Applications Colors
+ #change text boundaries checkbox, save
+ docboundaries = xDialog.getChild("docboundaries")
+ self.assertEqual(get_state_as_dict(docboundaries)["Selected"], "false")
+ 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/sw/qa/uitest/sidebar/stylesSidebar.py b/sw/qa/uitest/sidebar/stylesSidebar.py
index 3094be3d5379..8364334ad77e 100644
--- a/sw/qa/uitest/sidebar/stylesSidebar.py
+++ b/sw/qa/uitest/sidebar/stylesSidebar.py
@@ -12,66 +12,68 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class StylesSidebar(UITestCase):
def test_load_styles_from_template(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.ui_test.execute_dialog_through_command(".uno:LoadStyles")
+ self.ui_test.execute_dialog_through_command(".uno:LoadStyles")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- xText = xDialog.getChild("text")
- xNumbering = xDialog.getChild("numbering")
- xFrame = xDialog.getChild("frame")
- xPages = xDialog.getChild("pages")
+ xText = xDialog.getChild("text")
+ xNumbering = xDialog.getChild("numbering")
+ xFrame = xDialog.getChild("frame")
+ xPages = xDialog.getChild("pages")
- self.assertEqual('true', get_state_as_dict(xText)['Selected'])
- self.assertEqual('false', get_state_as_dict(xNumbering)['Selected'])
- self.assertEqual('false', get_state_as_dict(xFrame)['Selected'])
- self.assertEqual('false', get_state_as_dict(xPages)['Selected'])
+ self.assertEqual('true', get_state_as_dict(xText)['Selected'])
+ self.assertEqual('false', get_state_as_dict(xNumbering)['Selected'])
+ self.assertEqual('false', get_state_as_dict(xFrame)['Selected'])
+ self.assertEqual('false', get_state_as_dict(xPages)['Selected'])
- xNumbering.executeAction("CLICK", tuple())
- xFrame.executeAction("CLICK", tuple())
- xPages.executeAction("CLICK", tuple())
+ xNumbering.executeAction("CLICK", tuple())
+ xFrame.executeAction("CLICK", tuple())
+ xPages.executeAction("CLICK", tuple())
- self.assertEqual('true', get_state_as_dict(xText)['Selected'])
- self.assertEqual('true', get_state_as_dict(xNumbering)['Selected'])
- self.assertEqual('true', get_state_as_dict(xFrame)['Selected'])
- self.assertEqual('true', get_state_as_dict(xPages)['Selected'])
+ self.assertEqual('true', get_state_as_dict(xText)['Selected'])
+ self.assertEqual('true', get_state_as_dict(xNumbering)['Selected'])
+ self.assertEqual('true', get_state_as_dict(xFrame)['Selected'])
+ self.assertEqual('true', get_state_as_dict(xPages)['Selected'])
- xFileName = xDialog.getChild("fromfile")
- xFileName.executeAction("CLICK", tuple())
+ xFileName = xDialog.getChild("fromfile")
+ xFileName.executeAction("CLICK", tuple())
- xOpenDialog = self.xUITest.getTopFocusWindow()
- xFileName = xOpenDialog.getChild("file_name")
- xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": get_url_for_data_file("customStyles.odt")}))
+ xOpenDialog = self.xUITest.getTopFocusWindow()
+ xFileName = xOpenDialog.getChild("file_name")
+ xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": get_url_for_data_file("customStyles.odt")}))
- xOpenBtn = xOpenDialog.getChild("open")
- xOpenBtn.executeAction("CLICK", tuple())
+ xOpenBtn = xOpenDialog.getChild("open")
+ xOpenBtn.executeAction("CLICK", tuple())
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.xUITest.executeCommand(".uno:Sidebar")
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "StyleListPanel"}))
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "StyleListPanel"}))
- xFilter = xWriterEdit.getChild('filter')
- select_by_text(xFilter, "Custom Styles")
+ xFilter = xWriterEdit.getChild('filter')
+ select_by_text(xFilter, "Custom Styles")
- expectedResults = ["customParagraphStyle", "customCharacterStyle", "customFrameStyle",
- "customPageStyle", "customNumberingStyle"]
+ expectedResults = ["customParagraphStyle", "customCharacterStyle", "customFrameStyle",
+ "customPageStyle", "customNumberingStyle"]
- for i in range(5):
- xLeft = xWriterEdit.getChild('left')
+ for i in range(5):
+ xLeft = xWriterEdit.getChild('left')
- #change to another style type
- xLeft.executeAction("CLICK", mkPropertyValues({"POS": str( i )}))
+ #change to another style type
+ xLeft.executeAction("CLICK", mkPropertyValues({"POS": str( i )}))
- xFlatView = xWriterEdit.getChild("flatview")
+ xFlatView = xWriterEdit.getChild("flatview")
- self.assertEqual(1, len(xFlatView.getChildren()))
+ self.assertEqual(1, len(xFlatView.getChildren()))
- xFlatView.getChild('0').executeAction("SELECT", tuple())
- self.assertEqual(expectedResults[i], get_state_as_dict(xFlatView)['SelectEntryText'])
+ xFlatView.getChild('0').executeAction("SELECT", tuple())
+ self.assertEqual(expectedResults[i], get_state_as_dict(xFlatView)['SelectEntryText'])
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/sidebar/tdf133189.py b/sw/qa/uitest/sidebar/tdf133189.py
index 26859e64e61b..30bd35d4c451 100644
--- a/sw/qa/uitest/sidebar/tdf133189.py
+++ b/sw/qa/uitest/sidebar/tdf133189.py
@@ -11,67 +11,69 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf133189(UITestCase):
def test_tdf133189(self):
- with self.ui_test.create_doc_in_start_center("writer"):
-
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
-
- self.xUITest.executeCommand(".uno:Sidebar")
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "PageStylesPanel"}))
-
- xPaperSize = xWriterEdit.getChild('papersize')
- xPaperWidth = xWriterEdit.getChild('paperwidth')
- xPaperHeight = xWriterEdit.getChild('paperheight')
- xPaperOrient = xWriterEdit.getChild('paperorientation')
- xPaperMargin = xWriterEdit.getChild('marginLB')
-
- #change measurement to Inches
- change_measurement_unit(self, 'Inch')
-
- self.ui_test.execute_dialog_through_command(".uno:PageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- xWidth = xDialog.getChild('spinWidth')
- xHeight = xDialog.getChild('spinHeight')
-
- props = {"VALUE": '8.0'}
- actionProps = mkPropertyValues(props)
-
- xWidth.executeAction("VALUE", actionProps)
- xHeight.executeAction("VALUE", actionProps)
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.wait_until_property_is_updated(xPaperMargin, "SelectEntryText", "Normal (0.75″)")
- self.assertEqual(get_state_as_dict(xPaperMargin)['SelectEntryText'], "Normal (0.75″)")
- self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User")
- self.assertEqual(get_state_as_dict(xPaperSize)['SelectEntryText'], "User")
- self.ui_test.wait_until_property_is_updated(xPaperOrient, "SelectEntryText", "Portrait")
- self.assertEqual(get_state_as_dict(xPaperOrient)['SelectEntryText'], "Portrait")
- self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "8.00″")
- self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "8.00″")
- self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "8.00″")
- self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "8.00″")
-
- #change measurement again to Centimeters
- change_measurement_unit(self, 'Centimeter')
-
- self.ui_test.wait_until_property_is_updated(xPaperMargin, "SelectEntryText", "Normal (1.90 cm)")
- # tdf#129267
- self.assertEqual(get_state_as_dict(xPaperMargin)['SelectEntryText'], "Normal (1.90 cm)")
- self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User")
- self.assertEqual(get_state_as_dict(xPaperSize)['SelectEntryText'], "User")
- self.ui_test.wait_until_property_is_updated(xPaperOrient, "SelectEntryText", "Portrait")
- self.assertEqual(get_state_as_dict(xPaperOrient)['SelectEntryText'], "Portrait")
- self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "20.32 cm")
- self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "20.32 cm")
- self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "20.32 cm")
- self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "20.32 cm")
-
- self.xUITest.executeCommand(".uno:Sidebar")
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "PageStylesPanel"}))
+
+ xPaperSize = xWriterEdit.getChild('papersize')
+ xPaperWidth = xWriterEdit.getChild('paperwidth')
+ xPaperHeight = xWriterEdit.getChild('paperheight')
+ xPaperOrient = xWriterEdit.getChild('paperorientation')
+ xPaperMargin = xWriterEdit.getChild('marginLB')
+
+ #change measurement to Inches
+ change_measurement_unit(self, 'Inch')
+
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ xWidth = xDialog.getChild('spinWidth')
+ xHeight = xDialog.getChild('spinHeight')
+
+ props = {"VALUE": '8.0'}
+ actionProps = mkPropertyValues(props)
+
+ xWidth.executeAction("VALUE", actionProps)
+ xHeight.executeAction("VALUE", actionProps)
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.ui_test.wait_until_property_is_updated(xPaperMargin, "SelectEntryText", "Normal (0.75″)")
+ self.assertEqual(get_state_as_dict(xPaperMargin)['SelectEntryText'], "Normal (0.75″)")
+ self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User")
+ self.assertEqual(get_state_as_dict(xPaperSize)['SelectEntryText'], "User")
+ self.ui_test.wait_until_property_is_updated(xPaperOrient, "SelectEntryText", "Portrait")
+ self.assertEqual(get_state_as_dict(xPaperOrient)['SelectEntryText'], "Portrait")
+ self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "8.00″")
+ self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "8.00″")
+ self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "8.00″")
+ self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "8.00″")
+
+ #change measurement again to Centimeters
+ change_measurement_unit(self, 'Centimeter')
+
+ self.ui_test.wait_until_property_is_updated(xPaperMargin, "SelectEntryText", "Normal (1.90 cm)")
+ # tdf#129267
+ self.assertEqual(get_state_as_dict(xPaperMargin)['SelectEntryText'], "Normal (1.90 cm)")
+ self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User")
+ self.assertEqual(get_state_as_dict(xPaperSize)['SelectEntryText'], "User")
+ self.ui_test.wait_until_property_is_updated(xPaperOrient, "SelectEntryText", "Portrait")
+ self.assertEqual(get_state_as_dict(xPaperOrient)['SelectEntryText'], "Portrait")
+ self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "20.32 cm")
+ self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "20.32 cm")
+ self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "20.32 cm")
+ self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "20.32 cm")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/sidebar/tdf135590.py b/sw/qa/uitest/sidebar/tdf135590.py
index d0a255a47acd..6a061b7a1f96 100644
--- a/sw/qa/uitest/sidebar/tdf135590.py
+++ b/sw/qa/uitest/sidebar/tdf135590.py
@@ -12,68 +12,70 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf135590(UITestCase):
def test_tdf135590(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
- #change measurement to Centimeter
- change_measurement_unit(self, 'Centimeter')
+ #change measurement to Centimeter
+ change_measurement_unit(self, 'Centimeter')
- self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope")
+ self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild('width')
- xHeight = xDialog.getChild('height')
- xFormat = xDialog.getChild("format")
+ xWidth = xDialog.getChild('width')
+ xHeight = xDialog.getChild('height')
+ xFormat = xDialog.getChild("format")
- select_by_text(xFormat, "C6 Envelope")
+ select_by_text(xFormat, "C6 Envelope")
- self.assertEqual("16.2", get_state_as_dict(xWidth)['Value'])
- self.assertEqual("11.4", get_state_as_dict(xHeight)['Value'])
+ self.assertEqual("16.2", get_state_as_dict(xWidth)['Value'])
+ self.assertEqual("11.4", get_state_as_dict(xHeight)['Value'])
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- # A new document is created
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ # A new document is created
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.ui_test.execute_dialog_through_command(".uno:PageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild('spinWidth')
- xHeight = xDialog.getChild('spinHeight')
- xFormatList = xDialog.getChild("comboPageFormat")
+ xWidth = xDialog.getChild('spinWidth')
+ xHeight = xDialog.getChild('spinHeight')
+ xFormatList = xDialog.getChild("comboPageFormat")
- # Without the fix in place, this test would have failed with
- # AssertionError: '16.2' != '11.4'
- self.assertEqual("16.2", get_state_as_dict(xWidth)['Value'])
- self.assertEqual("11.4", get_state_as_dict(xHeight)['Value'])
- self.assertEqual("User", get_state_as_dict(xFormatList)['SelectEntryText'])
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '16.2' != '11.4'
+ self.assertEqual("16.2", get_state_as_dict(xWidth)['Value'])
+ self.assertEqual("11.4", get_state_as_dict(xHeight)['Value'])
+ self.assertEqual("User", get_state_as_dict(xFormatList)['SelectEntryText'])
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.xUITest.executeCommand(".uno:Sidebar")
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "PageStylesPanel"}))
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "PageStylesPanel"}))
- xPaperSize = xWriterEdit.getChild('papersize')
- self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User")
- self.assertEqual(get_state_as_dict(xPaperSize)['SelectEntryText'], "User")
+ xPaperSize = xWriterEdit.getChild('papersize')
+ self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User")
+ self.assertEqual(get_state_as_dict(xPaperSize)['SelectEntryText'], "User")
- xPaperHeight = xWriterEdit.getChild('paperheight')
- self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "11.40 cm")
- self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "11.40 cm")
+ xPaperHeight = xWriterEdit.getChild('paperheight')
+ self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "11.40 cm")
+ self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "11.40 cm")
- xPaperWidth = xWriterEdit.getChild('paperwidth')
- self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "16.20 cm")
- self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "16.20 cm")
+ xPaperWidth = xWriterEdit.getChild('paperwidth')
+ self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "16.20 cm")
+ self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "16.20 cm")
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/styleInspector/tdf137105.py b/sw/qa/uitest/styleInspector/tdf137105.py
index 7b080b3a6485..b0a6b709d1e8 100644
--- a/sw/qa/uitest/styleInspector/tdf137105.py
+++ b/sw/qa/uitest/styleInspector/tdf137105.py
@@ -9,28 +9,30 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class tdf137105(UITestCase):
def test_tdf137105(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- text = document.getText()
- cursor = text.createTextCursor()
- textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
- provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
- graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")}))
- textGraphic.Graphic = graphic
- text.insertTextContent(cursor, textGraphic, False)
- #select image
- document.getCurrentController().select(document.getDrawPage()[0])
-
- xWriterEdit = xWriterDoc.getChild("writer_edit")
-
- self.xUITest.executeCommand(".uno:Sidebar")
- # Without the fix in place, this test would have crashed here
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"}))
-
- # if the image is selected, there is nothing in the panel
- self.assertEqual('0', get_state_as_dict(xWriterEdit.getChild('listbox_fonts'))['Children'])
-
- self.xUITest.executeCommand(".uno:Sidebar")
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ text = document.getText()
+ cursor = text.createTextCursor()
+ textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
+ provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
+ graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")}))
+ textGraphic.Graphic = graphic
+ text.insertTextContent(cursor, textGraphic, False)
+ #select image
+ document.getCurrentController().select(document.getDrawPage()[0])
+
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ # Without the fix in place, this test would have crashed here
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"}))
+
+ # if the image is selected, there is nothing in the panel
+ self.assertEqual('0', get_state_as_dict(xWriterEdit.getChild('listbox_fonts'))['Children'])
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/styleInspector/tdf137513.py b/sw/qa/uitest/styleInspector/tdf137513.py
index fedc3d48c569..6c216b40f33a 100644
--- a/sw/qa/uitest/styleInspector/tdf137513.py
+++ b/sw/qa/uitest/styleInspector/tdf137513.py
@@ -9,48 +9,50 @@ from uitest.uihelper.common import get_state_as_dict, type_text
class tdf137513(UITestCase):
def test_tdf137513(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.xUITest.executeCommand(".uno:InsertTable?Columns:short=2&Rows:short=2")
+ self.xUITest.executeCommand(".uno:InsertTable?Columns:short=2&Rows:short=2")
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "test")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ type_text(xWriterEdit, "test")
- self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Bold")
+ self.xUITest.executeCommand(".uno:Bold")
- self.xUITest.executeCommand(".uno:Sidebar")
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"}))
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"}))
- xListBox = xWriterEdit.getChild('listbox_fonts')
+ xListBox = xWriterEdit.getChild('listbox_fonts')
- # The cursor is on text inside the table with direct formatting
- self.assertEqual(2, len(xListBox.getChild('0').getChildren()))
- self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
- self.assertEqual("Table Contents\t", get_state_as_dict(xListBox.getChild('0').getChild('1'))['Text'])
- self.assertEqual(136, len(xListBox.getChild('0').getChild('0').getChildren()))
+ # The cursor is on text inside the table with direct formatting
+ self.assertEqual(2, len(xListBox.getChild('0').getChildren()))
+ self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
+ self.assertEqual("Table Contents\t", get_state_as_dict(xListBox.getChild('0').getChild('1'))['Text'])
+ self.assertEqual(136, len(xListBox.getChild('0').getChild('0').getChildren()))
- xTableContent = xListBox.getChild('0').getChild('1')
- self.assertEqual(5, len(xTableContent.getChildren()))
- self.assertEqual("Follow Style\tTable Contents", get_state_as_dict(xTableContent.getChild('0'))['Text'])
- self.assertEqual("Para Line Number Count\tFalse", get_state_as_dict(xTableContent.getChild('1'))['Text'])
- self.assertEqual("Para Line Number Start Value\t0", get_state_as_dict(xTableContent.getChild('2'))['Text'])
- self.assertEqual("Para Orphans\t0", get_state_as_dict(xTableContent.getChild('3'))['Text'])
- self.assertEqual("Para Widows\t0", get_state_as_dict(xTableContent.getChild('4'))['Text'])
+ xTableContent = xListBox.getChild('0').getChild('1')
+ self.assertEqual(5, len(xTableContent.getChildren()))
+ self.assertEqual("Follow Style\tTable Contents", get_state_as_dict(xTableContent.getChild('0'))['Text'])
+ self.assertEqual("Para Line Number Count\tFalse", get_state_as_dict(xTableContent.getChild('1'))['Text'])
+ self.assertEqual("Para Line Number Start Value\t0", get_state_as_dict(xTableContent.getChild('2'))['Text'])
+ self.assertEqual("Para Orphans\t0", get_state_as_dict(xTableContent.getChild('3'))['Text'])
+ self.assertEqual("Para Widows\t0", get_state_as_dict(xTableContent.getChild('4'))['Text'])
- xParDirFormatting = xListBox.getChild('1')
+ xParDirFormatting = xListBox.getChild('1')
- # Without the fix in place, this test would have failed here with
- # AssertionError: 3 != 0
- self.assertEqual(3, len(xParDirFormatting.getChildren()))
- self.assertEqual("Char Weight\tBold", get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
- self.assertEqual("Char Weight Asian\tBold", get_state_as_dict(xParDirFormatting.getChild('1'))['Text'])
- self.assertEqual("Char Weight Complex\tBold", get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
- self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
- self.assertEqual(0, len(xListBox.getChild('3').getChildren()))
+ # Without the fix in place, this test would have failed here with
+ # AssertionError: 3 != 0
+ self.assertEqual(3, len(xParDirFormatting.getChildren()))
+ self.assertEqual("Char Weight\tBold", get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
+ self.assertEqual("Char Weight Asian\tBold", get_state_as_dict(xParDirFormatting.getChild('1'))['Text'])
+ self.assertEqual("Char Weight Complex\tBold", get_state_as_dict(xParDirFormatting.getChild('2'))['Text'])
+ self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
+ self.assertEqual(0, len(xListBox.getChild('3').getChildren()))
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/table/insertTableDialog.py b/sw/qa/uitest/table/insertTableDialog.py
index 2017dda1ca2b..427920e1985c 100644
--- a/sw/qa/uitest/table/insertTableDialog.py
+++ b/sw/qa/uitest/table/insertTableDialog.py
@@ -10,57 +10,69 @@ from uitest.uihelper.common import get_state_as_dict
class WriterInsertTableDialog(UITestCase):
- def test_tdf104158(self):
+ def insert_table(self, name, rows, cols):
+
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xNameEdit = xDialog.getChild("nameedit")
- with self.ui_test.create_doc_in_start_center("writer"):
+ xNameEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xNameEdit.executeAction("TYPE", mkPropertyValues({"TEXT": name}))
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
+ xColSpin = xDialog.getChild("colspin")
+ xColSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xColSpin.executeAction("TYPE", mkPropertyValues({"TEXT": str(cols)}))
- xNameEdit = xDialog.getChild("nameedit")
+ xRowSpin = xDialog.getChild("rowspin")
+ xRowSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xRowSpin.executeAction("TYPE", mkPropertyValues({"TEXT": str(rows)}))
- xNameEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xNameEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Test3"}))
+ self.assertEqual(get_state_as_dict(xNameEdit)["Text"], name)
+ self.assertEqual(get_state_as_dict(xColSpin)["Text"], str(cols))
+ self.assertEqual(get_state_as_dict(xRowSpin)["Text"], str(rows))
- xColSpin = xDialog.getChild("colspin")
- xColSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xColSpin.executeAction("TYPE", mkPropertyValues({"TEXT": "2"}))
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xRowSpin = xDialog.getChild("rowspin")
- xRowSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xRowSpin.executeAction("TYPE", mkPropertyValues({"TEXT": "2"}))
+ document = self.ui_test.get_component()
- self.assertEqual(get_state_as_dict(xNameEdit)["Text"], "Test3")
- self.assertEqual(get_state_as_dict(xColSpin)["Text"], "2")
- self.assertEqual(get_state_as_dict(xRowSpin)["Text"], "2")
+ tables = document.getTextTables()
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.assertEqual(tables[0].getName(), name)
+ self.assertEqual(len(tables[0].getRows()), rows)
+ self.assertEqual(len(tables[0].getColumns()), cols)
- document = self.ui_test.get_component()
+ def insertTextIntoCell(self, table, cellName, text ):
+ tableText = table.getCellByName( cellName )
+ tableText.setString( text )
- tables = document.getTextTables()
+ def test_tdf104158(self):
+
+ self.insert_table("Test3", 2, 2)
- self.assertEqual(tables[0].getName(), "Test3")
- self.assertEqual(len(tables[0].getRows()), 2)
- self.assertEqual(len(tables[0].getColumns()), 2)
+ self.ui_test.execute_dialog_through_command(".uno:TableNumberFormatDialog")
- self.ui_test.execute_dialog_through_command(".uno:TableNumberFormatDialog")
+ xNumberFormatDlg = self.xUITest.getTopFocusWindow()
- xNumberFormatDlg = self.xUITest.getTopFocusWindow()
+ xOkBtn = xNumberFormatDlg.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xOkBtn = xNumberFormatDlg.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_doc()
def test_cancel_button_insert_table_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- Dialog = self.xUITest.getTopFocusWindow()
- CancelBtn = Dialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(CancelBtn)
-
- document = self.ui_test.get_component()
- tables = document.getTextTables()
- self.assertEqual(len(tables), 0)
+ self.ui_test.create_doc_in_start_center("writer")
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ Dialog = self.xUITest.getTopFocusWindow()
+ CancelBtn = Dialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(CancelBtn)
+
+ document = self.ui_test.get_component()
+ tables = document.getTextTables()
+ self.assertEqual(len(tables), 0)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/table/sheetToTable.py b/sw/qa/uitest/table/sheetToTable.py
index e16ea93f85d5..4f48eeb644db 100644
--- a/sw/qa/uitest/table/sheetToTable.py
+++ b/sw/qa/uitest/table/sheetToTable.py
@@ -61,20 +61,22 @@ class sheetToTable(UITestCase):
self.assertEqual(table.getCellByName("A2").getString(), "3")
def test_tdf129083(self):
- with self.ui_test.create_doc_in_start_center("calc"):
+ calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "Test 1")
- enter_text_to_cell(gridwin, "A2", "Test 2")
- enter_text_to_cell(gridwin, "A3", "Test 3")
- enter_text_to_cell(gridwin, "A4", "Test 4")
+ enter_text_to_cell(gridwin, "A1", "Test 1")
+ enter_text_to_cell(gridwin, "A2", "Test 2")
+ enter_text_to_cell(gridwin, "A3", "Test 3")
+ enter_text_to_cell(gridwin, "A4", "Test 4")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
+
+ self.ui_test.close_doc()
with self.ui_test.load_file(get_url_for_data_file("tdf129083.odt")) as writer_doc:
document = self.ui_test.get_component()
diff --git a/sw/qa/uitest/table/tdf115026.py b/sw/qa/uitest/table/tdf115026.py
index 8f994335af9e..92314753a8c3 100644
--- a/sw/qa/uitest/table/tdf115026.py
+++ b/sw/qa/uitest/table/tdf115026.py
@@ -11,25 +11,26 @@ from uitest.uihelper.common import get_state_as_dict
class tdf115026(UITestCase):
def test_pageBreak_and_tableAutoFormat(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.xUITest.executeCommand(".uno:InsertPagebreak")
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+ self.xUITest.executeCommand(".uno:InsertPagebreak")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
+ xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/table/tdf116737.py b/sw/qa/uitest/table/tdf116737.py
index cc285d993ebd..139fcea3a812 100644
--- a/sw/qa/uitest/table/tdf116737.py
+++ b/sw/qa/uitest/table/tdf116737.py
@@ -13,39 +13,40 @@ from uitest.uihelper.common import select_pos
class tdf116737(UITestCase):
def test_tdf116737_select_table_style(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
-
- #Insert => Insert Table / It's not possible to select a table style
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
-
- formatlbinstable = xDialog.getChild("formatlbinstable")
- entry = formatlbinstable.getChild("11") #Simple List Shaded
- entry.executeAction("SELECT", tuple())
-
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- #verify .uno:TableDialog
- self.ui_test.execute_dialog_through_command(".uno:TableDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4") #tab Background
-
- btncolor = xDialog.getChild("btncolor")
- btncolor.executeAction("CLICK", tuple())
-
- R_custom = xDialog.getChild("R_custom")
- G_custom = xDialog.getChild("G_custom")
- B_custom = xDialog.getChild("B_custom")
- #"Simple List Shaded" -> header should be black
- self.assertEqual(get_state_as_dict(R_custom)["Text"], "0")
- self.assertEqual(get_state_as_dict(G_custom)["Text"], "0")
- self.assertEqual(get_state_as_dict(B_custom)["Text"], "0")
-
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+
+ #Insert => Insert Table / It's not possible to select a table style
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ formatlbinstable = xDialog.getChild("formatlbinstable")
+ entry = formatlbinstable.getChild("11") #Simple List Shaded
+ entry.executeAction("SELECT", tuple())
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ #verify .uno:TableDialog
+ self.ui_test.execute_dialog_through_command(".uno:TableDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4") #tab Background
+
+ btncolor = xDialog.getChild("btncolor")
+ btncolor.executeAction("CLICK", tuple())
+
+ R_custom = xDialog.getChild("R_custom")
+ G_custom = xDialog.getChild("G_custom")
+ B_custom = xDialog.getChild("B_custom")
+ #"Simple List Shaded" -> header should be black
+ self.assertEqual(get_state_as_dict(R_custom)["Text"], "0")
+ self.assertEqual(get_state_as_dict(G_custom)["Text"], "0")
+ self.assertEqual(get_state_as_dict(B_custom)["Text"], "0")
+
+ 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/sw/qa/uitest/table/tdf128593.py b/sw/qa/uitest/table/tdf128593.py
index c631fa87db16..3306a58d2b09 100755
--- a/sw/qa/uitest/table/tdf128593.py
+++ b/sw/qa/uitest/table/tdf128593.py
@@ -9,28 +9,30 @@ from uitest.uihelper.common import get_state_as_dict
class tdf128593(UITestCase):
def test_tdf128593_table_background_color(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- MainWindow = self.xUITest.getTopFocusWindow()
+ MainDoc = self.ui_test.create_doc_in_start_center("writer")
+ MainWindow = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- InsertTableDialog = self.xUITest.getTopFocusWindow()
- xok = InsertTableDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xok)
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ InsertTableDialog = self.xUITest.getTopFocusWindow()
+ xok = InsertTableDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xok)
- self.xUITest.executeCommandWithParameters(".uno:TableCellBackgroundColor", mkPropertyValues({"TableCellBackgroundColor" : 16776960 }) )
- self.ui_test.execute_dialog_through_command(".uno:TableDialog")
- writer_edit = MainWindow.getChild("writer_edit")
- writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "0"}))
- TablePropertiesDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = TablePropertiesDialog.getChild("tabcontrol")
- tabcontrol.executeAction("SELECT", mkPropertyValues({"POS": "4"}))
- Rcustom = TablePropertiesDialog.getChild("R_custom") #255
- self.assertEqual(get_state_as_dict(Rcustom)["Text"], "255")
- Gcustom = TablePropertiesDialog.getChild("G_custom") #255
- self.assertEqual(get_state_as_dict(Gcustom)["Text"], "255")
- Bcustom = TablePropertiesDialog.getChild("B_custom") #0
- self.assertEqual(get_state_as_dict(Bcustom)["Text"], "0")
- xok = TablePropertiesDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xok)
+ self.xUITest.executeCommandWithParameters(".uno:TableCellBackgroundColor", mkPropertyValues({"TableCellBackgroundColor" : 16776960 }) )
+ self.ui_test.execute_dialog_through_command(".uno:TableDialog")
+ writer_edit = MainWindow.getChild("writer_edit")
+ writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "0"}))
+ TablePropertiesDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = TablePropertiesDialog.getChild("tabcontrol")
+ tabcontrol.executeAction("SELECT", mkPropertyValues({"POS": "4"}))
+ Rcustom = TablePropertiesDialog.getChild("R_custom") #255
+ self.assertEqual(get_state_as_dict(Rcustom)["Text"], "255")
+ Gcustom = TablePropertiesDialog.getChild("G_custom") #255
+ self.assertEqual(get_state_as_dict(Gcustom)["Text"], "255")
+ Bcustom = TablePropertiesDialog.getChild("B_custom") #0
+ self.assertEqual(get_state_as_dict(Bcustom)["Text"], "0")
+ xok = TablePropertiesDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xok)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/table/textToTable.py b/sw/qa/uitest/table/textToTable.py
index c40f2a726d41..2b820b360653 100644
--- a/sw/qa/uitest/table/textToTable.py
+++ b/sw/qa/uitest/table/textToTable.py
@@ -12,28 +12,30 @@ from uitest.uihelper.common import get_url_for_data_file, type_text
class textToTable(UITestCase):
def test_text_to_table(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- #Enter A;B ; select the text ; dialog Text to table - Semicolon; verify
- type_text(xWriterEdit, "A;B;C")
- xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "5"}))
- self.ui_test.execute_dialog_through_command(".uno:ConvertTextToTable")
- xDialog = self.xUITest.getTopFocusWindow()
- semicolons = xDialog.getChild("semicolons")
- semicolons.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.assertEqual(document.TextTables.getCount(), 1)
- tables = document.getTextTables()
- self.assertEqual(len(tables[0].getRows()), 1)
- self.assertEqual(len(tables[0].getColumns()), 3)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.TextTables.getCount(), 0)
- self.assertEqual(document.Text.String[0:5], "A;B;C")
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ #Enter A;B ; select the text ; dialog Text to table - Semicolon; verify
+ type_text(xWriterEdit, "A;B;C")
+ xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "5"}))
+ self.ui_test.execute_dialog_through_command(".uno:ConvertTextToTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ semicolons = xDialog.getChild("semicolons")
+ semicolons.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.assertEqual(document.TextTables.getCount(), 1)
+ tables = document.getTextTables()
+ self.assertEqual(len(tables[0].getRows()), 1)
+ self.assertEqual(len(tables[0].getColumns()), 3)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.TextTables.getCount(), 0)
+ self.assertEqual(document.Text.String[0:5], "A;B;C")
+
+ self.ui_test.close_doc()
def test_text_to_table_header(self):
with self.ui_test.load_file(get_url_for_data_file("textToTable.odt")) as writer_doc:
diff --git a/sw/qa/uitest/ui/fmtui/fmtui.py b/sw/qa/uitest/ui/fmtui/fmtui.py
index caf03a1af7b7..36e00c95a479 100644
--- a/sw/qa/uitest/ui/fmtui/fmtui.py
+++ b/sw/qa/uitest/ui/fmtui/fmtui.py
@@ -15,22 +15,23 @@ class TestTmpdlg(UITestCase):
def test_para_style_semi_transparent_text(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:EditStyle")
- xDialog = self.xUITest.getTopFocusWindow()
-
- 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 control was hidden in the paragraph style dialog.
- self.assertEqual(get_state_as_dict(xFontTransparency)["Visible"], "true")
-
- xCancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ self.ui_test.execute_dialog_through_command(".uno:EditStyle")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ 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 control was hidden in the paragraph style dialog.
+ self.assertEqual(get_state_as_dict(xFontTransparency)["Visible"], "true")
+
+ xCancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/ui/index/index.py b/sw/qa/uitest/ui/index/index.py
index 172589392e4d..71d9e165bbaf 100644
--- a/sw/qa/uitest/ui/index/index.py
+++ b/sw/qa/uitest/ui/index/index.py
@@ -17,40 +17,41 @@ class TestSwuiidxmrk(UITestCase):
def test_bibliography_page_number_insert(self):
# Given an empty Writer document:
- with self.ui_test.create_doc_in_start_center("writer"):
-
- self.ui_test.execute_modeless_dialog_through_command(".uno:InsertAuthoritiesEntry")
- insert_entry = self.xUITest.getTopFocusWindow()
- from_document = insert_entry.getChild("fromdocument")
- from_document.executeAction("CLICK", tuple())
- new = insert_entry.getChild("new")
-
- # When inserting a biblio entry field with a page number:
- with self.ui_test.execute_blocking_action(new.executeAction, args=('CLICK', ())) as define_entry:
- entry = define_entry.getChild("entry")
- type_text(entry, "aaa")
- listbox = define_entry.getChild("listbox")
- select_pos(listbox, "16") # WWW document
- pagecb = define_entry.getChild("pagecb-visible")
- pagecb.executeAction("CLICK", tuple())
-
- insert = insert_entry.getChild("insert")
- insert.executeAction("CLICK", tuple())
- close = insert_entry.getChild("close")
- self.ui_test.close_dialog_through_button(close)
-
- # Then make sure the URL contains that page number:
- component = self.ui_test.get_component()
- paragraphs = component.Text.createEnumeration()
- paragraph = paragraphs.nextElement()
- portions = paragraph.createEnumeration()
- portion = portions.nextElement()
- for field in portion.TextField.Fields:
- if field.Name != "URL":
- continue
- # Without the accompanying fix in place, this test would have failed with:
- # AssertionError: '' != '#page=1'
- # i.e. the page number was not part of the URL.
- self.assertEqual(field.Value, "#page=1")
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:InsertAuthoritiesEntry")
+ insert_entry = self.xUITest.getTopFocusWindow()
+ from_document = insert_entry.getChild("fromdocument")
+ from_document.executeAction("CLICK", tuple())
+ new = insert_entry.getChild("new")
+
+ # When inserting a biblio entry field with a page number:
+ with self.ui_test.execute_blocking_action(new.executeAction, args=('CLICK', ())) as define_entry:
+ entry = define_entry.getChild("entry")
+ type_text(entry, "aaa")
+ listbox = define_entry.getChild("listbox")
+ select_pos(listbox, "16") # WWW document
+ pagecb = define_entry.getChild("pagecb-visible")
+ pagecb.executeAction("CLICK", tuple())
+
+ insert = insert_entry.getChild("insert")
+ insert.executeAction("CLICK", tuple())
+ close = insert_entry.getChild("close")
+ self.ui_test.close_dialog_through_button(close)
+
+ # Then make sure the URL contains that page number:
+ component = self.ui_test.get_component()
+ paragraphs = component.Text.createEnumeration()
+ paragraph = paragraphs.nextElement()
+ portions = paragraph.createEnumeration()
+ portion = portions.nextElement()
+ for field in portion.TextField.Fields:
+ if field.Name != "URL":
+ continue
+ # Without the accompanying fix in place, this test would have failed with:
+ # AssertionError: '' != '#page=1'
+ # i.e. the page number was not part of the URL.
+ self.assertEqual(field.Value, "#page=1")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/comments.py b/sw/qa/uitest/writer_tests/comments.py
index 273bbfcc1b51..66ecb06bb246 100644
--- a/sw/qa/uitest/writer_tests/comments.py
+++ b/sw/qa/uitest/writer_tests/comments.py
@@ -16,138 +16,142 @@ class Comments(UITestCase):
def test_comments_features(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ xMainDoc = self.ui_test.create_doc_in_start_center("writer")
- xMainWindow = self.xUITest.getTopFocusWindow()
+ xMainWindow = self.xUITest.getTopFocusWindow()
- xwriter_edit = xMainWindow.getChild("writer_edit")
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Before "}))
+ xwriter_edit = xMainWindow.getChild("writer_edit")
+ xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Before "}))
- # adding new Comment
- self.xUITest.executeCommand(".uno:InsertAnnotation")
+ # adding new Comment
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
- # wait until the comment is available
- xComment1 = self.ui_test.wait_until_child_is_available('Comment1')
+ # wait until the comment is available
+ xComment1 = self.ui_test.wait_until_child_is_available('Comment1')
- xEditView1 = xComment1.getChild("editview")
- xEditView1.executeAction("TYPE", mkPropertyValues({"TEXT": "This is the First Comment"}))
- self.assertEqual(get_state_as_dict(xComment1)["Text"], "This is the First Comment" )
- self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "false" )
- self.assertEqual(get_state_as_dict(xComment1)["Author"], "Unknown Author" )
- self.assertEqual(get_state_as_dict(xComment1)["ReadOnly"], "false" )
+ xEditView1 = xComment1.getChild("editview")
+ xEditView1.executeAction("TYPE", mkPropertyValues({"TEXT": "This is the First Comment"}))
+ self.assertEqual(get_state_as_dict(xComment1)["Text"], "This is the First Comment" )
+ self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "false" )
+ self.assertEqual(get_state_as_dict(xComment1)["Author"], "Unknown Author" )
+ self.assertEqual(get_state_as_dict(xComment1)["ReadOnly"], "false" )
- xComment1.executeAction("LEAVE", mkPropertyValues({}))
+ xComment1.executeAction("LEAVE", mkPropertyValues({}))
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "After"}))
- xwriter_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "13"}))
- self.assertEqual(get_state_as_dict(xwriter_edit)["SelectedText"], "Before After" )
+ xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "After"}))
+ xwriter_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "13"}))
+ self.assertEqual(get_state_as_dict(xwriter_edit)["SelectedText"], "Before After" )
- # test Resolve Comment
- xComment1.executeAction("RESOLVE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "true" )
+ # test Resolve Comment
+ xComment1.executeAction("RESOLVE", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "true" )
- # test Select text from Comment
- xComment1.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "4"}))
- self.assertEqual(get_state_as_dict(xComment1)["SelectedText"], "This" )
+ # test Select text from Comment
+ xComment1.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "4"}))
+ self.assertEqual(get_state_as_dict(xComment1)["SelectedText"], "This" )
- # test Hide then Show Comment
- xComment1.executeAction("HIDE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment1)["Visible"], "false" )
- xComment1.executeAction("SHOW", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment1)["Visible"], "true" )
+ # test Hide then Show Comment
+ xComment1.executeAction("HIDE", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(xComment1)["Visible"], "false" )
+ xComment1.executeAction("SHOW", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(xComment1)["Visible"], "true" )
- # test delete Comment
- xComment1.executeAction("DELETE", mkPropertyValues({}))
- self.assertTrue("Comment1" not in xMainWindow.getChildren())
+ # test delete Comment
+ xComment1.executeAction("DELETE", mkPropertyValues({}))
+ self.assertTrue("Comment1" not in xMainWindow.getChildren())
+
+ self.ui_test.close_doc()
def test_multi_comments(self):
- with self.ui_test.create_doc_in_start_center("writer"):
-
- xMainWindow = self.xUITest.getTopFocusWindow()
-
- xwriter_edit = xMainWindow.getChild("writer_edit")
-
- # adding 3 new Comment
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 1"}))
- self.xUITest.executeCommand(".uno:InsertAnnotation")
- # wait until the comment is available
- xComment1 = self.ui_test.wait_until_child_is_available('Comment1')
- xEditView1 = xComment1.getChild("editview")
- xEditView1.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
- xComment1.executeAction("LEAVE", mkPropertyValues({}))
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
-
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 2"}))
- self.xUITest.executeCommand(".uno:InsertAnnotation")
- # wait until the comment is available
- xComment2 = self.ui_test.wait_until_child_is_available('Comment2')
- xEditView2 = xComment2.getChild("editview")
- xEditView2.executeAction("TYPE", mkPropertyValues({"TEXT": "Second Comment"}))
- xComment2.executeAction("LEAVE", mkPropertyValues({}))
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
-
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 3"}))
- self.xUITest.executeCommand(".uno:InsertAnnotation")
- # wait until the comment is available
- xComment3 = self.ui_test.wait_until_child_is_available('Comment3')
- xEditView3 = xComment3.getChild("editview")
- xEditView3.executeAction("TYPE", mkPropertyValues({"TEXT": "Third Comment"}))
- xComment3.executeAction("LEAVE", mkPropertyValues({}))
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
-
- # Check text
- self.assertEqual(get_state_as_dict(xComment1)["Text"], "First Comment" )
- self.assertEqual(get_state_as_dict(xComment2)["Text"], "Second Comment" )
- self.assertEqual(get_state_as_dict(xComment3)["Text"], "Third Comment" )
-
- xComment2.executeAction("RESOLVE", mkPropertyValues({}))
- xComment3.executeAction("RESOLVE", mkPropertyValues({}))
-
- # Check Resolved
- self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "false" )
- self.assertEqual(get_state_as_dict(xComment2)["Resolved"], "true" )
- self.assertEqual(get_state_as_dict(xComment3)["Resolved"], "true" )
-
- # Check ReadOnly
- self.assertEqual(get_state_as_dict(xComment1)["ReadOnly"], "false" )
- self.assertEqual(get_state_as_dict(xComment2)["ReadOnly"], "false" )
- self.assertEqual(get_state_as_dict(xComment3)["ReadOnly"], "false" )
-
- # Check Select
- xComment1.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "5"}))
- self.assertEqual(get_state_as_dict(xComment1)["SelectedText"], "First" )
-
- xComment2.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "6"}))
- self.assertEqual(get_state_as_dict(xComment2)["SelectedText"], "Second" )
-
- xComment3.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "5"}))
- self.assertEqual(get_state_as_dict(xComment3)["SelectedText"], "Third" )
-
- # Check that they all are Visible
- self.assertEqual(get_state_as_dict(xComment1)["Visible"], "true" )
- self.assertEqual(get_state_as_dict(xComment2)["Visible"], "true" )
- self.assertEqual(get_state_as_dict(xComment3)["Visible"], "true" )
-
- # Hide all
- xComment1.executeAction("HIDE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment1)["Visible"], "false" )
- xComment2.executeAction("HIDE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment2)["Visible"], "false" )
- xComment3.executeAction("HIDE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment3)["Visible"], "false" )
-
- # Show comment 2 only
- xComment2.executeAction("SHOW", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment2)["Visible"], "true" )
-
- # Then remove the 3 comments
- xComment1.executeAction("DELETE", mkPropertyValues({}))
- xComment2.executeAction("DELETE", mkPropertyValues({}))
- xComment3.executeAction("DELETE", mkPropertyValues({}))
- self.assertTrue("Comment1" not in xMainWindow.getChildren())
- self.assertTrue("Comment2" not in xMainWindow.getChildren())
- self.assertTrue("Comment3" not in xMainWindow.getChildren())
+ xMainDoc = self.ui_test.create_doc_in_start_center("writer")
+
+ xMainWindow = self.xUITest.getTopFocusWindow()
+
+ xwriter_edit = xMainWindow.getChild("writer_edit")
+
+ # adding 3 new Comment
+ xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 1"}))
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ # wait until the comment is available
+ xComment1 = self.ui_test.wait_until_child_is_available('Comment1')
+ xEditView1 = xComment1.getChild("editview")
+ xEditView1.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
+ xComment1.executeAction("LEAVE", mkPropertyValues({}))
+ xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+
+ xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 2"}))
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ # wait until the comment is available
+ xComment2 = self.ui_test.wait_until_child_is_available('Comment2')
+ xEditView2 = xComment2.getChild("editview")
+ xEditView2.executeAction("TYPE", mkPropertyValues({"TEXT": "Second Comment"}))
+ xComment2.executeAction("LEAVE", mkPropertyValues({}))
+ xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+
+ xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 3"}))
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ # wait until the comment is available
+ xComment3 = self.ui_test.wait_until_child_is_available('Comment3')
+ xEditView3 = xComment3.getChild("editview")
+ xEditView3.executeAction("TYPE", mkPropertyValues({"TEXT": "Third Comment"}))
+ xComment3.executeAction("LEAVE", mkPropertyValues({}))
+ xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+
+ # Check text
+ self.assertEqual(get_state_as_dict(xComment1)["Text"], "First Comment" )
+ self.assertEqual(get_state_as_dict(xComment2)["Text"], "Second Comment" )
+ self.assertEqual(get_state_as_dict(xComment3)["Text"], "Third Comment" )
+
+ xComment2.executeAction("RESOLVE", mkPropertyValues({}))
+ xComment3.executeAction("RESOLVE", mkPropertyValues({}))
+
+ # Check Resolved
+ self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "false" )
+ self.assertEqual(get_state_as_dict(xComment2)["Resolved"], "true" )
+ self.assertEqual(get_state_as_dict(xComment3)["Resolved"], "true" )
+
+ # Check ReadOnly
+ self.assertEqual(get_state_as_dict(xComment1)["ReadOnly"], "false" )
+ self.assertEqual(get_state_as_dict(xComment2)["ReadOnly"], "false" )
+ self.assertEqual(get_state_as_dict(xComment3)["ReadOnly"], "false" )
+
+ # Check Select
+ xComment1.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "5"}))
+ self.assertEqual(get_state_as_dict(xComment1)["SelectedText"], "First" )
+
+ xComment2.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "6"}))
+ self.assertEqual(get_state_as_dict(xComment2)["SelectedText"], "Second" )
+
+ xComment3.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "5"}))
+ self.assertEqual(get_state_as_dict(xComment3)["SelectedText"], "Third" )
+
+ # Check that they all are Visible
+ self.assertEqual(get_state_as_dict(xComment1)["Visible"], "true" )
+ self.assertEqual(get_state_as_dict(xComment2)["Visible"], "true" )
+ self.assertEqual(get_state_as_dict(xComment3)["Visible"], "true" )
+
+ # Hide all
+ xComment1.executeAction("HIDE", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(xComment1)["Visible"], "false" )
+ xComment2.executeAction("HIDE", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(xComment2)["Visible"], "false" )
+ xComment3.executeAction("HIDE", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(xComment3)["Visible"], "false" )
+
+ # Show comment 2 only
+ xComment2.executeAction("SHOW", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(xComment2)["Visible"], "true" )
+
+ # Then remove the 3 comments
+ xComment1.executeAction("DELETE", mkPropertyValues({}))
+ xComment2.executeAction("DELETE", mkPropertyValues({}))
+ xComment3.executeAction("DELETE", mkPropertyValues({}))
+ self.assertTrue("Comment1" not in xMainWindow.getChildren())
+ self.assertTrue("Comment2" not in xMainWindow.getChildren())
+ self.assertTrue("Comment3" not in xMainWindow.getChildren())
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/insertCaption.py b/sw/qa/uitest/writer_tests/insertCaption.py
index fa6223494bfb..57f6273875db 100644
--- a/sw/qa/uitest/writer_tests/insertCaption.py
+++ b/sw/qa/uitest/writer_tests/insertCaption.py
@@ -11,61 +11,63 @@ from uitest.uihelper.common import select_pos
class insertCaption(UITestCase):
def test_insert_caption(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:InsertFrame") # insert frame
- xDialogFr = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ self.ui_test.execute_dialog_through_command(".uno:InsertFrame") # insert frame
+ xDialogFr = self.xUITest.getTopFocusWindow()
- xWidth = xDialogFr.getChild("width")
- xWidth.executeAction("UP", tuple())
- xWidth.executeAction("UP", tuple())
+ xWidth = xDialogFr.getChild("width")
+ xWidth.executeAction("UP", tuple())
+ xWidth.executeAction("UP", tuple())
- xHeight = xDialogFr.getChild("height")
- xHeight.executeAction("UP", tuple())
- xHeight.executeAction("UP", tuple())
+ xHeight = xDialogFr.getChild("height")
+ xHeight.executeAction("UP", tuple())
+ xHeight.executeAction("UP", tuple())
- xOkBtn=xDialogFr.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn=xDialogFr.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.TextFrames.getCount(), 1)
+ self.assertEqual(document.TextFrames.getCount(), 1)
- self.ui_test.execute_dialog_through_command(".uno:InsertCaptionDialog") # caption
- xDialogCaption = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:InsertCaptionDialog") # caption
+ xDialogCaption = self.xUITest.getTopFocusWindow()
- xCapt = xDialogCaption.getChild("caption_edit")
- xCapt.executeAction("TYPE", mkPropertyValues({"TEXT":"Caption"}))
+ xCapt = xDialogCaption.getChild("caption_edit")
+ xCapt.executeAction("TYPE", mkPropertyValues({"TEXT":"Caption"}))
- xOkBtn=xDialogCaption.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn=xDialogCaption.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xFrame = document.TextFrames[0]
+ xFrame = document.TextFrames[0]
- self.assertEqual(document.TextFrames[0].Text.String.replace('\r\n', '\n'), "\nText 1: Caption")
+ self.assertEqual(document.TextFrames[0].Text.String.replace('\r\n', '\n'), "\nText 1: Caption")
- self.ui_test.execute_dialog_through_command(".uno:InsertCaptionDialog") # 2nd caption
- xDialogCaption = self.xUITest.getTopFocusWindow()
- xCapt = xDialogCaption.getChild("caption_edit")
- xCapt.executeAction("TYPE", mkPropertyValues({"TEXT":"Caption2"}))
- xSep = xDialogCaption.getChild("separator_edit")
- xSep.executeAction("TYPE", mkPropertyValues({"TEXT":"-"}))
+ self.ui_test.execute_dialog_through_command(".uno:InsertCaptionDialog") # 2nd caption
+ xDialogCaption = self.xUITest.getTopFocusWindow()
+ xCapt = xDialogCaption.getChild("caption_edit")
+ xCapt.executeAction("TYPE", mkPropertyValues({"TEXT":"Caption2"}))
+ xSep = xDialogCaption.getChild("separator_edit")
+ xSep.executeAction("TYPE", mkPropertyValues({"TEXT":"-"}))
- xOkBtn=xDialogCaption.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn=xDialogCaption.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.TextFrames[0].Text.String.replace('\r\n', '\n'), "\nText 1: Caption\nText 2-: Caption2")
+ self.assertEqual(document.TextFrames[0].Text.String.replace('\r\n', '\n'), "\nText 1: Caption\nText 2-: Caption2")
- self.ui_test.execute_dialog_through_command(".uno:InsertCaptionDialog") # 3. caption
- xDialogCaption = self.xUITest.getTopFocusWindow()
- xCapt = xDialogCaption.getChild("caption_edit")
- xCapt.executeAction("TYPE", mkPropertyValues({"TEXT":"Caption3"}))
- xSep = xDialogCaption.getChild("separator_edit")
- xSep.executeAction("TYPE", mkPropertyValues({"TEXT":"-"}))
- xPos = xDialogCaption.getChild("position")
- select_pos(xPos, "1")
+ self.ui_test.execute_dialog_through_command(".uno:InsertCaptionDialog") # 3. caption
+ xDialogCaption = self.xUITest.getTopFocusWindow()
+ xCapt = xDialogCaption.getChild("caption_edit")
+ xCapt.executeAction("TYPE", mkPropertyValues({"TEXT":"Caption3"}))
+ xSep = xDialogCaption.getChild("separator_edit")
+ xSep.executeAction("TYPE", mkPropertyValues({"TEXT":"-"}))
+ xPos = xDialogCaption.getChild("position")
+ select_pos(xPos, "1")
- xOkBtn=xDialogCaption.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn=xDialogCaption.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.TextFrames[0].Text.String.replace('\r\n', '\n'), "\nText 1: Caption\nText 2-: Caption2\nText 3--: Caption3")
+ self.assertEqual(document.TextFrames[0].Text.String.replace('\r\n', '\n'), "\nText 1: Caption\nText 2-: Caption2\nText 3--: Caption3")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/tdf134734.py b/sw/qa/uitest/writer_tests/tdf134734.py
index fcef99a43bcb..5685f00a55a9 100644
--- a/sw/qa/uitest/writer_tests/tdf134734.py
+++ b/sw/qa/uitest/writer_tests/tdf134734.py
@@ -13,78 +13,80 @@ import importlib
class TestClass(UITestCase):
def test_master_page_background(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
- # set margins and fill color
- self.ui_test.execute_dialog_through_command(".uno:PageDialog")
- DrawPageDialog = self.xUITest.getTopFocusWindow()
- xTabs = DrawPageDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- checkBackgroundFullSize = DrawPageDialog.getChild("checkBackgroundFullSize")
- self.assertEqual(get_state_as_dict(checkBackgroundFullSize)["Selected"], "true")
- spinMargLeft = DrawPageDialog.getChild("spinMargLeft")
- for _ in range(20):
- spinMargLeft.executeAction("UP",tuple())
- spinMargRight = DrawPageDialog.getChild("spinMargRight")
- for _ in range(15):
- spinMargRight.executeAction("UP",tuple())
- spinMargTop = DrawPageDialog.getChild("spinMargTop")
- for _ in range(10):
- spinMargTop.executeAction("UP",tuple())
- spinMargBot = DrawPageDialog.getChild("spinMargBot")
- for _ in range(5):
- spinMargBot.executeAction("UP",tuple())
- xTabs = DrawPageDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
- btncolor = DrawPageDialog.getChild("btncolor")
- btncolor.executeAction("CLICK",tuple())
- ok = DrawPageDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(ok)
+ # set margins and fill color
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ DrawPageDialog = self.xUITest.getTopFocusWindow()
+ xTabs = DrawPageDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ checkBackgroundFullSize = DrawPageDialog.getChild("checkBackgroundFullSize")
+ self.assertEqual(get_state_as_dict(checkBackgroundFullSize)["Selected"], "true")
+ spinMargLeft = DrawPageDialog.getChild("spinMargLeft")
+ for _ in range(20):
+ spinMargLeft.executeAction("UP",tuple())
+ spinMargRight = DrawPageDialog.getChild("spinMargRight")
+ for _ in range(15):
+ spinMargRight.executeAction("UP",tuple())
+ spinMargTop = DrawPageDialog.getChild("spinMargTop")
+ for _ in range(10):
+ spinMargTop.executeAction("UP",tuple())
+ spinMargBot = DrawPageDialog.getChild("spinMargBot")
+ for _ in range(5):
+ spinMargBot.executeAction("UP",tuple())
+ xTabs = DrawPageDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+ btncolor = DrawPageDialog.getChild("btncolor")
+ btncolor.executeAction("CLICK",tuple())
+ ok = DrawPageDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(ok)
- xStyle = document.StyleFamilies["PageStyles"]["Standard"]
+ xStyle = document.StyleFamilies["PageStyles"]["Standard"]
- self.assertEqual(xStyle.FillStyle, SOLID)
- self.assertEqual(xStyle.LeftMargin, 2997)
- self.assertEqual(xStyle.RightMargin, 2743)
- self.assertEqual(xStyle.TopMargin, 2489)
- self.assertEqual(xStyle.BottomMargin, 2235)
- self.assertEqual(xStyle.BackgroundFullSize, True)
+ self.assertEqual(xStyle.FillStyle, SOLID)
+ self.assertEqual(xStyle.LeftMargin, 2997)
+ self.assertEqual(xStyle.RightMargin, 2743)
+ self.assertEqual(xStyle.TopMargin, 2489)
+ self.assertEqual(xStyle.BottomMargin, 2235)
+ self.assertEqual(xStyle.BackgroundFullSize, True)
- # uncheck it
- self.ui_test.execute_dialog_through_command(".uno:PageDialog")
- DrawPageDialog = self.xUITest.getTopFocusWindow()
- xTabs = DrawPageDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- checkBackgroundFullSize = DrawPageDialog.getChild("checkBackgroundFullSize")
- self.assertEqual(get_state_as_dict(checkBackgroundFullSize)["Selected"], "true")
- checkBackgroundFullSize.executeAction("CLICK",tuple())
- ok = DrawPageDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(ok)
+ # uncheck it
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ DrawPageDialog = self.xUITest.getTopFocusWindow()
+ xTabs = DrawPageDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ checkBackgroundFullSize = DrawPageDialog.getChild("checkBackgroundFullSize")
+ self.assertEqual(get_state_as_dict(checkBackgroundFullSize)["Selected"], "true")
+ checkBackgroundFullSize.executeAction("CLICK",tuple())
+ ok = DrawPageDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(ok)
- self.assertEqual(xStyle.FillStyle, SOLID)
- self.assertEqual(xStyle.LeftMargin, 2997)
- self.assertEqual(xStyle.RightMargin, 2743)
- self.assertEqual(xStyle.TopMargin, 2489)
- self.assertEqual(xStyle.BottomMargin, 2235)
- self.assertEqual(xStyle.BackgroundFullSize, False)
+ self.assertEqual(xStyle.FillStyle, SOLID)
+ self.assertEqual(xStyle.LeftMargin, 2997)
+ self.assertEqual(xStyle.RightMargin, 2743)
+ self.assertEqual(xStyle.TopMargin, 2489)
+ self.assertEqual(xStyle.BottomMargin, 2235)
+ self.assertEqual(xStyle.BackgroundFullSize, False)
- # check it again
- self.ui_test.execute_dialog_through_command(".uno:PageDialog")
- DrawPageDialog = self.xUITest.getTopFocusWindow()
- xTabs = DrawPageDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- checkBackgroundFullSize = DrawPageDialog.getChild("checkBackgroundFullSize")
- self.assertEqual(get_state_as_dict(checkBackgroundFullSize)["Selected"], "false")
- checkBackgroundFullSize.executeAction("CLICK",tuple())
- ok = DrawPageDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(ok)
+ # check it again
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ DrawPageDialog = self.xUITest.getTopFocusWindow()
+ xTabs = DrawPageDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ checkBackgroundFullSize = DrawPageDialog.getChild("checkBackgroundFullSize")
+ self.assertEqual(get_state_as_dict(checkBackgroundFullSize)["Selected"], "false")
+ checkBackgroundFullSize.executeAction("CLICK",tuple())
+ ok = DrawPageDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(ok)
- self.assertEqual(xStyle.FillStyle, SOLID)
- self.assertEqual(xStyle.LeftMargin, 2997)
- self.assertEqual(xStyle.RightMargin, 2743)
- self.assertEqual(xStyle.TopMargin, 2489)
- self.assertEqual(xStyle.BottomMargin, 2235)
- self.assertEqual(xStyle.BackgroundFullSize, True)
+ self.assertEqual(xStyle.FillStyle, SOLID)
+ self.assertEqual(xStyle.LeftMargin, 2997)
+ self.assertEqual(xStyle.RightMargin, 2743)
+ self.assertEqual(xStyle.TopMargin, 2489)
+ self.assertEqual(xStyle.BottomMargin, 2235)
+ self.assertEqual(xStyle.BackgroundFullSize, True)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py b/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py
index 989485eb100d..9adbd2047d37 100644
--- a/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py
+++ b/sw/qa/uitest/writer_tests/tdf137459_editeng_ctrl-DEL.py
@@ -15,19 +15,21 @@ class tdf137459(UITestCase):
def test_tdf137459(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ xMainDoc = self.ui_test.create_doc_in_start_center("writer")
- # adding new Comment
- self.xUITest.executeCommand(".uno:InsertAnnotation")
- # wait until the comment is available
- xComment1 = self.ui_test.wait_until_child_is_available('Comment1')
+ # adding new Comment
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ # wait until the comment is available
+ xComment1 = self.ui_test.wait_until_child_is_available('Comment1')
- xEditView1 = xComment1.getChild("editview")
- sText = "Ctrl+Del should not delete BACKWARDS"
- xEditView1.executeAction("TYPE", mkPropertyValues({"TEXT": sText}))
- self.assertEqual(get_state_as_dict(xComment1)["Text"], sText )
+ xEditView1 = xComment1.getChild("editview")
+ sText = "Ctrl+Del should not delete BACKWARDS"
+ xEditView1.executeAction("TYPE", mkPropertyValues({"TEXT": sText}))
+ self.assertEqual(get_state_as_dict(xComment1)["Text"], sText )
- xEditView1.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+DELETE"}))
- self.assertEqual(get_state_as_dict(xComment1)["Text"], sText )
+ xEditView1.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+DELETE"}))
+ self.assertEqual(get_state_as_dict(xComment1)["Text"], sText )
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/tdf53460.py b/sw/qa/uitest/writer_tests/tdf53460.py
index 4bedf40c2303..7f4b57416e6f 100644
--- a/sw/qa/uitest/writer_tests/tdf53460.py
+++ b/sw/qa/uitest/writer_tests/tdf53460.py
@@ -12,65 +12,66 @@ class tdf53460(UITestCase):
def test_resize_table_with_keyboard_tdf53460(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- document = self.ui_test.get_component()
- #-insert a table (by default 2x2)
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ document = self.ui_test.get_component()
+ #-insert a table (by default 2x2)
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- #-put the cursor inside first cell top left for example
- #-insert an inner table (by default 2x2) inside this cell
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- #-still in top left cell, go to the line after the inner table
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- #- <ALT>+up key => crash
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
+ #-put the cursor inside first cell top left for example
+ #-insert an inner table (by default 2x2) inside this cell
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ #-still in top left cell, go to the line after the inner table
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ #- <ALT>+up key => crash
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
- self.assertEqual(document.TextTables.getCount(), 2)
+ self.assertEqual(document.TextTables.getCount(), 2)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/tdf78068.py b/sw/qa/uitest/writer_tests/tdf78068.py
index 89a10ced4ea2..1989722a3b1f 100644
--- a/sw/qa/uitest/writer_tests/tdf78068.py
+++ b/sw/qa/uitest/writer_tests/tdf78068.py
@@ -12,20 +12,21 @@ from uitest.uihelper.common import select_pos
class tdf78068(UITestCase):
def test_tdf78068_format_paragraph_crash(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- #- add some text
- type_text(xWriterEdit, "Test")
- #- go to Format > Paragraph
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple()) #close dialog
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ #- add some text
+ type_text(xWriterEdit, "Test")
+ #- go to Format > Paragraph
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple()) #close dialog
- self.assertEqual(document.Text.String[0:4], "Test")
+ self.assertEqual(document.Text.String[0:4], "Test")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/tdf93068.py b/sw/qa/uitest/writer_tests/tdf93068.py
index 66d9ff51383f..a77b4e42da91 100644
--- a/sw/qa/uitest/writer_tests/tdf93068.py
+++ b/sw/qa/uitest/writer_tests/tdf93068.py
@@ -10,49 +10,50 @@ class tdf93068(UITestCase):
def test_tdf93068(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- self.xUITest.getTopFocusWindow()
+ self.xUITest.getTopFocusWindow()
- # tdf#135950: Character dialog crashes if multiple cells in a
- # table are selected
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
+ # tdf#135950: Character dialog crashes if multiple cells in a
+ # table are selected
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:SelectAll")
- # Check the table is selected
- self.assertEqual("SwXTextTableCursor", document.CurrentSelection.getImplementationName())
+ # Check the table is selected
+ self.assertEqual("SwXTextTableCursor", document.CurrentSelection.getImplementationName())
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xFontDlg = self.xUITest.getTopFocusWindow()
- xOKBtn = xFontDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xFontDlg = self.xUITest.getTopFocusWindow()
+ xOKBtn = xFontDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xFontDlg = self.xUITest.getTopFocusWindow()
- xCancBtn = xFontDlg.getChild("cancel")
- xCancBtn.executeAction("CLICK", tuple())
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xFontDlg = self.xUITest.getTopFocusWindow()
+ xCancBtn = xFontDlg.getChild("cancel")
+ xCancBtn.executeAction("CLICK", tuple())
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xFontDlg = self.xUITest.getTopFocusWindow()
- xDiscardBtn = xFontDlg.getChild("reset")
- xDiscardBtn.executeAction("CLICK", tuple())
- xOKBtn = xFontDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xFontDlg = self.xUITest.getTopFocusWindow()
+ xDiscardBtn = xFontDlg.getChild("reset")
+ xDiscardBtn.executeAction("CLICK", tuple())
+ xOKBtn = xFontDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.xUITest.getTopFocusWindow()
+ self.xUITest.getTopFocusWindow()
- # Check the table is still selected after closing the dialog
- self.assertEqual("SwXTextTableCursor", document.CurrentSelection.getImplementationName())
+ # Check the table is still selected after closing the dialog
+ self.assertEqual("SwXTextTableCursor", document.CurrentSelection.getImplementationName())
- self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
- # Check the table is no longer selected
- self.assertNotEqual("SwXTextTableCursor", document.CurrentSelection.getImplementationName())
+ # Check the table is no longer selected
+ self.assertNotEqual("SwXTextTableCursor", document.CurrentSelection.getImplementationName())
+ self.ui_test.close_doc()
diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py
index faa8657e4f52..366954d76d16 100644
--- a/sw/qa/uitest/writer_tests/trackedChanges.py
+++ b/sw/qa/uitest/writer_tests/trackedChanges.py
@@ -12,135 +12,143 @@ class trackedchanges(UITestCase):
def test_tdf91270(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "Test")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ type_text(xWriterEdit, "Test")
- self.xUITest.executeCommand(".uno:TrackChanges")
+ self.xUITest.executeCommand(".uno:TrackChanges")
- selection = self.xUITest.executeCommand(".uno:SelectAll") #select whole text
- self.xUITest.executeCommand(".uno:Cut") #cut text
+ selection = self.xUITest.executeCommand(".uno:SelectAll") #select whole text
+ self.xUITest.executeCommand(".uno:Cut") #cut text
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
+
+ self.ui_test.close_doc()
def test_tracked_changes_accept(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.xUITest.executeCommand(".uno:TrackChanges")
- type_text(xWriterEdit, "Test LibreOffice")
- self.xUITest.executeCommand(".uno:ShowTrackedChanges")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ type_text(xWriterEdit, "Test LibreOffice")
+ self.xUITest.executeCommand(".uno:ShowTrackedChanges")
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
- xAccBtn = xTrackDlg.getChild("accept")
- xAccBtn.executeAction("CLICK", tuple())
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
+ xAccBtn = xTrackDlg.getChild("accept")
+ xAccBtn.executeAction("CLICK", tuple())
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.Text.String[0:16], "Test LibreOffice")
+ self.assertEqual(document.Text.String[0:16], "Test LibreOffice")
+ self.ui_test.close_doc()
def test_tracked_changes_acceptall(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.xUITest.executeCommand(".uno:TrackChanges")
- type_text(xWriterEdit, "Test LibreOffice")
- self.xUITest.executeCommand(".uno:ShowTrackedChanges")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ type_text(xWriterEdit, "Test LibreOffice")
+ self.xUITest.executeCommand(".uno:ShowTrackedChanges")
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
- xAccBtn = xTrackDlg.getChild("acceptall")
- xAccBtn.executeAction("CLICK", tuple())
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
+ xAccBtn = xTrackDlg.getChild("acceptall")
+ xAccBtn.executeAction("CLICK", tuple())
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.Text.String[0:16], "Test LibreOffice")
+ self.assertEqual(document.Text.String[0:16], "Test LibreOffice")
+ self.ui_test.close_doc()
def test_tracked_changes_reject(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.xUITest.executeCommand(".uno:TrackChanges")
- type_text(xWriterEdit, "Test LibreOffice")
- self.xUITest.executeCommand(".uno:ShowTrackedChanges")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ type_text(xWriterEdit, "Test LibreOffice")
+ self.xUITest.executeCommand(".uno:ShowTrackedChanges")
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
- xRejBtn = xTrackDlg.getChild("reject")
- xRejBtn.executeAction("CLICK", tuple())
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
+ xRejBtn = xTrackDlg.getChild("reject")
+ xRejBtn.executeAction("CLICK", tuple())
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.Text.String[0:1], "")
+ self.assertEqual(document.Text.String[0:1], "")
+ self.ui_test.close_doc()
def test_tracked_changes_rejectall(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.xUITest.executeCommand(".uno:TrackChanges")
- type_text(xWriterEdit, "Test LibreOffice")
- self.xUITest.executeCommand(".uno:ShowTrackedChanges")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ type_text(xWriterEdit, "Test LibreOffice")
+ self.xUITest.executeCommand(".uno:ShowTrackedChanges")
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
- xAccBtn = xTrackDlg.getChild("rejectall")
- xAccBtn.executeAction("CLICK", tuple())
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
+ xAccBtn = xTrackDlg.getChild("rejectall")
+ xAccBtn.executeAction("CLICK", tuple())
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.Text.String[0:1], "")
+ self.assertEqual(document.Text.String[0:1], "")
+ self.ui_test.close_doc()
def test_tracked_changes_zprev_next(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
-
- self.xUITest.executeCommand(".uno:TrackChanges")
- type_text(xWriterEdit, "Test LibreOffice")
- self.xUITest.executeCommand(".uno:TrackChanges")
- type_text(xWriterEdit, " Test2")
- self.xUITest.executeCommand(".uno:TrackChanges")
- type_text(xWriterEdit, " Test3")
- self.xUITest.executeCommand(".uno:TrackChanges")
- type_text(xWriterEdit, " Test4")
- self.xUITest.executeCommand(".uno:TrackChanges")
- type_text(xWriterEdit, " Test5")
- self.xUITest.executeCommand(".uno:PreviousTrackedChange")
- self.xUITest.executeCommand(".uno:RejectTrackedChange")
- self.assertEqual(document.Text.String[0:37], "Test LibreOffice Test2 Test3 Test4")
-
- self.xUITest.executeCommand(".uno:PreviousTrackedChange")
- self.xUITest.executeCommand(".uno:PreviousTrackedChange")
- self.xUITest.executeCommand(".uno:AcceptTrackedChange")
- self.assertEqual(document.Text.String[0:37], "Test LibreOffice Test2 Test3 Test4")
-
- self.xUITest.executeCommand(".uno:NextTrackedChange")
- self.xUITest.executeCommand(".uno:RejectTrackedChange")
- self.assertEqual(document.Text.String[0:30], "Test LibreOffice Test2 Test4")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ type_text(xWriterEdit, "Test LibreOffice")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ type_text(xWriterEdit, " Test2")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ type_text(xWriterEdit, " Test3")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ type_text(xWriterEdit, " Test4")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ type_text(xWriterEdit, " Test5")
+ self.xUITest.executeCommand(".uno:PreviousTrackedChange")
+ self.xUITest.executeCommand(".uno:RejectTrackedChange")
+ self.assertEqual(document.Text.String[0:37], "Test LibreOffice Test2 Test3 Test4")
+
+ self.xUITest.executeCommand(".uno:PreviousTrackedChange")
+ self.xUITest.executeCommand(".uno:PreviousTrackedChange")
+ self.xUITest.executeCommand(".uno:AcceptTrackedChange")
+ self.assertEqual(document.Text.String[0:37], "Test LibreOffice Test2 Test3 Test4")
+
+ self.xUITest.executeCommand(".uno:NextTrackedChange")
+ self.xUITest.executeCommand(".uno:RejectTrackedChange")
+ self.assertEqual(document.Text.String[0:30], "Test LibreOffice Test2 Test4")
+
+ self.ui_test.close_doc()
def test_list_of_changes(self):
with self.ui_test.load_file(get_url_for_data_file("trackedChanges.odt")):
diff --git a/sw/qa/uitest/writer_tests/watermark.py b/sw/qa/uitest/writer_tests/watermark.py
index e9d98e5b4edf..3cf7c6fd84f6 100644
--- a/sw/qa/uitest/writer_tests/watermark.py
+++ b/sw/qa/uitest/writer_tests/watermark.py
@@ -12,51 +12,52 @@ from uitest.uihelper.common import get_state_as_dict
class watermark(UITestCase):
def test_insert_watermark(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:Watermark")
- xDialog = self.xUITest.getTopFocusWindow()
- xTextInput = xDialog.getChild("TextInput")
- xAngle = xDialog.getChild("Angle")
- xTransparency = xDialog.getChild("Transparency")
-
- xTextInput.executeAction("TYPE", mkPropertyValues({"TEXT":"Watermark"}))
- xAngle.executeAction("UP", tuple())
- xTransparency.executeAction("UP", tuple())
-
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- self.ui_test.execute_dialog_through_command(".uno:Watermark")
- xDialog = self.xUITest.getTopFocusWindow()
- xTextInput = xDialog.getChild("TextInput")
- xAngle = xDialog.getChild("Angle")
- xTransparency = xDialog.getChild("Transparency")
-
- self.assertEqual(get_state_as_dict(xTextInput)["Text"], "Watermark")
- self.assertEqual(get_state_as_dict(xAngle)["Text"], "90°")
- self.assertEqual(get_state_as_dict(xTransparency)["Text"], "51%")
-
- xCancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancBtn)
-
- self.ui_test.execute_dialog_through_command(".uno:Watermark")
- xDialog = self.xUITest.getTopFocusWindow()
- xTextInput = xDialog.getChild("TextInput")
- xTextInput.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xTextInput.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- self.ui_test.execute_dialog_through_command(".uno:Watermark")
- xDialog = self.xUITest.getTopFocusWindow()
- xTextInput = xDialog.getChild("TextInput")
-
- self.assertEqual(get_state_as_dict(xTextInput)["Text"], "")
-
- xCancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancBtn)
-
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:Watermark")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTextInput = xDialog.getChild("TextInput")
+ xAngle = xDialog.getChild("Angle")
+ xTransparency = xDialog.getChild("Transparency")
+
+ xTextInput.executeAction("TYPE", mkPropertyValues({"TEXT":"Watermark"}))
+ xAngle.executeAction("UP", tuple())
+ xTransparency.executeAction("UP", tuple())
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ self.ui_test.execute_dialog_through_command(".uno:Watermark")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTextInput = xDialog.getChild("TextInput")
+ xAngle = xDialog.getChild("Angle")
+ xTransparency = xDialog.getChild("Transparency")
+
+ self.assertEqual(get_state_as_dict(xTextInput)["Text"], "Watermark")
+ self.assertEqual(get_state_as_dict(xAngle)["Text"], "90°")
+ self.assertEqual(get_state_as_dict(xTransparency)["Text"], "51%")
+
+ xCancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancBtn)
+
+ self.ui_test.execute_dialog_through_command(".uno:Watermark")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTextInput = xDialog.getChild("TextInput")
+ xTextInput.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xTextInput.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ self.ui_test.execute_dialog_through_command(".uno:Watermark")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTextInput = xDialog.getChild("TextInput")
+
+ self.assertEqual(get_state_as_dict(xTextInput)["Text"], "")
+
+ xCancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancBtn)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests/wordCount.py b/sw/qa/uitest/writer_tests/wordCount.py
index eed3215a22c7..9d8b3a6cba0a 100644
--- a/sw/qa/uitest/writer_tests/wordCount.py
+++ b/sw/qa/uitest/writer_tests/wordCount.py
@@ -13,36 +13,38 @@ class writerWordCount(UITestCase):
def test_word_count_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- document = self.ui_test.get_component()
-
- type_text(xWriterEdit, "Test for word count dialog") #type text
- xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "8"})) #select two words
-
- self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xselectwords = xDialog.getChild("selectwords")
- xdocwords = xDialog.getChild("docwords")
- xselectchars = xDialog.getChild("selectchars")
- xdocchars = xDialog.getChild("docchars")
- xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
- xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
- xselectcjkchars = xDialog.getChild("selectcjkchars")
- xdoccjkchars = xDialog.getChild("doccjkchars")
-
- self.assertEqual(get_state_as_dict(xselectwords)["Text"], "2")
- self.assertEqual(get_state_as_dict(xdocwords)["Text"], "5")
- self.assertEqual(get_state_as_dict(xselectchars)["Text"], "8")
- self.assertEqual(get_state_as_dict(xdocchars)["Text"], "26")
- self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "7")
- self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "22")
- self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
- xCloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ document = self.ui_test.get_component()
+
+ type_text(xWriterEdit, "Test for word count dialog") #type text
+ xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "8"})) #select two words
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xselectwords = xDialog.getChild("selectwords")
+ xdocwords = xDialog.getChild("docwords")
+ xselectchars = xDialog.getChild("selectchars")
+ xdocchars = xDialog.getChild("docchars")
+ xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
+ xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
+ xselectcjkchars = xDialog.getChild("selectcjkchars")
+ xdoccjkchars = xDialog.getChild("doccjkchars")
+
+ self.assertEqual(get_state_as_dict(xselectwords)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xdocwords)["Text"], "5")
+ self.assertEqual(get_state_as_dict(xselectchars)["Text"], "8")
+ self.assertEqual(get_state_as_dict(xdocchars)["Text"], "26")
+ self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "7")
+ self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "22")
+ self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
def test_tdf68347(self):
#Bug 68347 - Incorrect word count in a document with recorded changes
@@ -77,14 +79,16 @@ class writerWordCount(UITestCase):
self.ui_test.close_dialog_through_button(xCloseBtn)
def test_tdf91100(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
- self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
def test_tdf58050(self):
with self.ui_test.load_file(get_url_for_data_file("tdf58050.html")) as writer_doc:
@@ -114,122 +118,125 @@ class writerWordCount(UITestCase):
def test_word_count_interpunction_counted_tdf56975_a(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- document = self.ui_test.get_component()
- #Open writer, enter "Testing one two! Test?"
- type_text(xWriterEdit, "Testing one two! Test?")
- #-> LO says: 4 words. SUCCESS! :)
- self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xselectwords = xDialog.getChild("selectwords")
- xdocwords = xDialog.getChild("docwords")
- xselectchars = xDialog.getChild("selectchars")
- xdocchars = xDialog.getChild("docchars")
- xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
- xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
- xselectcjkchars = xDialog.getChild("selectcjkchars")
- xdoccjkchars = xDialog.getChild("doccjkchars")
-
- self.assertEqual(get_state_as_dict(xselectwords)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdocwords)["Text"], "4")
- self.assertEqual(get_state_as_dict(xselectchars)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdocchars)["Text"], "22")
- self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "19")
- self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
- xCloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ document = self.ui_test.get_component()
+ #Open writer, enter "Testing one two! Test?"
+ type_text(xWriterEdit, "Testing one two! Test?")
+ #-> LO says: 4 words. SUCCESS! :)
+ self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xselectwords = xDialog.getChild("selectwords")
+ xdocwords = xDialog.getChild("docwords")
+ xselectchars = xDialog.getChild("selectchars")
+ xdocchars = xDialog.getChild("docchars")
+ xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
+ xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
+ xselectcjkchars = xDialog.getChild("selectcjkchars")
+ xdoccjkchars = xDialog.getChild("doccjkchars")
+
+ self.assertEqual(get_state_as_dict(xselectwords)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdocwords)["Text"], "4")
+ self.assertEqual(get_state_as_dict(xselectchars)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdocchars)["Text"], "22")
+ self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "19")
+ self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
def test_word_count_interpunction_counted_tdf56975_b(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- document = self.ui_test.get_component()
- #1. Create a new text document.
- #2. Type-in the words:
- # This is a test sentence.
- type_text(xWriterEdit, "This is a test sentence.")
- #3. Open the word count dialogue.
- # Word count in both, dialogue and status line, shows 5 words.
- self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xselectwords = xDialog.getChild("selectwords")
- xdocwords = xDialog.getChild("docwords")
- xselectchars = xDialog.getChild("selectchars")
- xdocchars = xDialog.getChild("docchars")
- xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
- xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
- xselectcjkchars = xDialog.getChild("selectcjkchars")
- xdoccjkchars = xDialog.getChild("doccjkchars")
-
- self.assertEqual(get_state_as_dict(xselectwords)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdocwords)["Text"], "5")
- self.assertEqual(get_state_as_dict(xselectchars)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdocchars)["Text"], "24")
- self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "20")
- self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
- xCloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
- #4. Select the space between 'a' and 'test'.
- xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "9", "END_POS": "10"}))
- #5. Replace selection by a non-breaking space by pressing Shift+Ctrl+Space. Don't move the cursor.
- self.xUITest.executeCommand(".uno:InsertNonBreakingSpace")
- # Word count in dialogue shows 4 words, whereas in the status line it shows 5 words.
- self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xselectwords = xDialog.getChild("selectwords")
- xdocwords = xDialog.getChild("docwords")
- xselectchars = xDialog.getChild("selectchars")
- xdocchars = xDialog.getChild("docchars")
- xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
- xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
- xselectcjkchars = xDialog.getChild("selectcjkchars")
- xdoccjkchars = xDialog.getChild("doccjkchars")
-
- self.assertEqual(get_state_as_dict(xselectwords)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdocwords)["Text"], "5")
- self.assertEqual(get_state_as_dict(xselectchars)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdocchars)["Text"], "24")
- self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "20")
- self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
- xCloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
- #6. Move the cursor by pressing Left.
- self.xUITest.executeCommand(".uno:GoLeft")
- # Word count in both, dialogue and status line, shows 5 words.
- self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xselectwords = xDialog.getChild("selectwords")
- xdocwords = xDialog.getChild("docwords")
- xselectchars = xDialog.getChild("selectchars")
- xdocchars = xDialog.getChild("docchars")
- xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
- xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
- xselectcjkchars = xDialog.getChild("selectcjkchars")
- xdoccjkchars = xDialog.getChild("doccjkchars")
-
- self.assertEqual(get_state_as_dict(xselectwords)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdocwords)["Text"], "5")
- self.assertEqual(get_state_as_dict(xselectchars)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdocchars)["Text"], "24")
- self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "20")
- self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
- self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
- xCloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ document = self.ui_test.get_component()
+ #1. Create a new text document.
+ #2. Type-in the words:
+ # This is a test sentence.
+ type_text(xWriterEdit, "This is a test sentence.")
+ #3. Open the word count dialogue.
+ # Word count in both, dialogue and status line, shows 5 words.
+ self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xselectwords = xDialog.getChild("selectwords")
+ xdocwords = xDialog.getChild("docwords")
+ xselectchars = xDialog.getChild("selectchars")
+ xdocchars = xDialog.getChild("docchars")
+ xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
+ xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
+ xselectcjkchars = xDialog.getChild("selectcjkchars")
+ xdoccjkchars = xDialog.getChild("doccjkchars")
+
+ self.assertEqual(get_state_as_dict(xselectwords)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdocwords)["Text"], "5")
+ self.assertEqual(get_state_as_dict(xselectchars)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdocchars)["Text"], "24")
+ self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "20")
+ self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ #4. Select the space between 'a' and 'test'.
+ xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "9", "END_POS": "10"}))
+ #5. Replace selection by a non-breaking space by pressing Shift+Ctrl+Space. Don't move the cursor.
+ self.xUITest.executeCommand(".uno:InsertNonBreakingSpace")
+ # Word count in dialogue shows 4 words, whereas in the status line it shows 5 words.
+ self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xselectwords = xDialog.getChild("selectwords")
+ xdocwords = xDialog.getChild("docwords")
+ xselectchars = xDialog.getChild("selectchars")
+ xdocchars = xDialog.getChild("docchars")
+ xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
+ xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
+ xselectcjkchars = xDialog.getChild("selectcjkchars")
+ xdoccjkchars = xDialog.getChild("doccjkchars")
+
+ self.assertEqual(get_state_as_dict(xselectwords)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdocwords)["Text"], "5")
+ self.assertEqual(get_state_as_dict(xselectchars)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdocchars)["Text"], "24")
+ self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "20")
+ self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ #6. Move the cursor by pressing Left.
+ self.xUITest.executeCommand(".uno:GoLeft")
+ # Word count in both, dialogue and status line, shows 5 words.
+ self.ui_test.execute_modeless_dialog_through_command(".uno:WordCountDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xselectwords = xDialog.getChild("selectwords")
+ xdocwords = xDialog.getChild("docwords")
+ xselectchars = xDialog.getChild("selectchars")
+ xdocchars = xDialog.getChild("docchars")
+ xselectcharsnospaces = xDialog.getChild("selectcharsnospaces")
+ xdoccharsnospaces = xDialog.getChild("doccharsnospaces")
+ xselectcjkchars = xDialog.getChild("selectcjkchars")
+ xdoccjkchars = xDialog.getChild("doccjkchars")
+
+ self.assertEqual(get_state_as_dict(xselectwords)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdocwords)["Text"], "5")
+ self.assertEqual(get_state_as_dict(xselectchars)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdocchars)["Text"], "24")
+ self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "20")
+ self.assertEqual(get_state_as_dict(xselectcjkchars)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xdoccjkchars)["Text"], "0")
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.close_doc()
def test_tdf51816(self):
with self.ui_test.load_file(get_url_for_data_file("tdf51816.odt")) as writer_doc:
diff --git a/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py b/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py
index 7764742cea5b..39ba7eb3595a 100644
--- a/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py
+++ b/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py
@@ -11,30 +11,31 @@ from uitest.uihelper.common import select_by_text
class asianPhoneticGuide(UITestCase):
def test_asian_phonetic_guide(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_modeless_dialog_through_command(".uno:RubyDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_modeless_dialog_through_command(".uno:RubyDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- xLeft1ED = xDialog.getChild("Left1ED")
- xRight1ED = xDialog.getChild("Right1ED")
- xadjustlb = xDialog.getChild("adjustlb")
- xpositionlb = xDialog.getChild("positionlb")
- xstylelb = xDialog.getChild("stylelb")
+ xLeft1ED = xDialog.getChild("Left1ED")
+ xRight1ED = xDialog.getChild("Right1ED")
+ xadjustlb = xDialog.getChild("adjustlb")
+ xpositionlb = xDialog.getChild("positionlb")
+ xstylelb = xDialog.getChild("stylelb")
- xLeft1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
- xRight1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"w"}))
- select_by_text(xadjustlb, "Right")
- select_by_text(xpositionlb, "Right")
- select_by_text(xstylelb, "Quotation")
+ xLeft1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ xRight1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"w"}))
+ select_by_text(xadjustlb, "Right")
+ select_by_text(xpositionlb, "Right")
+ select_by_text(xstylelb, "Quotation")
- xApplyBtn = xDialog.getChild("ok")
- xApplyBtn.executeAction("CLICK", tuple())
+ xApplyBtn = xDialog.getChild("ok")
+ xApplyBtn.executeAction("CLICK", tuple())
- xCloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
- self.assertEqual(document.Text.String[0:1], "a")
+ self.assertEqual(document.Text.String[0:1], "a")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/bookmark.py b/sw/qa/uitest/writer_tests2/bookmark.py
index 5bddc9440f76..d41fd2ff81e8 100644
--- a/sw/qa/uitest/writer_tests2/bookmark.py
+++ b/sw/qa/uitest/writer_tests2/bookmark.py
@@ -15,111 +15,117 @@ class bookmarkDialog(UITestCase):
def test_bookmark_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
-
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xInsertBtn = xBookDlg.getChild("insert")
- xInsertBtn.executeAction("CLICK", tuple()) # first bookmark
-
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xInsertBtn = xBookDlg.getChild("insert")
- xBmk = xBookDlg.getChild("bookmarks")
- self.assertEqual(get_state_as_dict(xBmk)["VisibleCount"], "1") #check for 1st bookmark exist
- xInsertBtn.executeAction("CLICK", tuple()) # add 2nd bookmark
-
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xCloseBtn = xBookDlg.getChild("close")
- xCloseBtn.executeAction("CLICK", tuple()) # close
-
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xBmk = xBookDlg.getChild("bookmarks")
- self.assertEqual(get_state_as_dict(xBmk)["VisibleCount"], "2") #check for 2 bookmarks
- xCloseBtn = xBookDlg.getChild("close")
- xCloseBtn.executeAction("CLICK", tuple()) # close dialog
-
- #now delete one bookmark
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xBmk = xBookDlg.getChild("bookmarks")
- xSecondListEntry = xBmk.getChild("1") # select second bookmark
- xSecondListEntry.executeAction("SELECT", tuple())
- xDelBtn = xBookDlg.getChild("delete")
- xDelBtn.executeAction("CLICK", tuple()) # delete one bookmark
- xCloseBtn = xBookDlg.getChild("close")
- xCloseBtn.executeAction("CLICK", tuple()) # close dialog
-
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xCloseBtn = xBookDlg.getChild("close")
- xBmk2 = xBookDlg.getChild("bookmarks")
- self.assertEqual(get_state_as_dict(xBmk2)["VisibleCount"], "1") #check for 1 bookmark
- xCloseBtn.executeAction("CLICK", tuple()) # now we have only 1 bookmark
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xInsertBtn = xBookDlg.getChild("insert")
+ xInsertBtn.executeAction("CLICK", tuple()) # first bookmark
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xInsertBtn = xBookDlg.getChild("insert")
+ xBmk = xBookDlg.getChild("bookmarks")
+ self.assertEqual(get_state_as_dict(xBmk)["VisibleCount"], "1") #check for 1st bookmark exist
+ xInsertBtn.executeAction("CLICK", tuple()) # add 2nd bookmark
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xCloseBtn = xBookDlg.getChild("close")
+ xCloseBtn.executeAction("CLICK", tuple()) # close
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xBmk = xBookDlg.getChild("bookmarks")
+ self.assertEqual(get_state_as_dict(xBmk)["VisibleCount"], "2") #check for 2 bookmarks
+ xCloseBtn = xBookDlg.getChild("close")
+ xCloseBtn.executeAction("CLICK", tuple()) # close dialog
+
+#now delete one bookmark
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xBmk = xBookDlg.getChild("bookmarks")
+ xSecondListEntry = xBmk.getChild("1") # select second bookmark
+ xSecondListEntry.executeAction("SELECT", tuple())
+ xDelBtn = xBookDlg.getChild("delete")
+ xDelBtn.executeAction("CLICK", tuple()) # delete one bookmark
+ xCloseBtn = xBookDlg.getChild("close")
+ xCloseBtn.executeAction("CLICK", tuple()) # close dialog
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xCloseBtn = xBookDlg.getChild("close")
+ xBmk2 = xBookDlg.getChild("bookmarks")
+ self.assertEqual(get_state_as_dict(xBmk2)["VisibleCount"], "1") #check for 1 bookmark
+ xCloseBtn.executeAction("CLICK", tuple()) # now we have only 1 bookmark
+
+ self.ui_test.close_doc()
def test_bookmark_dialog_rename(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xInsertBtn = xBookDlg.getChild("insert")
- xInsertBtn.executeAction("CLICK", tuple()) # first bookmark
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xInsertBtn = xBookDlg.getChild("insert")
+ xInsertBtn.executeAction("CLICK", tuple()) # first bookmark
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xBmk = xBookDlg.getChild("bookmarks")
- xFirstListEntry = xBmk.getChild("0") # select first bookmark
- xFirstListEntry.executeAction("SELECT", tuple())
- xRenameBtn = xBookDlg.getChild("rename")
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xBmk = xBookDlg.getChild("bookmarks")
+ xFirstListEntry = xBmk.getChild("0") # select first bookmark
+ xFirstListEntry.executeAction("SELECT", tuple())
+ xRenameBtn = xBookDlg.getChild("rename")
- with self.ui_test.execute_blocking_action(xRenameBtn.executeAction, args=('CLICK', ())) as dialog:
- xNewNameTxt=dialog.getChild("entry")
- xNewNameTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"newname"}))
+ with self.ui_test.execute_blocking_action(xRenameBtn.executeAction, args=('CLICK', ())) as dialog:
+ xNewNameTxt=dialog.getChild("entry")
+ xNewNameTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"newname"}))
- xBookDlg = self.xUITest.getTopFocusWindow()
- x1stListEntry = xBmk.getChild("O") # select first bookmark - name "newname"
- x1stListEntry.executeAction("SELECT", tuple())
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ x1stListEntry = xBmk.getChild("O") # select first bookmark - name "newname"
+ x1stListEntry.executeAction("SELECT", tuple())
- self.assertEqual(get_state_as_dict(x1stListEntry)["Text"], "1\tnewname\t\tNo\t") #check the new name "newname"
+ self.assertEqual(get_state_as_dict(x1stListEntry)["Text"], "1\tnewname\t\tNo\t") #check the new name "newname"
- xCloseBtn = xBookDlg.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ xCloseBtn = xBookDlg.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
def test_bookmark_dialog_goto(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xInsertBtn = xBookDlg.getChild("insert")
+ xInsertBtn.executeAction("CLICK", tuple()) # first bookmark
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xInsertBtn = xBookDlg.getChild("insert")
- xInsertBtn.executeAction("CLICK", tuple()) # first bookmark
+ type_text(xWriterEdit, "Test for bookmark")
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ type_text(xWriterEdit, "Test2 for bookmark")
- type_text(xWriterEdit, "Test for bookmark")
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- type_text(xWriterEdit, "Test2 for bookmark")
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xInsertBtn = xBookDlg.getChild("insert")
+ xInsertBtn.executeAction("CLICK", tuple()) # second bookmark
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xInsertBtn = xBookDlg.getChild("insert")
- xInsertBtn.executeAction("CLICK", tuple()) # second bookmark
+ self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
+ xBookDlg = self.xUITest.getTopFocusWindow()
+ xBmk = xBookDlg.getChild("bookmarks")
+ xFirstListEntry = xBmk.getChild("0") # select first bookmark
+ xFirstListEntry.executeAction("SELECT", tuple())
+ xGoToBtn = xBookDlg.getChild("goto")
+ xGoToBtn.executeAction("CLICK", tuple()) # goto 1st bookmark
+ xCloseBtn = xBookDlg.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
- self.ui_test.execute_dialog_through_command(".uno:InsertBookmark")
- xBookDlg = self.xUITest.getTopFocusWindow()
- xBmk = xBookDlg.getChild("bookmarks")
- xFirstListEntry = xBmk.getChild("0") # select first bookmark
- xFirstListEntry.executeAction("SELECT", tuple())
- xGoToBtn = xBookDlg.getChild("goto")
- xGoToBtn.executeAction("CLICK", tuple()) # goto 1st bookmark
- xCloseBtn = xBookDlg.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/deleteAllComments.py b/sw/qa/uitest/writer_tests2/deleteAllComments.py
index 35d05079e9c3..e6832af6cb62 100644
--- a/sw/qa/uitest/writer_tests2/deleteAllComments.py
+++ b/sw/qa/uitest/writer_tests2/deleteAllComments.py
@@ -11,39 +11,42 @@ class DeleteAllComments(UITestCase):
def test_comments_delete(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "Test LibreOffice")
+ type_text(xWriterEdit, "Test LibreOffice")
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- selection = self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:InsertAnnotation")
- cursor = document.getCurrentController().getViewCursor()
- type_text(xWriterEdit, "EEEEE")
- self.xUITest.executeCommand(".uno:InsertAnnotation")
- self.xUITest.executeCommand(".uno:DeleteAllNotes")
- self.assertEqual(document.Text.String[0:4], "Test")
+ selection = self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ cursor = document.getCurrentController().getViewCursor()
+ type_text(xWriterEdit, "EEEEE")
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ self.xUITest.executeCommand(".uno:DeleteAllNotes")
+ self.assertEqual(document.Text.String[0:4], "Test")
+
+ self.ui_test.close_doc()
def test_comment_trackchanges(self):
#tdf111524
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "foo")
+ type_text(xWriterEdit, "foo")
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- selection = self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:InsertAnnotation")
- self.xUITest.executeCommand(".uno:TrackChanges")
- self.xUITest.executeCommand(".uno:DeleteAllNotes")
+ selection = self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ self.xUITest.executeCommand(".uno:DeleteAllNotes")
+ self.ui_test.close_doc()
diff --git a/sw/qa/uitest/writer_tests2/documentProperties.py b/sw/qa/uitest/writer_tests2/documentProperties.py
index a3dc933ede8e..8afbac9be533 100644
--- a/sw/qa/uitest/writer_tests2/documentProperties.py
+++ b/sw/qa/uitest/writer_tests2/documentProperties.py
@@ -29,100 +29,102 @@ class documentProperties(UITestCase):
self.assertEqual(aExpected, get_state_as_dict(xRemoveBtn)['ReallyVisible'])
def test_open_documentProperties_writer(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
- xDialog = self.xUITest.getTopFocusWindow()
- xResetBtn = xDialog.getChild("reset")
- xResetBtn.executeAction("CLICK", tuple())
-
- 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")
-
- with self.ui_test.execute_blocking_action(xDigSignBtn.executeAction, args=('CLICK', ()), close_button="no"):
- pass
-
- xTabs = xDialog.getChild("tabcontrol")
- 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())
- xRecordChangesCheckbox = xDialog.getChild("recordchanges")
- xRecordChangesCheckbox.executeAction("CLICK", tuple())
- xProtectBtn = xDialog.getChild("protect")
-
- with self.ui_test.execute_blocking_action(xProtectBtn.executeAction, args=('CLICK', ())) as dialog:
- xPasswordText = dialog.getChild("pass1ed")
- xPasswordText.executeAction("TYPE", mkPropertyValues({"TEXT":"password"}))
- xConfirmText = dialog.getChild("confirm1ed")
- xConfirmText.executeAction("TYPE", mkPropertyValues({"TEXT":"password"}))
-
- select_pos(xTabs, "2") #tab Custom properties
-
- self.assert_custom_properties(xDialog, False)
-
- xAddBtn = xDialog.getChild("add")
- xAddBtn.executeAction("CLICK", tuple())
-
- self.assert_custom_properties(xDialog, True)
-
- xRemoveBtn = xDialog.getChild("remove1")
- xRemoveBtn.executeAction("CLICK", tuple())
-
- self.assert_custom_properties(xDialog, False)
-
- select_pos(xTabs, "5") #tab Statistics
- xUpdateBtn = xDialog.getChild("update")
- xUpdateBtn.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(xRecordChangesCheckbox)["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.create_doc_in_start_center("writer")
+ self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xResetBtn = xDialog.getChild("reset")
+ xResetBtn.executeAction("CLICK", tuple())
+
+ 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")
+
+ with self.ui_test.execute_blocking_action(xDigSignBtn.executeAction, args=('CLICK', ()), close_button="no"):
+ pass
+
+ xTabs = xDialog.getChild("tabcontrol")
+ 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())
+ xRecordChangesCheckbox = xDialog.getChild("recordchanges")
+ xRecordChangesCheckbox.executeAction("CLICK", tuple())
+ xProtectBtn = xDialog.getChild("protect")
+
+ with self.ui_test.execute_blocking_action(xProtectBtn.executeAction, args=('CLICK', ())) as dialog:
+ xPasswordText = dialog.getChild("pass1ed")
+ xPasswordText.executeAction("TYPE", mkPropertyValues({"TEXT":"password"}))
+ xConfirmText = dialog.getChild("confirm1ed")
+ xConfirmText.executeAction("TYPE", mkPropertyValues({"TEXT":"password"}))
+
+ select_pos(xTabs, "2") #tab Custom properties
+
+ self.assert_custom_properties(xDialog, False)
+
+ xAddBtn = xDialog.getChild("add")
+ xAddBtn.executeAction("CLICK", tuple())
+
+ self.assert_custom_properties(xDialog, True)
+
+ xRemoveBtn = xDialog.getChild("remove1")
+ xRemoveBtn.executeAction("CLICK", tuple())
+
+ self.assert_custom_properties(xDialog, False)
+
+ select_pos(xTabs, "5") #tab Statistics
+ xUpdateBtn = xDialog.getChild("update")
+ xUpdateBtn.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(xRecordChangesCheckbox)["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/sw/qa/uitest/writer_tests2/exchangeDatabase.py b/sw/qa/uitest/writer_tests2/exchangeDatabase.py
index 1b2385e869fa..3f3a49660bfc 100644
--- a/sw/qa/uitest/writer_tests2/exchangeDatabase.py
+++ b/sw/qa/uitest/writer_tests2/exchangeDatabase.py
@@ -12,40 +12,44 @@ class exchangeDB(UITestCase):
def test_exchange_database(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
- xExDBDlg = self.xUITest.getTopFocusWindow()
- xCloseBtn = xExDBDlg.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
+ xExDBDlg = self.xUITest.getTopFocusWindow()
+ xCloseBtn = xExDBDlg.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
def test_exchange_database2(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
+ xExDBDlg = self.xUITest.getTopFocusWindow()
+ xTreelist = xExDBDlg.getChild("availablelb")
- self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
- xExDBDlg = self.xUITest.getTopFocusWindow()
- xTreelist = xExDBDlg.getChild("availablelb")
+ xLabeldb = xExDBDlg.getChild("dbnameft")
+ self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "[None]")
- xLabeldb = xExDBDlg.getChild("dbnameft")
- self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "[None]")
+ xTreeEntry = xTreelist.getChild('0') #Available Databases
+ xTreeEntry.executeAction("EXPAND", tuple()) #Click on the Bibliography
+ xTreeEntry.executeAction("COLLAPSE", tuple())
+ xTreeEntry.executeAction("EXPAND", tuple())
+ xTreeEntry2 = xTreeEntry.getChild('0') #Available Databases
+ xTreeEntry2.executeAction("SELECT", tuple()) #Click on the biblio
- xTreeEntry = xTreelist.getChild('0') #Available Databases
- xTreeEntry.executeAction("EXPAND", tuple()) #Click on the Bibliography
- xTreeEntry.executeAction("COLLAPSE", tuple())
- xTreeEntry.executeAction("EXPAND", tuple())
- xTreeEntry2 = xTreeEntry.getChild('0') #Available Databases
- xTreeEntry2.executeAction("SELECT", tuple()) #Click on the biblio
+ xDefineBtn = xExDBDlg.getChild("ok")
+ xDefineBtn.executeAction("CLICK", tuple())
- xDefineBtn = xExDBDlg.getChild("ok")
- xDefineBtn.executeAction("CLICK", tuple())
+ self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
+ xExDBDlg = self.xUITest.getTopFocusWindow()
+ xLabeldb = xExDBDlg.getChild("dbnameft")
+ self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "Bibliography.biblio")
- self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
- xExDBDlg = self.xUITest.getTopFocusWindow()
- xLabeldb = xExDBDlg.getChild("dbnameft")
- self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "Bibliography.biblio")
+ xCloseBtn = xExDBDlg.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
- xCloseBtn = xExDBDlg.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/fontworks.py b/sw/qa/uitest/writer_tests2/fontworks.py
index 9c415a7f60a5..d9ef76c10602 100644
--- a/sw/qa/uitest/writer_tests2/fontworks.py
+++ b/sw/qa/uitest/writer_tests2/fontworks.py
@@ -15,24 +15,26 @@ from uitest.uihelper import guarded
class fontWorksDialog(UITestCase):
def test_fontwork_selector(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- with guarded.execute_dialog_through_command(self, ".uno:FontworkGalleryFloater", close_button="cancel") as xDialog:
- FontWorkSelector = xDialog.getChild("ctlFavoriteswin")
- # Select element with id (3)
- element3 = FontWorkSelector.getChild("2")
- element3.executeAction("SELECT", mkPropertyValues({}))
- print(get_state_as_dict(FontWorkSelector))
- self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "2")
- self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "3")
- self.assertEqual(get_state_as_dict(FontWorkSelector)["VisibleCount"], "36")
+ with guarded.execute_dialog_through_command(self, ".uno:FontworkGalleryFloater", close_button="cancel") as xDialog:
+ FontWorkSelector = xDialog.getChild("ctlFavoriteswin")
+ # Select element with id (3)
+ element3 = FontWorkSelector.getChild("2")
+ element3.executeAction("SELECT", mkPropertyValues({}))
+ print(get_state_as_dict(FontWorkSelector))
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "2")
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "3")
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["VisibleCount"], "36")
- # Select element with id (7)
- element7 = FontWorkSelector.getChild("6")
- element7.executeAction("SELECT", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "6")
- self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "7")
+ # Select element with id (7)
+ element7 = FontWorkSelector.getChild("6")
+ element7.executeAction("SELECT", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "6")
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "7")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
index af99ebc7f647..4633666f468d 100644
--- a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
+++ b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
@@ -15,304 +15,315 @@ from uitest.uihelper.common import change_measurement_unit
class formatBulletsNumbering(UITestCase):
def test_bullets_and_numbering_dialog_tab_position(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- change_measurement_unit(self, "Millimeter")
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xalignedatmf = xDialog.getChild("alignedatmf")
- xnum2alignlb = xDialog.getChild("num2alignlb")
- xatmf = xDialog.getChild("atmf")
- xindentatmf = xDialog.getChild("indentatmf")
- xokbtn = xDialog.getChild("ok")
-
- xalignedatmf.executeAction("UP", tuple())
- select_by_text(xnum2alignlb, "Centered")
- xatmf.executeAction("UP", tuple())
- xindentatmf.executeAction("UP", tuple())
-
- self.ui_test.close_dialog_through_button(xokbtn)
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xalignedatmf = xDialog.getChild("alignedatmf")
- xnum2alignlb = xDialog.getChild("num2alignlb")
- xatmf = xDialog.getChild("atmf")
- xindentatmf = xDialog.getChild("indentatmf")
-
- self.assertEqual(get_state_as_dict(xalignedatmf)["Text"], "6.5 mm")
- self.assertEqual(get_state_as_dict(xnum2alignlb)["SelectEntryText"], "Centered")
- self.assertEqual(get_state_as_dict(xatmf)["Text"], "12.8 mm")
- self.assertEqual(get_state_as_dict(xindentatmf)["Text"], "12.8 mm")
-
- xcancbtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancbtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ change_measurement_unit(self, "Millimeter")
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xalignedatmf = xDialog.getChild("alignedatmf")
+ xnum2alignlb = xDialog.getChild("num2alignlb")
+ xatmf = xDialog.getChild("atmf")
+ xindentatmf = xDialog.getChild("indentatmf")
+ xokbtn = xDialog.getChild("ok")
+
+ xalignedatmf.executeAction("UP", tuple())
+ select_by_text(xnum2alignlb, "Centered")
+ xatmf.executeAction("UP", tuple())
+ xindentatmf.executeAction("UP", tuple())
+
+ self.ui_test.close_dialog_through_button(xokbtn)
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xalignedatmf = xDialog.getChild("alignedatmf")
+ xnum2alignlb = xDialog.getChild("num2alignlb")
+ xatmf = xDialog.getChild("atmf")
+ xindentatmf = xDialog.getChild("indentatmf")
+
+ self.assertEqual(get_state_as_dict(xalignedatmf)["Text"], "6.5 mm")
+ self.assertEqual(get_state_as_dict(xnum2alignlb)["SelectEntryText"], "Centered")
+ self.assertEqual(get_state_as_dict(xatmf)["Text"], "12.8 mm")
+ self.assertEqual(get_state_as_dict(xindentatmf)["Text"], "12.8 mm")
+
+ xcancbtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancbtn)
+
+ self.ui_test.close_doc()
def test_bullets_and_numbering_dialog_tab_position2(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
- select_by_text(xnumfollowedbylb, "Space")
-
- xokbtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xokbtn)
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
- self.assertEqual(get_state_as_dict(xnumfollowedbylb)["SelectEntryText"], "Space")
-
- xcancbtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancbtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
+ select_by_text(xnumfollowedbylb, "Space")
+
+ xokbtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xokbtn)
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
+ self.assertEqual(get_state_as_dict(xnumfollowedbylb)["SelectEntryText"], "Space")
+
+ xcancbtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancbtn)
+
+ self.ui_test.close_doc()
def test_bullets_and_numbering_dialog_tab_customize(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
- xnumfmtlb = xDialog.getChild("numfmtlb")
- xstartat = xDialog.getChild("startat")
- xcharstyle = xDialog.getChild("charstyle")
- xprefix = xDialog.getChild("prefix")
- xsuffix = xDialog.getChild("suffix")
- xallsame = xDialog.getChild("allsame")
-
- select_by_text(xnumfmtlb, "A, B, C, ...")
- xstartat.executeAction("UP", tuple())
- select_by_text(xcharstyle, "Bullets")
- xprefix.executeAction("TYPE", mkPropertyValues({"TEXT":"o"}))
- xsuffix.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xsuffix.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
- xallsame.executeAction("CLICK", tuple())
-
- xokbtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xokbtn)
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
- xnumfmtlb = xDialog.getChild("numfmtlb")
- xstartat = xDialog.getChild("startat")
- xcharstyle = xDialog.getChild("charstyle")
- xprefix = xDialog.getChild("prefix")
- xsuffix = xDialog.getChild("suffix")
- xallsame = xDialog.getChild("allsame")
-
- self.assertEqual(get_state_as_dict(xnumfmtlb)["SelectEntryText"], "A, B, C, ...")
- self.assertEqual(get_state_as_dict(xstartat)["Text"], "2")
- self.assertEqual(get_state_as_dict(xcharstyle)["SelectEntryText"], "Bullets")
- self.assertEqual(get_state_as_dict(xprefix)["Text"], "o")
- self.assertEqual(get_state_as_dict(xsuffix)["Text"], "a")
- self.assertEqual(get_state_as_dict(xallsame)["Selected"], "true")
-
- xcancbtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancbtn)
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xremovebtn = xDialog.getChild("user")
- self.ui_test.close_dialog_through_button(xremovebtn) #remove new settings, back to default
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
- xnumfmtlb = xDialog.getChild("numfmtlb")
- xstartat = xDialog.getChild("startat")
- xcharstyle = xDialog.getChild("charstyle")
- xprefix = xDialog.getChild("prefix")
- xsuffix = xDialog.getChild("suffix")
- xallsame = xDialog.getChild("allsame")
-
- self.assertEqual(get_state_as_dict(xnumfmtlb)["SelectEntryText"], "1, 2, 3, ...")
- self.assertEqual(get_state_as_dict(xstartat)["Text"], "1")
- self.assertEqual(get_state_as_dict(xcharstyle)["SelectEntryText"], "None")
- self.assertEqual(get_state_as_dict(xprefix)["Text"], "")
- self.assertEqual(get_state_as_dict(xsuffix)["Text"], ".")
- self.assertEqual(get_state_as_dict(xallsame)["Selected"], "false")
-
- xcancbtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancbtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+ xnumfmtlb = xDialog.getChild("numfmtlb")
+ xstartat = xDialog.getChild("startat")
+ xcharstyle = xDialog.getChild("charstyle")
+ xprefix = xDialog.getChild("prefix")
+ xsuffix = xDialog.getChild("suffix")
+ xallsame = xDialog.getChild("allsame")
+
+ select_by_text(xnumfmtlb, "A, B, C, ...")
+ xstartat.executeAction("UP", tuple())
+ select_by_text(xcharstyle, "Bullets")
+ xprefix.executeAction("TYPE", mkPropertyValues({"TEXT":"o"}))
+ xsuffix.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xsuffix.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ xallsame.executeAction("CLICK", tuple())
+
+ xokbtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xokbtn)
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+ xnumfmtlb = xDialog.getChild("numfmtlb")
+ xstartat = xDialog.getChild("startat")
+ xcharstyle = xDialog.getChild("charstyle")
+ xprefix = xDialog.getChild("prefix")
+ xsuffix = xDialog.getChild("suffix")
+ xallsame = xDialog.getChild("allsame")
+
+ self.assertEqual(get_state_as_dict(xnumfmtlb)["SelectEntryText"], "A, B, C, ...")
+ self.assertEqual(get_state_as_dict(xstartat)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xcharstyle)["SelectEntryText"], "Bullets")
+ self.assertEqual(get_state_as_dict(xprefix)["Text"], "o")
+ self.assertEqual(get_state_as_dict(xsuffix)["Text"], "a")
+ self.assertEqual(get_state_as_dict(xallsame)["Selected"], "true")
+
+ xcancbtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancbtn)
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xremovebtn = xDialog.getChild("user")
+ self.ui_test.close_dialog_through_button(xremovebtn) #remove new settings, back to default
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+ xnumfmtlb = xDialog.getChild("numfmtlb")
+ xstartat = xDialog.getChild("startat")
+ xcharstyle = xDialog.getChild("charstyle")
+ xprefix = xDialog.getChild("prefix")
+ xsuffix = xDialog.getChild("suffix")
+ xallsame = xDialog.getChild("allsame")
+
+ self.assertEqual(get_state_as_dict(xnumfmtlb)["SelectEntryText"], "1, 2, 3, ...")
+ self.assertEqual(get_state_as_dict(xstartat)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xcharstyle)["SelectEntryText"], "None")
+ self.assertEqual(get_state_as_dict(xprefix)["Text"], "")
+ self.assertEqual(get_state_as_dict(xsuffix)["Text"], ".")
+ self.assertEqual(get_state_as_dict(xallsame)["Selected"], "false")
+
+ xcancbtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancbtn)
+
+ self.ui_test.close_doc()
def test_bullets_and_numbering_tab_move(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
-
- change_measurement_unit(self, "Millimeter")
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xindentatmf = xDialog.getChild("indentatmf")
- indentValue = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
-
- xokbtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xokbtn) #create bullets
-
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) #TAB to move indent right
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xindentatmf = xDialog.getChild("indentatmf")
- indentValue2 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
- self.assertEqual(indentValue < indentValue2 , True)
- xcancbtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancbtn)
-
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"}))
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xindentatmf = xDialog.getChild("indentatmf")
- indentValue3 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
- self.assertEqual(indentValue == indentValue3 , True)
- xcancbtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancbtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ change_measurement_unit(self, "Millimeter")
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+
+ xokbtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xokbtn) #create bullets
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) #TAB to move indent right
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue2 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+ self.assertEqual(indentValue < indentValue2 , True)
+ xcancbtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancbtn)
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"}))
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue3 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+ self.assertEqual(indentValue == indentValue3 , True)
+ xcancbtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancbtn)
+
+ self.ui_test.close_doc()
def test_bullets_and_numbering_button_move(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- change_measurement_unit(self, "Millimeter")
-
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xindentatmf = xDialog.getChild("indentatmf")
- indentValue = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
-
- xokbtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xokbtn) #create bullets
-
- self.xUITest.executeCommand(".uno:DecrementSubLevels")
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xindentatmf = xDialog.getChild("indentatmf")
- indentValue2 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
- self.assertEqual(indentValue < indentValue2 , True)
- xcancbtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancbtn)
-
- self.xUITest.executeCommand(".uno:IncrementLevel")
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xindentatmf = xDialog.getChild("indentatmf")
- indentValue3 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
- self.assertEqual(indentValue == indentValue3 , True)
- xcancbtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancbtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ change_measurement_unit(self, "Millimeter")
+
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+
+ xokbtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xokbtn) #create bullets
+
+ self.xUITest.executeCommand(".uno:DecrementSubLevels")
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue2 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+ self.assertEqual(indentValue < indentValue2 , True)
+ xcancbtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancbtn)
+
+ self.xUITest.executeCommand(".uno:IncrementLevel")
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue3 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+ self.assertEqual(indentValue == indentValue3 , True)
+ xcancbtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancbtn)
+
+ self.ui_test.close_doc()
def test_bullets_and_numbering_selection(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- # Test Bullet Page
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
-
- # Select the BulletPage's Selector
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xBulletPage = xDialog.getChild("PickBulletPage")
- xselector = xBulletPage.getChild("valueset")
- self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8")
- # Select element num 3
- xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"}))
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "2")
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "3")
- self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Solid diamond bullets")
- # Select element num 7
- xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "7"}))
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "6")
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "7")
- self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Cross mark bullets")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- # Test other Pages
- self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- # Select the NumberingPage's Selector
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- xNumberingPage = xDialog.getChild("PickNumberingPage")
- xselector = xNumberingPage.getChild("valueset")
- self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8")
- # Select element num 5
- xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "5"}))
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "4")
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "5")
- self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Uppercase letter A) B) C)")
- # Select element num 8
- xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "8"}))
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "7")
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "8")
- self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Lowercase Roman number i. ii. iii.")
-
- # Select the OutlinePage's Selector
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
- xOutlinePage = xDialog.getChild("PickOutlinePage")
- xselector = xOutlinePage.getChild("valueset")
- self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8")
- # Select element num 1
- xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "0")
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "1")
- self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Numeric, numeric, lowercase letters, solid small circular bullet")
-
- # Select the GraphicPage's Selector
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "3")
- xGraphicPage = xDialog.getChild("PickGraphicPage")
- xselector = xGraphicPage.getChild("valueset")
- self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "92")
- # Select element num 22
- xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "22"}))
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "21")
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "22")
- # Select element num 73
- xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "73"}))
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "72")
- self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "73")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ # Test Bullet Page
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ # Select the BulletPage's Selector
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xBulletPage = xDialog.getChild("PickBulletPage")
+ xselector = xBulletPage.getChild("valueset")
+ self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8")
+ # Select element num 3
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "2")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "3")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Solid diamond bullets")
+ # Select element num 7
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "7"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "6")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "7")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Cross mark bullets")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # Test other Pages
+ self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # Select the NumberingPage's Selector
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xNumberingPage = xDialog.getChild("PickNumberingPage")
+ xselector = xNumberingPage.getChild("valueset")
+ self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8")
+ # Select element num 5
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "5"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "4")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "5")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Uppercase letter A) B) C)")
+ # Select element num 8
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "8"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "7")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "8")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Lowercase Roman number i. ii. iii.")
+
+ # Select the OutlinePage's Selector
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+ xOutlinePage = xDialog.getChild("PickOutlinePage")
+ xselector = xOutlinePage.getChild("valueset")
+ self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8")
+ # Select element num 1
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "0")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "1")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Numeric, numeric, lowercase letters, solid small circular bullet")
+
+ # Select the GraphicPage's Selector
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
+ xGraphicPage = xDialog.getChild("PickGraphicPage")
+ xselector = xGraphicPage.getChild("valueset")
+ self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "92")
+ # Select element num 22
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "22"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "21")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "22")
+ # Select element num 73
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "73"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "72")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "73")
+
+ 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/sw/qa/uitest/writer_tests2/formatCharacter.py b/sw/qa/uitest/writer_tests2/formatCharacter.py
index 8c4e447953d4..c0106ddcd47e 100644
--- a/sw/qa/uitest/writer_tests2/formatCharacter.py
+++ b/sw/qa/uitest/writer_tests2/formatCharacter.py
@@ -14,258 +14,268 @@ from uitest.uihelper.common import select_by_text
class formatCharacter(UITestCase):
def test_format_character_tab_font(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
-
- xSizeFont = xDialog.getChild("westsizelb-cjk")
- xSizeFontEast = xDialog.getChild("eastsizelb")
- xSizeFontCTL = xDialog.getChild("ctlsizelb")
- xLangFont = xDialog.getChild("westlanglb-cjk")
- xLangFontEast = xDialog.getChild("eastlanglb")
- xLangFontCTL = xDialog.getChild("ctllanglb")
-
- xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
- xSizeFontEast.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xSizeFontEast.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
- xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
- select_pos(xLangFont, "0")
- select_pos(xLangFontEast, "0")
- select_pos(xLangFontCTL, "0")
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xSizeFont = xDialog.getChild("westsizelb-cjk")
- xSizeFontEast = xDialog.getChild("eastsizelb")
- xSizeFontCTL = xDialog.getChild("ctlsizelb")
- xLangFont = xDialog.getChild("westlanglb-cjk")
- xLangFontEast = xDialog.getChild("eastlanglb")
- xLangFontCTL = xDialog.getChild("ctllanglb")
-
- self.assertEqual(get_state_as_dict(xSizeFont)["Text"], "18 pt")
- self.assertEqual(get_state_as_dict(xSizeFontEast)["Text"], "18 pt")
- self.assertEqual(get_state_as_dict(xSizeFontCTL)["Text"], "18 pt") #check font size
- self.assertEqual(get_state_as_dict(xLangFont)["Text"], "[None]")
- self.assertEqual(get_state_as_dict(xLangFontEast)["SelectEntryText"], "[None]")
- self.assertEqual(get_state_as_dict(xLangFontCTL)["SelectEntryText"], "[None]")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+
+ xSizeFont = xDialog.getChild("westsizelb-cjk")
+ xSizeFontEast = xDialog.getChild("eastsizelb")
+ xSizeFontCTL = xDialog.getChild("ctlsizelb")
+ xLangFont = xDialog.getChild("westlanglb-cjk")
+ xLangFontEast = xDialog.getChild("eastlanglb")
+ xLangFontCTL = xDialog.getChild("ctllanglb")
+
+ xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
+ xSizeFontEast.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSizeFontEast.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
+ xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
+ select_pos(xLangFont, "0")
+ select_pos(xLangFontEast, "0")
+ select_pos(xLangFontCTL, "0")
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xSizeFont = xDialog.getChild("westsizelb-cjk")
+ xSizeFontEast = xDialog.getChild("eastsizelb")
+ xSizeFontCTL = xDialog.getChild("ctlsizelb")
+ xLangFont = xDialog.getChild("westlanglb-cjk")
+ xLangFontEast = xDialog.getChild("eastlanglb")
+ xLangFontCTL = xDialog.getChild("ctllanglb")
+
+ self.assertEqual(get_state_as_dict(xSizeFont)["Text"], "18 pt")
+ self.assertEqual(get_state_as_dict(xSizeFontEast)["Text"], "18 pt")
+ self.assertEqual(get_state_as_dict(xSizeFontCTL)["Text"], "18 pt") #check font size
+ self.assertEqual(get_state_as_dict(xLangFont)["Text"], "[None]")
+ self.assertEqual(get_state_as_dict(xLangFontEast)["SelectEntryText"], "[None]")
+ self.assertEqual(get_state_as_dict(xLangFontCTL)["SelectEntryText"], "[None]")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_character_tab_font_effects(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
-
- xEffects = xDialog.getChild("effectslb")
- xRelief = xDialog.getChild("relieflb")
- xHidden = xDialog.getChild("hiddencb")
- xOverline = xDialog.getChild("overlinelb")
- xStrikeout = xDialog.getChild("strikeoutlb")
- xUnderline = xDialog.getChild("underlinelb")
- xEmphasis = xDialog.getChild("emphasislb")
- xPosition = xDialog.getChild("positionlb")
-
- select_pos(xEffects, "1")
- select_pos(xRelief, "1")
- xHidden.executeAction("CLICK", tuple())
- select_pos(xOverline, "1")
- select_pos(xStrikeout, "1")
- select_pos(xUnderline, "1")
- select_pos(xEmphasis, "1")
- select_pos(xPosition, "1")
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
-
- xEffects = xDialog.getChild("effectslb")
- xRelief = xDialog.getChild("relieflb")
- xHidden = xDialog.getChild("hiddencb")
- xOverline = xDialog.getChild("overlinelb")
- xStrikeout = xDialog.getChild("strikeoutlb")
- xUnderline = xDialog.getChild("underlinelb")
- xEmphasis = xDialog.getChild("emphasislb")
- xPosition = xDialog.getChild("positionlb")
-
- self.assertEqual(get_state_as_dict(xEffects)["SelectEntryText"], "UPPERCASE")
- self.assertEqual(get_state_as_dict(xRelief)["SelectEntryText"], "Embossed")
- self.assertEqual(get_state_as_dict(xHidden)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xOverline)["SelectEntryText"], "Single")
- self.assertEqual(get_state_as_dict(xStrikeout)["SelectEntryText"], "Single")
- self.assertEqual(get_state_as_dict(xUnderline)["SelectEntryText"], "Single")
- self.assertEqual(get_state_as_dict(xEmphasis)["SelectEntryText"], "Dot")
- self.assertEqual(get_state_as_dict(xPosition)["SelectEntryText"], "Below text")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ xEffects = xDialog.getChild("effectslb")
+ xRelief = xDialog.getChild("relieflb")
+ xHidden = xDialog.getChild("hiddencb")
+ xOverline = xDialog.getChild("overlinelb")
+ xStrikeout = xDialog.getChild("strikeoutlb")
+ xUnderline = xDialog.getChild("underlinelb")
+ xEmphasis = xDialog.getChild("emphasislb")
+ xPosition = xDialog.getChild("positionlb")
+
+ select_pos(xEffects, "1")
+ select_pos(xRelief, "1")
+ xHidden.executeAction("CLICK", tuple())
+ select_pos(xOverline, "1")
+ select_pos(xStrikeout, "1")
+ select_pos(xUnderline, "1")
+ select_pos(xEmphasis, "1")
+ select_pos(xPosition, "1")
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ xEffects = xDialog.getChild("effectslb")
+ xRelief = xDialog.getChild("relieflb")
+ xHidden = xDialog.getChild("hiddencb")
+ xOverline = xDialog.getChild("overlinelb")
+ xStrikeout = xDialog.getChild("strikeoutlb")
+ xUnderline = xDialog.getChild("underlinelb")
+ xEmphasis = xDialog.getChild("emphasislb")
+ xPosition = xDialog.getChild("positionlb")
+
+ self.assertEqual(get_state_as_dict(xEffects)["SelectEntryText"], "UPPERCASE")
+ self.assertEqual(get_state_as_dict(xRelief)["SelectEntryText"], "Embossed")
+ self.assertEqual(get_state_as_dict(xHidden)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xOverline)["SelectEntryText"], "Single")
+ self.assertEqual(get_state_as_dict(xStrikeout)["SelectEntryText"], "Single")
+ self.assertEqual(get_state_as_dict(xUnderline)["SelectEntryText"], "Single")
+ self.assertEqual(get_state_as_dict(xEmphasis)["SelectEntryText"], "Dot")
+ self.assertEqual(get_state_as_dict(xPosition)["SelectEntryText"], "Below text")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_character_tab_hyperlink(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
-
- xURL = xDialog.getChild("urled")
- xURL.executeAction("TYPE", mkPropertyValues({"TEXT":"libreoffice.org"}))
- xTexted = xDialog.getChild("texted")
- xTexted.executeAction("TYPE", mkPropertyValues({"TEXT":"LibreOffice"}))
- xName = xDialog.getChild("nameed")
- xName.executeAction("TYPE", mkPropertyValues({"TEXT":"hyperlink"}))
-
- xVisited = xDialog.getChild("visitedlb")
- select_by_text(xVisited, "Bullets")
- xUnVisited = xDialog.getChild("unvisitedlb")
- select_by_text(xUnVisited, "Bullets")
-
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- self.xUITest.executeCommand(".uno:GoLeft")
- self.assertEqual(document.Text.String[0:11], "LibreOffice")
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xURL = xDialog.getChild("urled")
- xTexted = xDialog.getChild("texted")
- xName = xDialog.getChild("nameed")
- xVisited = xDialog.getChild("visitedlb")
- xUnVisited = xDialog.getChild("unvisitedlb")
-
- self.assertEqual(get_state_as_dict(xURL)["Text"], "http://libreoffice.org/")
- self.assertEqual(get_state_as_dict(xTexted)["Text"], "LibreOffice")
- self.assertEqual(get_state_as_dict(xName)["Text"], "hyperlink")
- self.assertEqual(get_state_as_dict(xVisited)["SelectEntryText"], "Bullets")
- self.assertEqual(get_state_as_dict(xUnVisited)["SelectEntryText"], "Bullets")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+
+ xURL = xDialog.getChild("urled")
+ xURL.executeAction("TYPE", mkPropertyValues({"TEXT":"libreoffice.org"}))
+ xTexted = xDialog.getChild("texted")
+ xTexted.executeAction("TYPE", mkPropertyValues({"TEXT":"LibreOffice"}))
+ xName = xDialog.getChild("nameed")
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"hyperlink"}))
+
+ xVisited = xDialog.getChild("visitedlb")
+ select_by_text(xVisited, "Bullets")
+ xUnVisited = xDialog.getChild("unvisitedlb")
+ select_by_text(xUnVisited, "Bullets")
+
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+
+ self.xUITest.executeCommand(".uno:GoLeft")
+ self.assertEqual(document.Text.String[0:11], "LibreOffice")
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xURL = xDialog.getChild("urled")
+ xTexted = xDialog.getChild("texted")
+ xName = xDialog.getChild("nameed")
+ xVisited = xDialog.getChild("visitedlb")
+ xUnVisited = xDialog.getChild("unvisitedlb")
+
+ self.assertEqual(get_state_as_dict(xURL)["Text"], "http://libreoffice.org/")
+ self.assertEqual(get_state_as_dict(xTexted)["Text"], "LibreOffice")
+ self.assertEqual(get_state_as_dict(xName)["Text"], "hyperlink")
+ self.assertEqual(get_state_as_dict(xVisited)["SelectEntryText"], "Bullets")
+ self.assertEqual(get_state_as_dict(xUnVisited)["SelectEntryText"], "Bullets")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.close_doc()
def test_format_character_tab_asian_layout(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "3")
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
- xTwolines = xDialog.getChild("twolines")
- xTwolines.executeAction("CLICK", tuple())
+ xTwolines = xDialog.getChild("twolines")
+ xTwolines.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "3")
- xTwolines = xDialog.getChild("twolines")
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
+ xTwolines = xDialog.getChild("twolines")
- self.assertEqual(get_state_as_dict(xTwolines)["Selected"], "true")
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.assertEqual(get_state_as_dict(xTwolines)["Selected"], "true")
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.close_doc()
def test_format_character_tab_position(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
-
- xSuperscript = xDialog.getChild("superscript")
- xRelFontSize = xDialog.getChild("fontsizesb")
- x90deg = xDialog.getChild("90deg")
- xScalewidth = xDialog.getChild("scalewidthsb")
- xKerning = xDialog.getChild("kerningsb")
- xPairKerning = xDialog.getChild("pairkerning")
- xFitToLine = xDialog.getChild("fittoline")
-
- xSuperscript.executeAction("CLICK", tuple())
- xRelFontSize.executeAction("UP", tuple())
- x90deg.executeAction("CLICK", tuple())
- xScalewidth.executeAction("UP", tuple())
- xKerning.executeAction("UP", tuple())
- xPairKerning.executeAction("CLICK", tuple())
- xFitToLine.executeAction("CLICK", tuple())
-
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
- xSuperscript = xDialog.getChild("superscript")
- xRelFontSize = xDialog.getChild("fontsizesb")
- x90deg = xDialog.getChild("90deg")
- xScalewidth = xDialog.getChild("scalewidthsb")
- xKerning = xDialog.getChild("kerningsb")
- xPairKerning = xDialog.getChild("pairkerning")
- xFitToLine = xDialog.getChild("fittoline")
-
- self.assertEqual(get_state_as_dict(xSuperscript)["Checked"], "true")
- self.assertEqual(get_state_as_dict(x90deg)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xScalewidth)["Text"], "100%")
- self.assertEqual(get_state_as_dict(xKerning)["Text"], "0.1 pt")
- self.assertEqual(get_state_as_dict(xPairKerning)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xFitToLine)["Selected"], "true")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xSuperscript = xDialog.getChild("superscript")
+ xRelFontSize = xDialog.getChild("fontsizesb")
+ x90deg = xDialog.getChild("90deg")
+ xScalewidth = xDialog.getChild("scalewidthsb")
+ xKerning = xDialog.getChild("kerningsb")
+ xPairKerning = xDialog.getChild("pairkerning")
+ xFitToLine = xDialog.getChild("fittoline")
+
+ xSuperscript.executeAction("CLICK", tuple())
+ xRelFontSize.executeAction("UP", tuple())
+ x90deg.executeAction("CLICK", tuple())
+ xScalewidth.executeAction("UP", tuple())
+ xKerning.executeAction("UP", tuple())
+ xPairKerning.executeAction("CLICK", tuple())
+ xFitToLine.executeAction("CLICK", tuple())
+
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+ xSuperscript = xDialog.getChild("superscript")
+ xRelFontSize = xDialog.getChild("fontsizesb")
+ x90deg = xDialog.getChild("90deg")
+ xScalewidth = xDialog.getChild("scalewidthsb")
+ xKerning = xDialog.getChild("kerningsb")
+ xPairKerning = xDialog.getChild("pairkerning")
+ xFitToLine = xDialog.getChild("fittoline")
+
+ self.assertEqual(get_state_as_dict(xSuperscript)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(x90deg)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xScalewidth)["Text"], "100%")
+ self.assertEqual(get_state_as_dict(xKerning)["Text"], "0.1 pt")
+ self.assertEqual(get_state_as_dict(xPairKerning)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xFitToLine)["Selected"], "true")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_character_tab_position_scalewidthsb(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
-
- xScalewidth = xDialog.getChild("scalewidthsb")
- xScalewidth.executeAction("UP", tuple())
-
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
- xScalewidth = xDialog.getChild("scalewidthsb")
- self.assertEqual(get_state_as_dict(xScalewidth)["Text"], "101%")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xScalewidth = xDialog.getChild("scalewidthsb")
+ xScalewidth.executeAction("UP", tuple())
+
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+ xScalewidth = xDialog.getChild("scalewidthsb")
+ self.assertEqual(get_state_as_dict(xScalewidth)["Text"], "101%")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/formatParagraph.py b/sw/qa/uitest/writer_tests2/formatParagraph.py
index 92b19a5c313f..00cce192cb0b 100644
--- a/sw/qa/uitest/writer_tests2/formatParagraph.py
+++ b/sw/qa/uitest/writer_tests2/formatParagraph.py
@@ -15,608 +15,625 @@ from uitest.uihelper.common import change_measurement_unit
class formatParagraph(UITestCase):
def test_format_paragraph_tab_indents_spacing(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
-
- xBeforeText = xDialog.getChild("spinED_LEFTINDENT")
- xAfterText = xDialog.getChild("spinED_RIGHTINDENT")
- xFirstLine = xDialog.getChild("spinED_FLINEINDENT")
- xAutomaticChk = xDialog.getChild("checkCB_AUTO")
- xAbovePar = xDialog.getChild("spinED_TOPDIST")
- xBelowPar = xDialog.getChild("spinED_BOTTOMDIST")
- xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING")
- xLineSpacing = xDialog.getChild("comboLB_LINEDIST")
- xActivate = xDialog.getChild("checkCB_REGISTER")
-
- xBeforeText.executeAction("UP", tuple())
- xAfterText.executeAction("UP", tuple())
- xFirstLine.executeAction("UP", tuple())
- xAutomaticChk.executeAction("CLICK", tuple())
- xAbovePar.executeAction("UP", tuple())
- xBelowPar.executeAction("UP", tuple())
- xChkspace.executeAction("CLICK", tuple())
- select_by_text(xLineSpacing, "Double")
- xActivate.executeAction("CLICK", tuple())
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xBeforeText = xDialog.getChild("spinED_LEFTINDENT")
- xAfterText = xDialog.getChild("spinED_RIGHTINDENT")
- xFirstLine = xDialog.getChild("spinED_FLINEINDENT")
- xAutomaticChk = xDialog.getChild("checkCB_AUTO")
- xAbovePar = xDialog.getChild("spinED_TOPDIST")
- xBelowPar = xDialog.getChild("spinED_BOTTOMDIST")
- xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING")
- xLineSpacing = xDialog.getChild("comboLB_LINEDIST")
- xActivate = xDialog.getChild("checkCB_REGISTER")
-
- self.assertEqual(get_state_as_dict(xBeforeText)["Text"], "0.50 ch")
- self.assertEqual(get_state_as_dict(xAfterText)["Text"], "0.50 ch")
- self.assertEqual(get_state_as_dict(xFirstLine)["Text"], "0.50 ch")
- self.assertEqual(get_state_as_dict(xAutomaticChk)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xAbovePar)["Text"], "0.50 line")
- self.assertEqual(get_state_as_dict(xBelowPar)["Text"], "0.50 line")
- self.assertEqual(get_state_as_dict(xChkspace)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xLineSpacing)["SelectEntryText"], "Double")
- self.assertEqual(get_state_as_dict(xActivate)["Selected"], "true")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+
+ xBeforeText = xDialog.getChild("spinED_LEFTINDENT")
+ xAfterText = xDialog.getChild("spinED_RIGHTINDENT")
+ xFirstLine = xDialog.getChild("spinED_FLINEINDENT")
+ xAutomaticChk = xDialog.getChild("checkCB_AUTO")
+ xAbovePar = xDialog.getChild("spinED_TOPDIST")
+ xBelowPar = xDialog.getChild("spinED_BOTTOMDIST")
+ xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING")
+ xLineSpacing = xDialog.getChild("comboLB_LINEDIST")
+ xActivate = xDialog.getChild("checkCB_REGISTER")
+
+ xBeforeText.executeAction("UP", tuple())
+ xAfterText.executeAction("UP", tuple())
+ xFirstLine.executeAction("UP", tuple())
+ xAutomaticChk.executeAction("CLICK", tuple())
+ xAbovePar.executeAction("UP", tuple())
+ xBelowPar.executeAction("UP", tuple())
+ xChkspace.executeAction("CLICK", tuple())
+ select_by_text(xLineSpacing, "Double")
+ xActivate.executeAction("CLICK", tuple())
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xBeforeText = xDialog.getChild("spinED_LEFTINDENT")
+ xAfterText = xDialog.getChild("spinED_RIGHTINDENT")
+ xFirstLine = xDialog.getChild("spinED_FLINEINDENT")
+ xAutomaticChk = xDialog.getChild("checkCB_AUTO")
+ xAbovePar = xDialog.getChild("spinED_TOPDIST")
+ xBelowPar = xDialog.getChild("spinED_BOTTOMDIST")
+ xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING")
+ xLineSpacing = xDialog.getChild("comboLB_LINEDIST")
+ xActivate = xDialog.getChild("checkCB_REGISTER")
+
+ self.assertEqual(get_state_as_dict(xBeforeText)["Text"], "0.50 ch")
+ self.assertEqual(get_state_as_dict(xAfterText)["Text"], "0.50 ch")
+ self.assertEqual(get_state_as_dict(xFirstLine)["Text"], "0.50 ch")
+ self.assertEqual(get_state_as_dict(xAutomaticChk)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xAbovePar)["Text"], "0.50 line")
+ self.assertEqual(get_state_as_dict(xBelowPar)["Text"], "0.50 line")
+ self.assertEqual(get_state_as_dict(xChkspace)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xLineSpacing)["SelectEntryText"], "Double")
+ self.assertEqual(get_state_as_dict(xActivate)["Selected"], "true")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_paragraph_tab_alignment(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
-
- xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION")
- xAlignment = xDialog.getChild("comboLB_VERTALIGN")
- xSnapToText = xDialog.getChild("checkCB_SNAP")
- xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN")
- xLastLine = xDialog.getChild("comboLB_LASTLINE")
- xExpandChk = xDialog.getChild("checkCB_EXPAND")
-
- select_by_text(xTextDirection, "Left-to-right (LTR)")
- select_by_text(xAlignment, "Top")
- xSnapToText.executeAction("CLICK", tuple())
- xJustified.executeAction("CLICK", tuple())
- select_by_text(xLastLine, "Justified")
- xExpandChk.executeAction("CLICK", tuple())
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
-
- xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION")
- xAlignment = xDialog.getChild("comboLB_VERTALIGN")
- xSnapToText = xDialog.getChild("checkCB_SNAP")
- xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN")
- xLastLine = xDialog.getChild("comboLB_LASTLINE")
- xExpandChk = xDialog.getChild("checkCB_EXPAND")
-
- self.assertEqual(get_state_as_dict(xTextDirection)["SelectEntryText"], "Left-to-right (LTR)")
- self.assertEqual(get_state_as_dict(xAlignment)["SelectEntryText"], "Top")
- self.assertEqual(get_state_as_dict(xSnapToText)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xJustified)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xLastLine)["SelectEntryText"], "Justified")
- self.assertEqual(get_state_as_dict(xExpandChk)["Selected"], "true")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION")
+ xAlignment = xDialog.getChild("comboLB_VERTALIGN")
+ xSnapToText = xDialog.getChild("checkCB_SNAP")
+ xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN")
+ xLastLine = xDialog.getChild("comboLB_LASTLINE")
+ xExpandChk = xDialog.getChild("checkCB_EXPAND")
+
+ select_by_text(xTextDirection, "Left-to-right (LTR)")
+ select_by_text(xAlignment, "Top")
+ xSnapToText.executeAction("CLICK", tuple())
+ xJustified.executeAction("CLICK", tuple())
+ select_by_text(xLastLine, "Justified")
+ xExpandChk.executeAction("CLICK", tuple())
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION")
+ xAlignment = xDialog.getChild("comboLB_VERTALIGN")
+ xSnapToText = xDialog.getChild("checkCB_SNAP")
+ xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN")
+ xLastLine = xDialog.getChild("comboLB_LASTLINE")
+ xExpandChk = xDialog.getChild("checkCB_EXPAND")
+
+ self.assertEqual(get_state_as_dict(xTextDirection)["SelectEntryText"], "Left-to-right (LTR)")
+ self.assertEqual(get_state_as_dict(xAlignment)["SelectEntryText"], "Top")
+ self.assertEqual(get_state_as_dict(xSnapToText)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xJustified)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xLastLine)["SelectEntryText"], "Justified")
+ self.assertEqual(get_state_as_dict(xExpandChk)["Selected"], "true")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_paragraph_tab_text_flow(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
-
- xAutomaticaly = xDialog.getChild("checkAuto")
- xEnd = xDialog.getChild("spinLineEnd")
- xBegin = xDialog.getChild("spinLineBegin")
- xMax = xDialog.getChild("spinMaxNum")
- xIns = xDialog.getChild("checkInsert")
- xType = xDialog.getChild("comboBreakType")
- xPosition = xDialog.getChild("comboBreakPosition")
- xspinOrphan = xDialog.getChild("spinOrphan")
- xspinWidow = xDialog.getChild("spinWidow")
- xcheckWidow = xDialog.getChild("checkWidow")
- xcheckOrphan = xDialog.getChild("checkOrphan")
- xcheckSplitPara = xDialog.getChild("checkSplitPara")
- xcheckKeepPara = xDialog.getChild("checkKeepPara")
-
- xAutomaticaly.executeAction("CLICK", tuple())
- xEnd.executeAction("UP", tuple())
- xBegin.executeAction("UP", tuple())
- xMax.executeAction("UP", tuple())
- xIns.executeAction("CLICK", tuple())
- select_by_text(xType, "Column")
- select_by_text(xPosition, "After")
- xspinOrphan.executeAction("UP", tuple())
- xspinWidow.executeAction("UP", tuple())
- xcheckWidow.executeAction("CLICK", tuple())
- xcheckOrphan.executeAction("CLICK", tuple())
- xcheckSplitPara.executeAction("CLICK", tuple())
- xcheckKeepPara.executeAction("CLICK", tuple())
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
-
- xAutomaticaly = xDialog.getChild("checkAuto")
- xEnd = xDialog.getChild("spinLineEnd")
- xBegin = xDialog.getChild("spinLineBegin")
- xMax = xDialog.getChild("spinMaxNum")
- xIns = xDialog.getChild("checkInsert")
- xType = xDialog.getChild("comboBreakType")
- xPosition = xDialog.getChild("comboBreakPosition")
- xspinOrphan = xDialog.getChild("spinOrphan")
- xspinWidow = xDialog.getChild("spinWidow")
- xcheckWidow = xDialog.getChild("checkWidow")
- xcheckOrphan = xDialog.getChild("checkOrphan")
- xcheckSplitPara = xDialog.getChild("checkSplitPara")
- xcheckKeepPara = xDialog.getChild("checkKeepPara")
-
- self.assertEqual(get_state_as_dict(xAutomaticaly)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xEnd)["Text"], "3")
- self.assertEqual(get_state_as_dict(xBegin)["Text"], "3")
- self.assertEqual(get_state_as_dict(xMax)["Text"], "1")
- self.assertEqual(get_state_as_dict(xIns)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Column")
- self.assertEqual(get_state_as_dict(xPosition)["SelectEntryText"], "After")
- self.assertEqual(get_state_as_dict(xspinOrphan)["Text"], "2")
- self.assertEqual(get_state_as_dict(xspinWidow)["Text"], "2")
- self.assertEqual(get_state_as_dict(xcheckWidow)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xcheckOrphan)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xcheckSplitPara)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xcheckKeepPara)["Selected"], "true")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xAutomaticaly = xDialog.getChild("checkAuto")
+ xEnd = xDialog.getChild("spinLineEnd")
+ xBegin = xDialog.getChild("spinLineBegin")
+ xMax = xDialog.getChild("spinMaxNum")
+ xIns = xDialog.getChild("checkInsert")
+ xType = xDialog.getChild("comboBreakType")
+ xPosition = xDialog.getChild("comboBreakPosition")
+ xspinOrphan = xDialog.getChild("spinOrphan")
+ xspinWidow = xDialog.getChild("spinWidow")
+ xcheckWidow = xDialog.getChild("checkWidow")
+ xcheckOrphan = xDialog.getChild("checkOrphan")
+ xcheckSplitPara = xDialog.getChild("checkSplitPara")
+ xcheckKeepPara = xDialog.getChild("checkKeepPara")
+
+ xAutomaticaly.executeAction("CLICK", tuple())
+ xEnd.executeAction("UP", tuple())
+ xBegin.executeAction("UP", tuple())
+ xMax.executeAction("UP", tuple())
+ xIns.executeAction("CLICK", tuple())
+ select_by_text(xType, "Column")
+ select_by_text(xPosition, "After")
+ xspinOrphan.executeAction("UP", tuple())
+ xspinWidow.executeAction("UP", tuple())
+ xcheckWidow.executeAction("CLICK", tuple())
+ xcheckOrphan.executeAction("CLICK", tuple())
+ xcheckSplitPara.executeAction("CLICK", tuple())
+ xcheckKeepPara.executeAction("CLICK", tuple())
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xAutomaticaly = xDialog.getChild("checkAuto")
+ xEnd = xDialog.getChild("spinLineEnd")
+ xBegin = xDialog.getChild("spinLineBegin")
+ xMax = xDialog.getChild("spinMaxNum")
+ xIns = xDialog.getChild("checkInsert")
+ xType = xDialog.getChild("comboBreakType")
+ xPosition = xDialog.getChild("comboBreakPosition")
+ xspinOrphan = xDialog.getChild("spinOrphan")
+ xspinWidow = xDialog.getChild("spinWidow")
+ xcheckWidow = xDialog.getChild("checkWidow")
+ xcheckOrphan = xDialog.getChild("checkOrphan")
+ xcheckSplitPara = xDialog.getChild("checkSplitPara")
+ xcheckKeepPara = xDialog.getChild("checkKeepPara")
+
+ self.assertEqual(get_state_as_dict(xAutomaticaly)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xEnd)["Text"], "3")
+ self.assertEqual(get_state_as_dict(xBegin)["Text"], "3")
+ self.assertEqual(get_state_as_dict(xMax)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xIns)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Column")
+ self.assertEqual(get_state_as_dict(xPosition)["SelectEntryText"], "After")
+ self.assertEqual(get_state_as_dict(xspinOrphan)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xspinWidow)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xcheckWidow)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckOrphan)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckSplitPara)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xcheckKeepPara)["Selected"], "true")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_paragraph_tab_asian_typography(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "3")
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
- xcheckForbidList = xDialog.getChild("checkForbidList")
- xcheckHangPunct = xDialog.getChild("checkHangPunct")
- xcheckApplySpacing = xDialog.getChild("checkApplySpacing")
+ xcheckForbidList = xDialog.getChild("checkForbidList")
+ xcheckHangPunct = xDialog.getChild("checkHangPunct")
+ xcheckApplySpacing = xDialog.getChild("checkApplySpacing")
- xcheckForbidList.executeAction("CLICK", tuple())
- xcheckHangPunct.executeAction("CLICK", tuple())
- xcheckApplySpacing.executeAction("CLICK", tuple())
+ xcheckForbidList.executeAction("CLICK", tuple())
+ xcheckHangPunct.executeAction("CLICK", tuple())
+ xcheckApplySpacing.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "3")
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
- xcheckForbidList = xDialog.getChild("checkForbidList")
- xcheckHangPunct = xDialog.getChild("checkHangPunct")
- xcheckApplySpacing = xDialog.getChild("checkApplySpacing")
+ xcheckForbidList = xDialog.getChild("checkForbidList")
+ xcheckHangPunct = xDialog.getChild("checkHangPunct")
+ xcheckApplySpacing = xDialog.getChild("checkApplySpacing")
- self.assertEqual(get_state_as_dict(xcheckForbidList)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xcheckHangPunct)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xcheckApplySpacing)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckForbidList)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckHangPunct)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckApplySpacing)["Selected"], "false")
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_paragraph_tab_outline_numbering(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
-
- xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
- xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
- xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
- xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")
-
- select_by_text(xOutline, "Level 1")
- select_by_text(xNumbering, "Bullet •")
- xPara.executeAction("CLICK", tuple())
- xParaSpin.executeAction("UP", tuple())
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
-
- xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
- xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
- xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
- xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")
-
- self.assertEqual(get_state_as_dict(xOutline)["SelectEntryText"], "Level 1")
- self.assertEqual(get_state_as_dict(xNumbering)["SelectEntryText"], "Bullet •")
- self.assertEqual(get_state_as_dict(xPara)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xParaSpin)["Text"], "2")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+
+ xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
+ xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
+ xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
+ xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")
+
+ select_by_text(xOutline, "Level 1")
+ select_by_text(xNumbering, "Bullet •")
+ xPara.executeAction("CLICK", tuple())
+ xParaSpin.executeAction("UP", tuple())
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+
+ xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
+ xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
+ xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
+ xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")
+
+ self.assertEqual(get_state_as_dict(xOutline)["SelectEntryText"], "Level 1")
+ self.assertEqual(get_state_as_dict(xNumbering)["SelectEntryText"], "Bullet •")
+ self.assertEqual(get_state_as_dict(xPara)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xParaSpin)["Text"], "2")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_paragraph_tab_tabs(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- change_measurement_unit(self, "Centimeter")
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL")
- xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR")
- xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER")
- xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER")
- xNewButtn = xDialog.getChild("buttonBTN_NEW")
- xED_TABPOS = xDialog.getChild("ED_TABPOS")
-
- xDecimal.executeAction("CLICK", tuple())
- xDecimalTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xDecimalTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"i"}))
- xFill.executeAction("CLICK", tuple())
- xFillTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xFillTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"p"}))
- xED_TABPOS.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xED_TABPOS.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- xNewButtn.executeAction("CLICK", tuple())
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL")
- xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR")
- xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER")
- xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER")
- xNewButtn = xDialog.getChild("buttonBTN_NEW")
- xED_TABPOS = xDialog.getChild("ED_TABPOS")
-
- self.assertEqual(get_state_as_dict(xDecimal)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xDecimalTxt)["Text"], "i")
- self.assertEqual(get_state_as_dict(xFill)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xFillTxt)["Text"], "p")
- self.assertEqual(get_state_as_dict(xED_TABPOS)["Text"], "1.00 cm")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER")
- xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE")
- xNewButtn = xDialog.getChild("buttonBTN_NEW")
-
- xCentered.executeAction("CLICK", tuple())
- xUnderscore.executeAction("CLICK", tuple())
- xNewButtn.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER")
- xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE")
- self.assertEqual(get_state_as_dict(xCentered)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xUnderscore)["Checked"], "true")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN")
- xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE")
- xNewButtn = xDialog.getChild("buttonBTN_NEW")
-
- xRight.executeAction("CLICK", tuple())
- xDashLine.executeAction("CLICK", tuple())
- xNewButtn.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN")
- xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE")
- self.assertEqual(get_state_as_dict(xRight)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xDashLine)["Checked"], "true")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN")
- xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS")
- xNewButtn = xDialog.getChild("buttonBTN_NEW")
-
- xLeft.executeAction("CLICK", tuple())
- xPointsLine.executeAction("CLICK", tuple())
- xNewButtn.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN")
- xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS")
- self.assertEqual(get_state_as_dict(xLeft)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xPointsLine)["Checked"], "true")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ change_measurement_unit(self, "Centimeter")
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL")
+ xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR")
+ xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER")
+ xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+ xED_TABPOS = xDialog.getChild("ED_TABPOS")
+
+ xDecimal.executeAction("CLICK", tuple())
+ xDecimalTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xDecimalTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"i"}))
+ xFill.executeAction("CLICK", tuple())
+ xFillTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xFillTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"p"}))
+ xED_TABPOS.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xED_TABPOS.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ xNewButtn.executeAction("CLICK", tuple())
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL")
+ xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR")
+ xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER")
+ xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+ xED_TABPOS = xDialog.getChild("ED_TABPOS")
+
+ self.assertEqual(get_state_as_dict(xDecimal)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xDecimalTxt)["Text"], "i")
+ self.assertEqual(get_state_as_dict(xFill)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xFillTxt)["Text"], "p")
+ self.assertEqual(get_state_as_dict(xED_TABPOS)["Text"], "1.00 cm")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER")
+ xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+
+ xCentered.executeAction("CLICK", tuple())
+ xUnderscore.executeAction("CLICK", tuple())
+ xNewButtn.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER")
+ xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE")
+ self.assertEqual(get_state_as_dict(xCentered)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xUnderscore)["Checked"], "true")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN")
+ xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+
+ xRight.executeAction("CLICK", tuple())
+ xDashLine.executeAction("CLICK", tuple())
+ xNewButtn.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN")
+ xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE")
+ self.assertEqual(get_state_as_dict(xRight)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xDashLine)["Checked"], "true")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN")
+ xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+
+ xLeft.executeAction("CLICK", tuple())
+ xPointsLine.executeAction("CLICK", tuple())
+ xNewButtn.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN")
+ xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS")
+ self.assertEqual(get_state_as_dict(xLeft)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xPointsLine)["Checked"], "true")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_paragraph_tab_drop_caps(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "6")
-
- xDisplay = xDialog.getChild("checkCB_SWITCH")
- xWholeWord = xDialog.getChild("checkCB_WORD")
- xLines = xDialog.getChild("spinFLD_LINES")
- xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
- xText = xDialog.getChild("entryEDT_TEXT")
- xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")
-
- xDisplay.executeAction("CLICK", tuple())
- xWholeWord.executeAction("CLICK", tuple())
- xLines.executeAction("UP", tuple())
- xSpaceToText.executeAction("UP", tuple())
- xText.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
- select_by_text(xCharStyle, "Definition")
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "6")
-
- xDisplay = xDialog.getChild("checkCB_SWITCH")
- xWholeWord = xDialog.getChild("checkCB_WORD")
- xLines = xDialog.getChild("spinFLD_LINES")
- xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
- xText = xDialog.getChild("entryEDT_TEXT")
- xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")
-
- self.assertEqual(get_state_as_dict(xDisplay)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xWholeWord)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xText)["Text"], "A")
- self.assertEqual(get_state_as_dict(xCharStyle)["SelectEntryText"], "Definition")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6")
+
+ xDisplay = xDialog.getChild("checkCB_SWITCH")
+ xWholeWord = xDialog.getChild("checkCB_WORD")
+ xLines = xDialog.getChild("spinFLD_LINES")
+ xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
+ xText = xDialog.getChild("entryEDT_TEXT")
+ xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")
+
+ xDisplay.executeAction("CLICK", tuple())
+ xWholeWord.executeAction("CLICK", tuple())
+ xLines.executeAction("UP", tuple())
+ xSpaceToText.executeAction("UP", tuple())
+ xText.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
+ select_by_text(xCharStyle, "Definition")
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6")
+
+ xDisplay = xDialog.getChild("checkCB_SWITCH")
+ xWholeWord = xDialog.getChild("checkCB_WORD")
+ xLines = xDialog.getChild("spinFLD_LINES")
+ xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
+ xText = xDialog.getChild("entryEDT_TEXT")
+ xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")
+
+ self.assertEqual(get_state_as_dict(xDisplay)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xWholeWord)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xText)["Text"], "A")
+ self.assertEqual(get_state_as_dict(xCharStyle)["SelectEntryText"], "Definition")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.close_doc()
def test_format_paragraph_tab_borders(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- change_measurement_unit(self, "Centimeter")
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "7")
-
- xStyle = xDialog.getChild("linestylelb")
- xwidth = xDialog.getChild("linewidthmf")
- xSync = xDialog.getChild("sync")
- xLeft = xDialog.getChild("leftmf")
- xRight = xDialog.getChild("rightmf")
- xTop = xDialog.getChild("topmf")
- xBottom = xDialog.getChild("bottommf")
- xMerge = xDialog.getChild("mergewithnext")
-
- xwidth.executeAction("UP", tuple())
- xSync.executeAction("CLICK", tuple())
- xLeft.executeAction("UP", tuple())
- xLeft.executeAction("UP", tuple())
- xRight.executeAction("UP", tuple())
- xTop.executeAction("UP", tuple())
- xBottom.executeAction("UP", tuple())
- xMerge.executeAction("CLICK", tuple())
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "7")
-
- xStyle = xDialog.getChild("linestylelb")
- xwidth = xDialog.getChild("linewidthmf")
- xSync = xDialog.getChild("sync")
- xLeft = xDialog.getChild("leftmf")
- xRight = xDialog.getChild("rightmf")
- xTop = xDialog.getChild("topmf")
- xBottom = xDialog.getChild("bottommf")
- xMerge = xDialog.getChild("mergewithnext")
-
- self.assertEqual(get_state_as_dict(xSync)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xMerge)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xLeft)["Text"], "0.20 cm")
- self.assertEqual(get_state_as_dict(xRight)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTop)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xBottom)["Text"], "0.10 cm")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ change_measurement_unit(self, "Centimeter")
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "7")
+
+ xStyle = xDialog.getChild("linestylelb")
+ xwidth = xDialog.getChild("linewidthmf")
+ xSync = xDialog.getChild("sync")
+ xLeft = xDialog.getChild("leftmf")
+ xRight = xDialog.getChild("rightmf")
+ xTop = xDialog.getChild("topmf")
+ xBottom = xDialog.getChild("bottommf")
+ xMerge = xDialog.getChild("mergewithnext")
+
+ xwidth.executeAction("UP", tuple())
+ xSync.executeAction("CLICK", tuple())
+ xLeft.executeAction("UP", tuple())
+ xLeft.executeAction("UP", tuple())
+ xRight.executeAction("UP", tuple())
+ xTop.executeAction("UP", tuple())
+ xBottom.executeAction("UP", tuple())
+ xMerge.executeAction("CLICK", tuple())
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "7")
+
+ xStyle = xDialog.getChild("linestylelb")
+ xwidth = xDialog.getChild("linewidthmf")
+ xSync = xDialog.getChild("sync")
+ xLeft = xDialog.getChild("leftmf")
+ xRight = xDialog.getChild("rightmf")
+ xTop = xDialog.getChild("topmf")
+ xBottom = xDialog.getChild("bottommf")
+ xMerge = xDialog.getChild("mergewithnext")
+
+ self.assertEqual(get_state_as_dict(xSync)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xMerge)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xLeft)["Text"], "0.20 cm")
+ self.assertEqual(get_state_as_dict(xRight)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTop)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xBottom)["Text"], "0.10 cm")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.close_doc()
def test_format_paragraph_area(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "8")
-
- xColor = xDialog.getChild("btncolor")
- xGradient = xDialog.getChild("btngradient")
- xBitmap = xDialog.getChild("btnbitmap")
- xPattern = xDialog.getChild("btnpattern")
- xHatch = xDialog.getChild("btnhatch")
-
- xColor.executeAction("CLICK", tuple())
- xGradient.executeAction("CLICK", tuple())
- xBitmap.executeAction("CLICK", tuple())
- xPattern.executeAction("CLICK", tuple())
- xHatch.executeAction("CLICK", tuple())
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "8")
+
+ xColor = xDialog.getChild("btncolor")
+ xGradient = xDialog.getChild("btngradient")
+ xBitmap = xDialog.getChild("btnbitmap")
+ xPattern = xDialog.getChild("btnpattern")
+ xHatch = xDialog.getChild("btnhatch")
+
+ xColor.executeAction("CLICK", tuple())
+ xGradient.executeAction("CLICK", tuple())
+ xBitmap.executeAction("CLICK", tuple())
+ xPattern.executeAction("CLICK", tuple())
+ xHatch.executeAction("CLICK", tuple())
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.close_doc()
def test_format_paragraph_transparency(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "9")
-
- xTran = xDialog.getChild("RBT_TRANS_LINEAR")
- xTranText = xDialog.getChild("MTR_TRANSPARENT")
-
- xTran.executeAction("CLICK", tuple())
- xTranText.executeAction("UP", tuple())
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "9")
-
- xTran = xDialog.getChild("RBT_TRANS_LINEAR")
- xTranText = xDialog.getChild("MTR_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xTran)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xTranText)["Text"], "51%")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "9")
-
- xGradient = xDialog.getChild("RBT_TRANS_GRADIENT")
- xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES")
- xAngle = xDialog.getChild("MTR_TRGR_ANGLE")
- xBorder = xDialog.getChild("MTR_TRGR_BORDER")
- xStart = xDialog.getChild("MTR_TRGR_START_VALUE")
- xEnd = xDialog.getChild("MTR_TRGR_END_VALUE")
-
- xGradient.executeAction("CLICK", tuple())
- select_by_text(xType, "Axial")
- xAngle.executeAction("UP", tuple())
- xBorder.executeAction("UP", tuple())
- xStart.executeAction("UP", tuple())
- xEnd.executeAction("UP", tuple())
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "9")
-
- xGradient = xDialog.getChild("RBT_TRANS_GRADIENT")
- xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES")
- xAngle = xDialog.getChild("MTR_TRGR_ANGLE")
- xBorder = xDialog.getChild("MTR_TRGR_BORDER")
- xStart = xDialog.getChild("MTR_TRGR_START_VALUE")
- xEnd = xDialog.getChild("MTR_TRGR_END_VALUE")
-
- self.assertEqual(get_state_as_dict(xGradient)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Axial")
- self.assertEqual(get_state_as_dict(xAngle)["Text"], "1°")
- self.assertEqual(get_state_as_dict(xBorder)["Text"], "1%")
- self.assertEqual(get_state_as_dict(xStart)["Text"], "1%")
- self.assertEqual(get_state_as_dict(xEnd)["Text"], "1%")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "9")
+
+ xTran = xDialog.getChild("RBT_TRANS_LINEAR")
+ xTranText = xDialog.getChild("MTR_TRANSPARENT")
+
+ xTran.executeAction("CLICK", tuple())
+ xTranText.executeAction("UP", tuple())
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "9")
+
+ xTran = xDialog.getChild("RBT_TRANS_LINEAR")
+ xTranText = xDialog.getChild("MTR_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xTran)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xTranText)["Text"], "51%")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "9")
+
+ xGradient = xDialog.getChild("RBT_TRANS_GRADIENT")
+ xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES")
+ xAngle = xDialog.getChild("MTR_TRGR_ANGLE")
+ xBorder = xDialog.getChild("MTR_TRGR_BORDER")
+ xStart = xDialog.getChild("MTR_TRGR_START_VALUE")
+ xEnd = xDialog.getChild("MTR_TRGR_END_VALUE")
+
+ xGradient.executeAction("CLICK", tuple())
+ select_by_text(xType, "Axial")
+ xAngle.executeAction("UP", tuple())
+ xBorder.executeAction("UP", tuple())
+ xStart.executeAction("UP", tuple())
+ xEnd.executeAction("UP", tuple())
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "9")
+
+ xGradient = xDialog.getChild("RBT_TRANS_GRADIENT")
+ xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES")
+ xAngle = xDialog.getChild("MTR_TRGR_ANGLE")
+ xBorder = xDialog.getChild("MTR_TRGR_BORDER")
+ xStart = xDialog.getChild("MTR_TRGR_START_VALUE")
+ xEnd = xDialog.getChild("MTR_TRGR_END_VALUE")
+
+ self.assertEqual(get_state_as_dict(xGradient)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Axial")
+ self.assertEqual(get_state_as_dict(xAngle)["Text"], "1°")
+ self.assertEqual(get_state_as_dict(xBorder)["Text"], "1%")
+ self.assertEqual(get_state_as_dict(xStart)["Text"], "1%")
+ self.assertEqual(get_state_as_dict(xEnd)["Text"], "1%")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/horizontalLine.py b/sw/qa/uitest/writer_tests2/horizontalLine.py
index 2324ed663495..f004badfc6ec 100644
--- a/sw/qa/uitest/writer_tests2/horizontalLine.py
+++ b/sw/qa/uitest/writer_tests2/horizontalLine.py
@@ -11,29 +11,30 @@ from uitest.uihelper.common import get_state_as_dict, type_text
class WriterInsertHorizontalLine(UITestCase):
def test_insert_horizontal_line(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "Test horizontal line") #write the text
+ type_text(xWriterEdit, "Test horizontal line") #write the text
- self.xUITest.executeCommand(".uno:StyleApply?Style:string=Horizontal%20Line&FamilyName:string=ParagraphStyles") #insert horizontal line
+ self.xUITest.executeCommand(".uno:StyleApply?Style:string=Horizontal%20Line&FamilyName:string=ParagraphStyles") #insert horizontal line
- self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog
- xDialog = self.xUITest.getTopFocusWindow()
- xStyleNametxt = xDialog.getChild("name")
- self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
- xCancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancBtn)
+ self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog
+ xDialog = self.xUITest.getTopFocusWindow()
+ xStyleNametxt = xDialog.getChild("name")
+ self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
+ xCancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancBtn)
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Redo")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Redo")
- self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog
- xDialog = self.xUITest.getTopFocusWindow()
- xStyleNametxt = xDialog.getChild("name")
- self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
- xCancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancBtn)
+ self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog
+ xDialog = self.xUITest.getTopFocusWindow()
+ xStyleNametxt = xDialog.getChild("name")
+ self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
+ xCancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/insertFootnote.py b/sw/qa/uitest/writer_tests2/insertFootnote.py
index 4144d2898d5c..e391f6520477 100644
--- a/sw/qa/uitest/writer_tests2/insertFootnote.py
+++ b/sw/qa/uitest/writer_tests2/insertFootnote.py
@@ -10,25 +10,26 @@ from uitest.uihelper.common import type_text
class insertFootnote(UITestCase):
def test_insert_footnote(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.xUITest.executeCommand(".uno:InsertFootnote")
+ self.xUITest.executeCommand(".uno:InsertFootnote")
- type_text(xWriterEdit, "LibreOffice")
- self.assertEqual(document.Footnotes[0].String, "LibreOffice")
- self.assertEqual(document.Footnotes.getCount(), 1)
+ type_text(xWriterEdit, "LibreOffice")
+ self.assertEqual(document.Footnotes[0].String, "LibreOffice")
+ self.assertEqual(document.Footnotes.getCount(), 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Footnotes[0].String, "")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Footnotes.getCount(), 0)
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(document.Footnotes[0].String, "")
- self.assertEqual(document.Footnotes.getCount(), 1)
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(document.Footnotes[0].String, "LibreOffice")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Footnotes[0].String, "")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Footnotes.getCount(), 0)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Footnotes[0].String, "")
+ self.assertEqual(document.Footnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Footnotes[0].String, "LibreOffice")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/pasteSpecial.py b/sw/qa/uitest/writer_tests2/pasteSpecial.py
index 178b9d61d043..2af43215d99d 100644
--- a/sw/qa/uitest/writer_tests2/pasteSpecial.py
+++ b/sw/qa/uitest/writer_tests2/pasteSpecial.py
@@ -10,30 +10,32 @@ from uitest.uihelper.common import type_text
class PasteSpecial(UITestCase):
def test_pasteSpecial(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "test")
+ type_text(xWriterEdit, "test")
- for i in range(5):
- self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Copy")
+ for i in range(5):
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Copy")
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow()
- xList = xDialog.getChild('list')
- xChild = xList.getChild(str(i))
+ xList = xDialog.getChild('list')
+ xChild = xList.getChild(str(i))
- xChild.executeAction("SELECT", tuple())
+ xChild.executeAction("SELECT", tuple())
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Text.String, "test")
+ self.assertEqual(document.Text.String, "test")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/tdf116474.py b/sw/qa/uitest/writer_tests2/tdf116474.py
index 81de4397ec47..e6436b73fd73 100644
--- a/sw/qa/uitest/writer_tests2/tdf116474.py
+++ b/sw/qa/uitest/writer_tests2/tdf116474.py
@@ -11,36 +11,37 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf116474(UITestCase):
def test_tdf116474_insert_caption_undo(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- text = document.getText()
- cursor = text.createTextCursor()
- textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
- provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
- graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")}))
- textGraphic.Graphic = graphic
- text.insertTextContent(cursor, textGraphic, False)
- #select image
- document.getCurrentController().select(document.getDrawPage()[0])
-
- self.ui_test.execute_dialog_through_command(".uno:InsertCaptionDialog") # caption
- xDialogCaption = self.xUITest.getTopFocusWindow()
-
- xCapt = xDialogCaption.getChild("caption_edit")
- xCapt.executeAction("TYPE", mkPropertyValues({"TEXT":"Caption"}))
-
- xOkBtn=xDialogCaption.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- xFrame = document.TextFrames[0]
- self.assertEqual(document.TextFrames[0].Text.String, "Figure 1: Caption")
- self.assertEqual(document.GraphicObjects.getCount(), 1) #nr. of images
- #Undo, redo
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Redo")
- #Verify
- self.assertEqual(document.TextFrames[0].Text.String, "Figure 1: Caption")
- self.assertEqual(document.GraphicObjects.getCount(), 1) #nr. of images
-
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ text = document.getText()
+ cursor = text.createTextCursor()
+ textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
+ provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
+ graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")}))
+ textGraphic.Graphic = graphic
+ text.insertTextContent(cursor, textGraphic, False)
+ #select image
+ document.getCurrentController().select(document.getDrawPage()[0])
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertCaptionDialog") # caption
+ xDialogCaption = self.xUITest.getTopFocusWindow()
+
+ xCapt = xDialogCaption.getChild("caption_edit")
+ xCapt.executeAction("TYPE", mkPropertyValues({"TEXT":"Caption"}))
+
+ xOkBtn=xDialogCaption.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ xFrame = document.TextFrames[0]
+ self.assertEqual(document.TextFrames[0].Text.String, "Figure 1: Caption")
+ self.assertEqual(document.GraphicObjects.getCount(), 1) #nr. of images
+ #Undo, redo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Redo")
+ #Verify
+ self.assertEqual(document.TextFrames[0].Text.String, "Figure 1: Caption")
+ self.assertEqual(document.GraphicObjects.getCount(), 1) #nr. of images
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/autoredactDialog.py b/sw/qa/uitest/writer_tests3/autoredactDialog.py
index be0a794c2353..9d3281456ca1 100644
--- a/sw/qa/uitest/writer_tests3/autoredactDialog.py
+++ b/sw/qa/uitest/writer_tests3/autoredactDialog.py
@@ -46,82 +46,30 @@ class AutoRedactDialog(UITestCase):
def test_open_AutoRedactDialog_writer(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xDialog = self.launch_and_get_autoredact_dialog()
- xcancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ xDialog = self.launch_and_get_autoredact_dialog()
+ xcancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancBtn)
+ self.ui_test.close_doc()
def test_add_target(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xDialog = self.launch_and_get_autoredact_dialog()
- xAddBtn = xDialog.getChild("add")
-
- # Make sure we are starting with an empty targets list
- self.clearTargetsbox(xDialog)
-
- # Names need to be distinct
- # ["target name", "target content"],
- targets_list = [
- ["target1", "content1"],
- ["target2", "content2"],
- ["target3", "content3"],
- ]
-
- for i in range(0, len(targets_list)):
- self.add_target_counter = i
- with self.ui_test.execute_blocking_action(xAddBtn.executeAction, args=('CLICK', ()), close_button="close") as dialog:
- xNewNameTxt=dialog.getChild("name")
- xNewContentTxt=dialog.getChild("content")
- xTypeList = dialog.getChild("type") #0: Text, 1: Regex, 2: Predefined
-
- select_pos(xTypeList, 0) #Text
- self.assertEqual(int(get_state_as_dict(xTypeList)["SelectEntryPos"]), 0)
-
- type_text(xNewNameTxt, targets_list[self.add_target_counter][0])
- type_text(xNewContentTxt, targets_list[self.add_target_counter][1])
-
- # Make sure targets are added successfully
- xTargetsListbox = xDialog.getChild("targets")
- targets_box_state_dict = get_state_as_dict(xTargetsListbox)
- self.assertEqual(int(targets_box_state_dict["Children"]), len(targets_list))
-
- # Make sure targets are added with correct names and contents
- for i in range(0, len(targets_list)):
- child = xTargetsListbox.getChild(i)
- child_text = self.parseTargetContent(child)
- self.assertEqual(child_text[0], targets_list[i][0]) #name
- self.assertEqual(child_text[2], targets_list[i][1]) #content
-
- xcancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancBtn)
-
- # Now let's make sure the dialog remembers last state
- xDialog = self.launch_and_get_autoredact_dialog()
- xTargetsListbox = xDialog.getChild("targets")
- targets_box_state_dict = get_state_as_dict(xTargetsListbox)
- self.assertEqual(int(targets_box_state_dict["Children"]), len(targets_list))
-
- # Make sure targets are remembered with correct names and contents
- for i in range(0, len(targets_list)):
- child = xTargetsListbox.getChild(i)
- child_text = self.parseTargetContent(child)
- self.assertEqual(child_text[0], targets_list[i][0]) #name
- self.assertEqual(child_text[2], targets_list[i][1]) #content
-
- xcancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancBtn)
-
-
- def test_edit_target(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xDialog = self.launch_and_get_autoredact_dialog()
- xAddBtn = xDialog.getChild("add")
- xEditBtn = xDialog.getChild("edit")
-
- # Make sure we are starting with an empty targets list
- self.clearTargetsbox(xDialog)
-
- # We first need to add a target so that we can edit it
+ self.ui_test.create_doc_in_start_center("writer")
+ xDialog = self.launch_and_get_autoredact_dialog()
+ xAddBtn = xDialog.getChild("add")
+
+ # Make sure we are starting with an empty targets list
+ self.clearTargetsbox(xDialog)
+
+ # Names need to be distinct
+ # ["target name", "target content"],
+ targets_list = [
+ ["target1", "content1"],
+ ["target2", "content2"],
+ ["target3", "content3"],
+ ]
+
+ for i in range(0, len(targets_list)):
+ self.add_target_counter = i
with self.ui_test.execute_blocking_action(xAddBtn.executeAction, args=('CLICK', ()), close_button="close") as dialog:
xNewNameTxt=dialog.getChild("name")
xNewContentTxt=dialog.getChild("content")
@@ -130,42 +78,99 @@ class AutoRedactDialog(UITestCase):
select_pos(xTypeList, 0) #Text
self.assertEqual(int(get_state_as_dict(xTypeList)["SelectEntryPos"]), 0)
- type_text(xNewNameTxt, "TestTarget")
- type_text(xNewContentTxt, "TestContent")
+ type_text(xNewNameTxt, targets_list[self.add_target_counter][0])
+ type_text(xNewContentTxt, targets_list[self.add_target_counter][1])
+
+ # Make sure targets are added successfully
+ xTargetsListbox = xDialog.getChild("targets")
+ targets_box_state_dict = get_state_as_dict(xTargetsListbox)
+ self.assertEqual(int(targets_box_state_dict["Children"]), len(targets_list))
+
+ # Make sure targets are added with correct names and contents
+ for i in range(0, len(targets_list)):
+ child = xTargetsListbox.getChild(i)
+ child_text = self.parseTargetContent(child)
+ self.assertEqual(child_text[0], targets_list[i][0]) #name
+ self.assertEqual(child_text[2], targets_list[i][1]) #content
+
+ xcancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancBtn)
+
+ # Now let's make sure the dialog remembers last state
+ xDialog = self.launch_and_get_autoredact_dialog()
+ xTargetsListbox = xDialog.getChild("targets")
+ targets_box_state_dict = get_state_as_dict(xTargetsListbox)
+ self.assertEqual(int(targets_box_state_dict["Children"]), len(targets_list))
+
+ # Make sure targets are remembered with correct names and contents
+ for i in range(0, len(targets_list)):
+ child = xTargetsListbox.getChild(i)
+ child_text = self.parseTargetContent(child)
+ self.assertEqual(child_text[0], targets_list[i][0]) #name
+ self.assertEqual(child_text[2], targets_list[i][1]) #content
- # Make sure target is added successfully
- xTargetsListbox = xDialog.getChild("targets")
- targets_box_state_dict = get_state_as_dict(xTargetsListbox)
- self.assertEqual(int(targets_box_state_dict["Children"]), 1)
+ xcancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancBtn)
- # Select the added target
- target_entry = xTargetsListbox.getChild(0)
- target_entry.executeAction("SELECT", tuple())
+ self.ui_test.close_doc()
- # Now edit the target
- with self.ui_test.execute_blocking_action(xEditBtn.executeAction, args=('CLICK', ()), close_button="close") as dialog:
- xNameTxt=dialog.getChild("name")
- xContentTxt=dialog.getChild("content")
- xNameTxt.executeAction("CLEAR", tuple())
- xContentTxt.executeAction("CLEAR", tuple())
+ def test_edit_target(self):
+ self.ui_test.create_doc_in_start_center("writer")
+ xDialog = self.launch_and_get_autoredact_dialog()
+ xAddBtn = xDialog.getChild("add")
+ xEditBtn = xDialog.getChild("edit")
+
+ # Make sure we are starting with an empty targets list
+ self.clearTargetsbox(xDialog)
+
+ # We first need to add a target so that we can edit it
+ with self.ui_test.execute_blocking_action(xAddBtn.executeAction, args=('CLICK', ()), close_button="close") as dialog:
+ xNewNameTxt=dialog.getChild("name")
+ xNewContentTxt=dialog.getChild("content")
+ xTypeList = dialog.getChild("type") #0: Text, 1: Regex, 2: Predefined
+
+ select_pos(xTypeList, 0) #Text
+ self.assertEqual(int(get_state_as_dict(xTypeList)["SelectEntryPos"]), 0)
+
+ type_text(xNewNameTxt, "TestTarget")
+ type_text(xNewContentTxt, "TestContent")
+
+ # Make sure target is added successfully
+ xTargetsListbox = xDialog.getChild("targets")
+ targets_box_state_dict = get_state_as_dict(xTargetsListbox)
+ self.assertEqual(int(targets_box_state_dict["Children"]), 1)
+
+ # Select the added target
+ target_entry = xTargetsListbox.getChild(0)
+ target_entry.executeAction("SELECT", tuple())
+
+ # Now edit the target
+ with self.ui_test.execute_blocking_action(xEditBtn.executeAction, args=('CLICK', ()), close_button="close") as dialog:
+ xNameTxt=dialog.getChild("name")
+ xContentTxt=dialog.getChild("content")
- type_text(xNameTxt, "TestTargetEdited")
- type_text(xContentTxt, "TestContentEdited")
+ xNameTxt.executeAction("CLEAR", tuple())
+ xContentTxt.executeAction("CLEAR", tuple())
+
+ type_text(xNameTxt, "TestTargetEdited")
+ type_text(xContentTxt, "TestContentEdited")
+
+ # Make sure target is still there
+ xTargetsListbox = xDialog.getChild("targets")
+ targets_box_state_dict = get_state_as_dict(xTargetsListbox)
+ self.assertEqual(int(targets_box_state_dict["Children"]), 1)
- # Make sure target is still there
- xTargetsListbox = xDialog.getChild("targets")
- targets_box_state_dict = get_state_as_dict(xTargetsListbox)
- self.assertEqual(int(targets_box_state_dict["Children"]), 1)
+ # Make sure target has the new values
+ target_entry = xTargetsListbox.getChild(0)
+ target_text = self.parseTargetContent(target_entry)
+ self.assertEqual(target_text[0], "TestTargetEdited") #name
+ self.assertEqual(target_text[2], "TestContentEdited") #content
- # Make sure target has the new values
- target_entry = xTargetsListbox.getChild(0)
- target_text = self.parseTargetContent(target_entry)
- self.assertEqual(target_text[0], "TestTargetEdited") #name
- self.assertEqual(target_text[2], "TestContentEdited") #content
+ xcancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancBtn)
- xcancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/customizeDialog.py b/sw/qa/uitest/writer_tests3/customizeDialog.py
index 195a8e0bbffb..ca97fbe4e10e 100644
--- a/sw/qa/uitest/writer_tests3/customizeDialog.py
+++ b/sw/qa/uitest/writer_tests3/customizeDialog.py
@@ -15,113 +15,120 @@ class ConfigureDialog(UITestCase):
def test_open_ConfigureDialog_writer(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- xcancBtn = xDialog.getChild("cancel")
- xcancBtn.executeAction("CLICK", tuple())
+ xcancBtn = xDialog.getChild("cancel")
+ xcancBtn.executeAction("CLICK", tuple())
- def test_search_filter(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xfunc = xDialog.getChild("functions")
- xSearch = xDialog.getChild("searchEntry")
-
- initialEntryCount = get_state_as_dict(xfunc)["Children"]
- self.assertTrue(initialEntryCount != 0)
+ self.ui_test.close_doc()
- xSearch.executeAction("TYPE", mkPropertyValues({"TEXT":"format"}))
-
- # Wait for the search/filter op to be completed
- timeout = time.time() + 1
- while time.time() < timeout:
- filteredEntryCount = get_state_as_dict(xfunc)["Children"]
- if filteredEntryCount != initialEntryCount:
- break
- time.sleep(0.1)
+ def test_search_filter(self):
+ self.ui_test.create_doc_in_start_center("writer")
+ self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- self.assertTrue(filteredEntryCount < initialEntryCount)
+ xfunc = xDialog.getChild("functions")
+ xSearch = xDialog.getChild("searchEntry")
- xSearch.executeAction("CLEAR", tuple())
+ initialEntryCount = get_state_as_dict(xfunc)["Children"]
+ self.assertTrue(initialEntryCount != 0)
- # Wait for the search/filter op to be completed
- timeout = time.time() + 1
- while time.time() < timeout:
- finalEntryCount = get_state_as_dict(xfunc)["Children"]
- if finalEntryCount != filteredEntryCount:
- break
- time.sleep(0.1)
+ xSearch.executeAction("TYPE", mkPropertyValues({"TEXT":"format"}))
- self.assertEqual(initialEntryCount, finalEntryCount)
+ # Wait for the search/filter op to be completed
+ timeout = time.time() + 1
+ while time.time() < timeout:
+ filteredEntryCount = get_state_as_dict(xfunc)["Children"]
+ if filteredEntryCount != initialEntryCount:
+ break
+ time.sleep(0.1)
+ self.assertTrue(filteredEntryCount < initialEntryCount)
- xcancBtn = xDialog.getChild("cancel") #button Cancel
- xcancBtn.executeAction("CLICK", tuple()) #click the button
+ xSearch.executeAction("CLEAR", tuple())
- def test_category_listbox(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ # Wait for the search/filter op to be completed
+ timeout = time.time() + 1
+ while time.time() < timeout:
+ finalEntryCount = get_state_as_dict(xfunc)["Children"]
+ if finalEntryCount != filteredEntryCount:
+ break
+ time.sleep(0.1)
- xFunc = xDialog.getChild("functions")
- xCategory = xDialog.getChild("commandcategorylist")
+ self.assertEqual(initialEntryCount, finalEntryCount)
- initialEntryCount = get_state_as_dict(xFunc)["Children"]
- self.assertTrue(initialEntryCount != 0)
- select_pos(xCategory, "1")
- filteredEntryCount = get_state_as_dict(xFunc)["Children"]
- self.assertTrue(filteredEntryCount < initialEntryCount)
+ xcancBtn = xDialog.getChild("cancel") #button Cancel
+ xcancBtn.executeAction("CLICK", tuple()) #click the button
- select_pos(xCategory, "0")
- finalEntryCount = get_state_as_dict(xFunc)["Children"]
- self.assertEqual(initialEntryCount, finalEntryCount)
+ self.ui_test.close_doc()
- xcancBtn = xDialog.getChild("cancel") #button Cancel
- xcancBtn.executeAction("CLICK", tuple()) #click the button
+ def test_category_listbox(self):
+ self.ui_test.create_doc_in_start_center("writer")
+ self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- def test_tdf133862(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ xFunc = xDialog.getChild("functions")
+ xCategory = xDialog.getChild("commandcategorylist")
- self.xUITest.executeCommand(".uno:InsertObjectStarMath")
+ initialEntryCount = get_state_as_dict(xFunc)["Children"]
+ self.assertTrue(initialEntryCount != 0)
- # Without the fix in place, calling customize dialog after inserting
- # a formula object would crash
- self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ select_pos(xCategory, "1")
+ filteredEntryCount = get_state_as_dict(xFunc)["Children"]
+ self.assertTrue(filteredEntryCount < initialEntryCount)
- xcancBtn = xDialog.getChild("cancel")
- xcancBtn.executeAction("CLICK", tuple())
+ select_pos(xCategory, "0")
+ finalEntryCount = get_state_as_dict(xFunc)["Children"]
+ self.assertEqual(initialEntryCount, finalEntryCount)
- def test_gear_button_menu(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ xcancBtn = xDialog.getChild("cancel") #button Cancel
+ xcancBtn.executeAction("CLICK", tuple()) #click the button
- self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
+ self.ui_test.close_doc()
- # Open the New Menu Dialog with id = 0
- xDialog = self.xUITest.getTopFocusWindow()
- xmenugearbtn=xDialog.getChild("menugearbtn")
+ def test_tdf133862(self):
+ self.ui_test.create_doc_in_start_center("writer")
- def show_dialog0():
- xmenugearbtn.executeAction("OPENFROMLIST", mkPropertyValues({"POS": "0" }))
+ self.xUITest.executeCommand(".uno:InsertObjectStarMath")
- with self.ui_test.execute_blocking_action( action=show_dialog0, close_button="cancel"):
- pass
+ # Without the fix in place, calling customize dialog after inserting
+ # a formula object would crash
+ self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- # Open the Rename Menu Dialog with id = 2
- xDialog = self.xUITest.getTopFocusWindow()
- xmenugearbtn=xDialog.getChild("menugearbtn")
- def show_dialog2():
- xmenugearbtn.executeAction("OPENFROMLIST", mkPropertyValues({"POS": "2"}))
+ xcancBtn = xDialog.getChild("cancel")
+ xcancBtn.executeAction("CLICK", tuple())
- with self.ui_test.execute_blocking_action( action=show_dialog2, close_button="cancel"):
- pass
+ self.ui_test.close_doc()
- xDialog = self.xUITest.getTopFocusWindow()
- xcancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancBtn)
+ def test_gear_button_menu(self):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
+
+ # Open the New Menu Dialog with id = 0
+ xDialog = self.xUITest.getTopFocusWindow()
+ xmenugearbtn=xDialog.getChild("menugearbtn")
+ def show_dialog0():
+ xmenugearbtn.executeAction("OPENFROMLIST", mkPropertyValues({"POS": "0" }))
+ with self.ui_test.execute_blocking_action( action=show_dialog0, close_button="cancel"):
+ pass
+
+ # Open the Rename Menu Dialog with id = 2
+ xDialog = self.xUITest.getTopFocusWindow()
+ xmenugearbtn=xDialog.getChild("menugearbtn")
+ def show_dialog2():
+ xmenugearbtn.executeAction("OPENFROMLIST", mkPropertyValues({"POS": "2"}))
+ with self.ui_test.execute_blocking_action( action=show_dialog2, close_button="cancel"):
+ pass
+
+ xDialog = self.xUITest.getTopFocusWindow()
+ xcancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancBtn)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py
index 66535e04eecf..be48fa6a750d 100644
--- a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py
+++ b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py
@@ -18,63 +18,67 @@ class HyperlinkDialog(UITestCase):
def test_hyperlink_dialog_vertical_tab(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- MainWindow = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ MainWindow = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- # Test the vertical tab
- xtab=xDialog.getChild("tabcontrol")
- self.assertEqual(get_state_as_dict(xtab)["PageCount"], "4")
+ # Test the vertical tab
+ xtab=xDialog.getChild("tabcontrol")
+ self.assertEqual(get_state_as_dict(xtab)["PageCount"], "4")
- xtab.executeAction("SELECT", mkPropertyValues({"POS": "0"}))
- self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~Internet")
- self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "0")
+ xtab.executeAction("SELECT", mkPropertyValues({"POS": "0"}))
+ self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~Internet")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "0")
- xtab.executeAction("SELECT", mkPropertyValues({"POS": "1"}))
- self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~Mail")
- self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "1")
+ xtab.executeAction("SELECT", mkPropertyValues({"POS": "1"}))
+ self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~Mail")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "1")
- xtab.executeAction("SELECT", mkPropertyValues({"POS": "2"}))
- self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~Document")
- self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "2")
+ xtab.executeAction("SELECT", mkPropertyValues({"POS": "2"}))
+ self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~Document")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "2")
- xtab.executeAction("SELECT", mkPropertyValues({"POS": "3"}))
- self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~New Document")
- self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "3")
+ xtab.executeAction("SELECT", mkPropertyValues({"POS": "3"}))
+ self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~New Document")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "3")
- xcancel = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancel)
+ xcancel = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancel)
+
+ self.ui_test.close_doc()
def test_insert_hyperlink(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xMainWindow = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ xMainWindow = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ # insert link
+ xtab=xDialog.getChild("tabcontrol")
+ xtab.executeAction("SELECT", mkPropertyValues({"POS": "0"}))
- # insert link
- xtab=xDialog.getChild("tabcontrol")
- xtab.executeAction("SELECT", mkPropertyValues({"POS": "0"}))
+ xtarget = xDialog.getChild("target")
+ xtarget.executeAction("TYPE", mkPropertyValues({"TEXT": "http://www.libreoffice.org/"}))
+ self.assertEqual(get_state_as_dict(xtarget)["Text"], "http://www.libreoffice.org/")
- xtarget = xDialog.getChild("target")
- xtarget.executeAction("TYPE", mkPropertyValues({"TEXT": "http://www.libreoffice.org/"}))
- self.assertEqual(get_state_as_dict(xtarget)["Text"], "http://www.libreoffice.org/")
+ xindication = xDialog.getChild("indication")
+ xindication.executeAction("TYPE", mkPropertyValues({"TEXT": "link"}))
+ self.assertEqual(get_state_as_dict(xindication)["Text"], "link")
- xindication = xDialog.getChild("indication")
- xindication.executeAction("TYPE", mkPropertyValues({"TEXT": "link"}))
- self.assertEqual(get_state_as_dict(xindication)["Text"], "link")
+ xok = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xok)
- xok = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xok)
+ # Check that the link is added
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xedit = xMainWindow.getChild("writer_edit")
+ xedit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "4"}))
+ self.assertEqual(get_state_as_dict(xedit)["SelectedText"], "link")
- # Check that the link is added
- xMainWindow = self.xUITest.getTopFocusWindow()
- xedit = xMainWindow.getChild("writer_edit")
- xedit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "4"}))
- self.assertEqual(get_state_as_dict(xedit)["SelectedText"], "link")
+ self.ui_test.close_doc()
def test_tdf141166(self):
# Skip this test for --with-help=html and --with-help=online, as that would fail with a
@@ -91,18 +95,19 @@ class HyperlinkDialog(UITestCase):
if re.compile(r'XMLHELP\b').search(os.getenv('BUILD_TYPE')):
return
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xHelp = xDialog.getChild("help")
- xHelp.executeAction('FOCUS', tuple())
+ self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xHelp = xDialog.getChild("help")
+ xHelp.executeAction('FOCUS', tuple())
- # Without the fix in place, this test would have crashed here
- with self.ui_test.execute_blocking_action(xHelp.executeAction,
- args=("CLICK", tuple()), close_button="cancel"):
- pass
+ # Without the fix in place, this test would have crashed here
+ with self.ui_test.execute_blocking_action(xHelp.executeAction,
+ args=("CLICK", tuple()), close_button="cancel"):
+ pass
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertEndnote.py b/sw/qa/uitest/writer_tests3/insertEndnote.py
index 940844a5d563..54dd15e346b5 100644
--- a/sw/qa/uitest/writer_tests3/insertEndnote.py
+++ b/sw/qa/uitest/writer_tests3/insertEndnote.py
@@ -10,25 +10,26 @@ from uitest.uihelper.common import type_text
class insertEndnote(UITestCase):
def test_insert_endnote(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.xUITest.executeCommand(".uno:InsertEndnote")
+ self.xUITest.executeCommand(".uno:InsertEndnote")
- type_text(xWriterEdit, "LibreOffice")
+ type_text(xWriterEdit, "LibreOffice")
- self.assertEqual(document.Endnotes[0].String, "LibreOffice")
- self.assertEqual(document.Endnotes.getCount(), 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Endnotes[0].String, "")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Endnotes.getCount(), 0)
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(document.Endnotes[0].String, "")
- self.assertEqual(document.Endnotes.getCount(), 1)
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(document.Endnotes[0].String, "LibreOffice")
+ self.assertEqual(document.Endnotes[0].String, "LibreOffice")
+ self.assertEqual(document.Endnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Endnotes[0].String, "")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Endnotes.getCount(), 0)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Endnotes[0].String, "")
+ self.assertEqual(document.Endnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Endnotes[0].String, "LibreOffice")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertEnvelope.py b/sw/qa/uitest/writer_tests3/insertEnvelope.py
index 4956965bfaae..0b5a8cfe99fb 100644
--- a/sw/qa/uitest/writer_tests3/insertEnvelope.py
+++ b/sw/qa/uitest/writer_tests3/insertEnvelope.py
@@ -14,35 +14,36 @@ from uitest.uihelper.common import get_state_as_dict
class WriterInsertEnvelope(UITestCase):
def test_insert_envelope(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- xAddrTxt= xDialog.getChild("addredit")
- xSenderTxt = xDialog.getChild("senderedit")
- xSenderCheckBox = xDialog.getChild("sender")
+ xAddrTxt= xDialog.getChild("addredit")
+ xSenderTxt = xDialog.getChild("senderedit")
+ xSenderCheckBox = xDialog.getChild("sender")
- xAddrTxt.executeAction("SELECT", mkPropertyValues({"FROM": "1", "TO": "200"}))
- xAddrTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xAddrTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"Address"}))
+ xAddrTxt.executeAction("SELECT", mkPropertyValues({"FROM": "1", "TO": "200"}))
+ xAddrTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xAddrTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"Address"}))
- xSenderTxt.executeAction("SELECT", mkPropertyValues({"FROM": "1", "TO": "200"}))
- xSenderTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xSenderTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"Sender"}))
+ xSenderTxt.executeAction("SELECT", mkPropertyValues({"FROM": "1", "TO": "200"}))
+ xSenderTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSenderTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"Sender"}))
- xInsBtn = xDialog.getChild("user")
- xInsBtn.executeAction("CLICK", tuple())
+ xInsBtn = xDialog.getChild("user")
+ xInsBtn.executeAction("CLICK", tuple())
- self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope")
- xDialog = self.xUITest.getTopFocusWindow()
- xAddrTxt= xDialog.getChild("addredit")
- xSenderTxt = xDialog.getChild("senderedit")
- self.assertEqual(get_state_as_dict(xAddrTxt)["Text"], "Address")
- self.assertEqual(get_state_as_dict(xSenderTxt)["Text"], "Sender")
+ self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xAddrTxt= xDialog.getChild("addredit")
+ xSenderTxt = xDialog.getChild("senderedit")
+ self.assertEqual(get_state_as_dict(xAddrTxt)["Text"], "Address")
+ self.assertEqual(get_state_as_dict(xSenderTxt)["Text"], "Sender")
- xcancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancelBtn)
+ xcancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancelBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertFootEndnote.py b/sw/qa/uitest/writer_tests3/insertFootEndnote.py
index 725f6577f64e..575abc9ab477 100644
--- a/sw/qa/uitest/writer_tests3/insertFootEndnote.py
+++ b/sw/qa/uitest/writer_tests3/insertFootEndnote.py
@@ -10,67 +10,68 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class insertFootEndnote(UITestCase):
def test_insert_foot_endnote(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- #Automatic - Footnote
- self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.Footnotes.getCount(), 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Footnotes.getCount(), 0)
- #Automatic - Endnote
- self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+#Automatic - Footnote
+ self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ self.assertEqual(document.Footnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Footnotes.getCount(), 0)
+#Automatic - Endnote
+ self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- xEndnote = xDialog.getChild("endnote")
- xEndnote.executeAction("CLICK", tuple())
+ xEndnote = xDialog.getChild("endnote")
+ xEndnote.executeAction("CLICK", tuple())
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.Endnotes.getCount(), 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Endnotes.getCount(), 0)
- #Character - Footnote
- self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ self.assertEqual(document.Endnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Endnotes.getCount(), 0)
+#Character - Footnote
+ self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- xChar = xDialog.getChild("character")
- xChar.executeAction("CLICK", tuple())
- xCharentry = xDialog.getChild("characterentry")
- xCharentry.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
+ xChar = xDialog.getChild("character")
+ xChar.executeAction("CLICK", tuple())
+ xCharentry = xDialog.getChild("characterentry")
+ xCharentry.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.Footnotes.getCount(), 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Footnotes.getCount(), 0)
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ self.assertEqual(document.Footnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Footnotes.getCount(), 0)
- #Character - Endnote
- self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+#Character - Endnote
+ self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- xChar = xDialog.getChild("character")
- xChar.executeAction("CLICK", tuple())
- xCharentry = xDialog.getChild("characterentry")
- xCharentry.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
+ xChar = xDialog.getChild("character")
+ xChar.executeAction("CLICK", tuple())
+ xCharentry = xDialog.getChild("characterentry")
+ xCharentry.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
- xEndnote = xDialog.getChild("endnote")
- xEndnote.executeAction("CLICK", tuple())
+ xEndnote = xDialog.getChild("endnote")
+ xEndnote.executeAction("CLICK", tuple())
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.Endnotes.getCount(), 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Endnotes.getCount(), 0)
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ self.assertEqual(document.Endnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Endnotes.getCount(), 0)
- #Cancel button
- self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+#Cancel button
+ self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertPageFooter.py b/sw/qa/uitest/writer_tests3/insertPageFooter.py
index 5300074ab2e1..4bec545965f0 100644
--- a/sw/qa/uitest/writer_tests3/insertPageFooter.py
+++ b/sw/qa/uitest/writer_tests3/insertPageFooter.py
@@ -39,32 +39,35 @@ class WriterInsertPageFooter(UITestCase):
document.StyleFamilies.PageStyles.Standard.FooterIsOn, False)
def test_footer(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.insert_footer()
+ self.insert_footer()
- self.delete_footer()
+ self.delete_footer()
+
+ self.ui_test.close_doc()
def test_tdf107427(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.insert_footer()
+ self.insert_footer()
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xInsertDlg = self.xUITest.getTopFocusWindow()
+ xInsertDlg = self.xUITest.getTopFocusWindow()
- xOkBtn = xInsertDlg.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xInsertDlg.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- tables = document.getTextTables()
- self.assertEqual(len(tables[0].getRows()), 2)
- self.assertEqual(len(tables[0].getColumns()), 2)
+ tables = document.getTextTables()
+ self.assertEqual(len(tables[0].getRows()), 2)
+ self.assertEqual(len(tables[0].getColumns()), 2)
- self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:SelectAll")
- self.delete_footer()
+ self.delete_footer()
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py
index 7f0b28d857ea..26bb21b89159 100644
--- a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py
+++ b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py
@@ -11,65 +11,68 @@ from com.sun.star.lang import IndexOutOfBoundsException
class insertQrCode(UITestCase):
def test_insert_qr_code(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- # cancel the dialog without doing anything
- self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xURL = xDialog.getChild("edit_text")
- type_text(xURL, "www.libreoffice.org")
-
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
- with self.assertRaises(IndexOutOfBoundsException):
- document.DrawPage.getByIndex(0)
-
- # Reopen the dialog box
- self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
- xDialog = self.xUITest.getTopFocusWindow()
-
- # Get elements in the Dialog Box
- xURL = xDialog.getChild("edit_text")
- xECC_Low = xDialog.getChild("button_low") #How radio button input is written in text.
- xBorder = xDialog.getChild("edit_margin")
-
- type_text(xURL, "www.libreoffice.org") #set the QR code
- xECC_Low.executeAction("CLICK", tuple())
- xBorder.executeAction("UP", tuple())
- xBorder.executeAction("DOWN", tuple())
- xOKBtn = xDialog.getChild("ok")
- xOKBtn.executeAction("CLICK", tuple())
-
- # check the QR code in the document
- self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org")
- self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1)
- self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Border, 1)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- def test_insert_qr_code_gen2(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ # cancel the dialog without doing anything
+ self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xURL = xDialog.getChild("edit_text")
+ type_text(xURL, "www.libreoffice.org")
+
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ with self.assertRaises(IndexOutOfBoundsException):
+ document.DrawPage.getByIndex(0)
- self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
- xDialog = self.xUITest.getTopFocusWindow()
+ # Reopen the dialog box
+ self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
+ xDialog = self.xUITest.getTopFocusWindow()
- xURL = xDialog.getChild("edit_text")
- xECC_Low = xDialog.getChild("button_low")
- xBorder = xDialog.getChild("edit_margin")
+ # Get elements in the Dialog Box
+ xURL = xDialog.getChild("edit_text")
+ xECC_Low = xDialog.getChild("button_low") #How radio button input is written in text.
+ xBorder = xDialog.getChild("edit_margin")
- type_text(xURL, "www.libreoffice.org") #set the QR code
- xECC_Low.executeAction("CLICK", tuple())
- xBorder.executeAction("UP", tuple())
- xBorder.executeAction("DOWN", tuple())
- xOKBtn = xDialog.getChild("ok")
- xOKBtn.executeAction("CLICK", tuple())
+ type_text(xURL, "www.libreoffice.org") #set the QR code
+ xECC_Low.executeAction("CLICK", tuple())
+ xBorder.executeAction("UP", tuple())
+ xBorder.executeAction("DOWN", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ xOKBtn.executeAction("CLICK", tuple())
- #check the QR Code in the document
- self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org")
- self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1)
- self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Border, 1)
+ # check the QR code in the document
+ self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org")
+ self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1)
+ self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Border, 1)
+ self.ui_test.close_doc()
+
+ def test_insert_qr_code_gen2(self):
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xURL = xDialog.getChild("edit_text")
+ xECC_Low = xDialog.getChild("button_low")
+ xBorder = xDialog.getChild("edit_margin")
+
+ type_text(xURL, "www.libreoffice.org") #set the QR code
+ xECC_Low.executeAction("CLICK", tuple())
+ xBorder.executeAction("UP", tuple())
+ xBorder.executeAction("DOWN", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ xOKBtn.executeAction("CLICK", tuple())
+
+ #check the QR Code in the document
+ self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org")
+ self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1)
+ self.assertEqual(document.DrawPage.getByIndex(0).QRCodeProperties.Border, 1)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertSignatureLine.py b/sw/qa/uitest/writer_tests3/insertSignatureLine.py
index 4ebfebbf29c6..ecfc1c61a1d2 100644
--- a/sw/qa/uitest/writer_tests3/insertSignatureLine.py
+++ b/sw/qa/uitest/writer_tests3/insertSignatureLine.py
@@ -11,82 +11,85 @@ from com.sun.star.lang import IndexOutOfBoundsException
class insertSignatureLine(UITestCase):
def test_insert_signature_line(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- # cancel the dialog without doing anything
- self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xName = xDialog.getChild("edit_name")
- xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
-
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
- with self.assertRaises(IndexOutOfBoundsException):
- document.DrawPage.getByIndex(0)
-
- # set the signature line
- self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xName = xDialog.getChild("edit_name")
- xTitle = xDialog.getChild("edit_title")
- xEmail = xDialog.getChild("edit_email")
- xComment = xDialog.getChild("checkbox_can_add_comments")
- xInstructions = xDialog.getChild("edit_instructions")
-
- xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
- xTitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
- xEmail.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
- xComment.executeAction("CLICK", tuple())
- xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
- xOKBtn = xDialog.getChild("ok")
- xOKBtn.executeAction("CLICK", tuple())
-
- #check the signature Line in the document
- element = document.DrawPage.getByIndex(0)
- self.assertEqual(element.SignatureLineSuggestedSignerName, "Name")
- self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(element.SignatureLineSuggestedSignerEmail, "Email")
- self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(element.SignatureLineCanAddComment, False)
- self.assertEqual(element.SignatureLineShowSignDate, True)
- self.assertEqual(element.SignatureLineSigningInstructions, "Instructions")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ # cancel the dialog without doing anything
+ self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xName = xDialog.getChild("edit_name")
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
+
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ with self.assertRaises(IndexOutOfBoundsException):
+ document.DrawPage.getByIndex(0)
+
+ # set the signature line
+ self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xName = xDialog.getChild("edit_name")
+ xTitle = xDialog.getChild("edit_title")
+ xEmail = xDialog.getChild("edit_email")
+ xComment = xDialog.getChild("checkbox_can_add_comments")
+ xInstructions = xDialog.getChild("edit_instructions")
+
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
+ xTitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
+ xEmail.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
+ xComment.executeAction("CLICK", tuple())
+ xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
+ xOKBtn = xDialog.getChild("ok")
+ xOKBtn.executeAction("CLICK", tuple())
+
+ #check the signature Line in the document
+ element = document.DrawPage.getByIndex(0)
+ self.assertEqual(element.SignatureLineSuggestedSignerName, "Name")
+ self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(element.SignatureLineSuggestedSignerEmail, "Email")
+ self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(element.SignatureLineCanAddComment, False)
+ self.assertEqual(element.SignatureLineShowSignDate, True)
+ self.assertEqual(element.SignatureLineSigningInstructions, "Instructions")
+
+ self.ui_test.close_doc()
def test_insert_signature_line2(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xName = xDialog.getChild("edit_name")
- xTitle = xDialog.getChild("edit_title")
- xEmail = xDialog.getChild("edit_email")
- xComment = xDialog.getChild("checkbox_can_add_comments")
- xDate = xDialog.getChild("checkbox_show_sign_date")
- xInstructions = xDialog.getChild("edit_instructions")
-
- xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
- xTitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
- xEmail.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
- xDate.executeAction("CLICK", tuple())
- xComment.executeAction("CLICK", tuple())
- xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
- xOKBtn = xDialog.getChild("ok")
- xOKBtn.executeAction("CLICK", tuple())
-
- #check the signature Line in the document
- element = document.DrawPage.getByIndex(0)
- self.assertEqual(element.SignatureLineSuggestedSignerName, "Name")
- self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(element.SignatureLineSuggestedSignerEmail, "Email")
- self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(element.SignatureLineCanAddComment, False)
- self.assertEqual(element.SignatureLineShowSignDate, False)
- self.assertEqual(element.SignatureLineSigningInstructions, "Instructions")
-
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xName = xDialog.getChild("edit_name")
+ xTitle = xDialog.getChild("edit_title")
+ xEmail = xDialog.getChild("edit_email")
+ xComment = xDialog.getChild("checkbox_can_add_comments")
+ xDate = xDialog.getChild("checkbox_show_sign_date")
+ xInstructions = xDialog.getChild("edit_instructions")
+
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
+ xTitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
+ xEmail.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
+ xDate.executeAction("CLICK", tuple())
+ xComment.executeAction("CLICK", tuple())
+ xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
+ xOKBtn = xDialog.getChild("ok")
+ xOKBtn.executeAction("CLICK", tuple())
+
+ #check the signature Line in the document
+ element = document.DrawPage.getByIndex(0)
+ self.assertEqual(element.SignatureLineSuggestedSignerName, "Name")
+ self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(element.SignatureLineSuggestedSignerEmail, "Email")
+ self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(element.SignatureLineCanAddComment, False)
+ self.assertEqual(element.SignatureLineShowSignDate, False)
+ self.assertEqual(element.SignatureLineSigningInstructions, "Instructions")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/lineNumbering.py b/sw/qa/uitest/writer_tests3/lineNumbering.py
index f3704646bd31..ec51b4132f80 100644
--- a/sw/qa/uitest/writer_tests3/lineNumbering.py
+++ b/sw/qa/uitest/writer_tests3/lineNumbering.py
@@ -14,85 +14,87 @@ from uitest.uihelper.common import change_measurement_unit
class WriterLineNumbering(UITestCase):
def test_line_numbering_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
- change_measurement_unit(self, "Centimeter")
+ change_measurement_unit(self, "Centimeter")
- self.ui_test.execute_dialog_through_command(".uno:LineNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xshownumbering = xDialog.getChild("shownumbering")
- xstyledropdown = xDialog.getChild("styledropdown")
- xformatdropdown = xDialog.getChild("formatdropdown")
- xpositiondropdown = xDialog.getChild("positiondropdown")
- xspacingspin = xDialog.getChild("spacingspin")
- xintervalspin = xDialog.getChild("intervalspin")
- xtextentry = xDialog.getChild("textentry")
- xlinesspin = xDialog.getChild("linesspin")
- xblanklines = xDialog.getChild("blanklines")
- xlinesintextframes = xDialog.getChild("linesintextframes")
- xshowfooterheadernumbering = xDialog.getChild("showfooterheadernumbering")
- xrestarteverynewpage = xDialog.getChild("restarteverynewpage")
+ self.ui_test.execute_dialog_through_command(".uno:LineNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xshownumbering = xDialog.getChild("shownumbering")
+ xstyledropdown = xDialog.getChild("styledropdown")
+ xformatdropdown = xDialog.getChild("formatdropdown")
+ xpositiondropdown = xDialog.getChild("positiondropdown")
+ xspacingspin = xDialog.getChild("spacingspin")
+ xintervalspin = xDialog.getChild("intervalspin")
+ xtextentry = xDialog.getChild("textentry")
+ xlinesspin = xDialog.getChild("linesspin")
+ xblanklines = xDialog.getChild("blanklines")
+ xlinesintextframes = xDialog.getChild("linesintextframes")
+ xshowfooterheadernumbering = xDialog.getChild("showfooterheadernumbering")
+ xrestarteverynewpage = xDialog.getChild("restarteverynewpage")
- xshownumbering.executeAction("CLICK", tuple())
- select_by_text(xstyledropdown, "Bullets")
- select_by_text(xformatdropdown, "A, B, C, ...")
- select_by_text(xpositiondropdown, "Right")
- xspacingspin.executeAction("UP", tuple())
- xintervalspin.executeAction("UP", tuple())
- xtextentry.executeAction("TYPE", mkPropertyValues({"TEXT":";"}))
- xlinesspin.executeAction("UP", tuple())
- xblanklines.executeAction("CLICK", tuple())
- xlinesintextframes.executeAction("CLICK", tuple())
- xshowfooterheadernumbering.executeAction("CLICK", tuple())
- xrestarteverynewpage.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xshownumbering.executeAction("CLICK", tuple())
+ select_by_text(xstyledropdown, "Bullets")
+ select_by_text(xformatdropdown, "A, B, C, ...")
+ select_by_text(xpositiondropdown, "Right")
+ xspacingspin.executeAction("UP", tuple())
+ xintervalspin.executeAction("UP", tuple())
+ xtextentry.executeAction("TYPE", mkPropertyValues({"TEXT":";"}))
+ xlinesspin.executeAction("UP", tuple())
+ xblanklines.executeAction("CLICK", tuple())
+ xlinesintextframes.executeAction("CLICK", tuple())
+ xshowfooterheadernumbering.executeAction("CLICK", tuple())
+ xrestarteverynewpage.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:LineNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xshownumbering = xDialog.getChild("shownumbering")
- xstyledropdown = xDialog.getChild("styledropdown")
- xformatdropdown = xDialog.getChild("formatdropdown")
- xpositiondropdown = xDialog.getChild("positiondropdown")
- xspacingspin = xDialog.getChild("spacingspin")
- xintervalspin = xDialog.getChild("intervalspin")
- xtextentry = xDialog.getChild("textentry")
- xlinesspin = xDialog.getChild("linesspin")
- xblanklines = xDialog.getChild("blanklines")
- xlinesintextframes = xDialog.getChild("linesintextframes")
- xshowfooterheadernumbering = xDialog.getChild("showfooterheadernumbering")
- xrestarteverynewpage = xDialog.getChild("restarteverynewpage")
+ self.ui_test.execute_dialog_through_command(".uno:LineNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xshownumbering = xDialog.getChild("shownumbering")
+ xstyledropdown = xDialog.getChild("styledropdown")
+ xformatdropdown = xDialog.getChild("formatdropdown")
+ xpositiondropdown = xDialog.getChild("positiondropdown")
+ xspacingspin = xDialog.getChild("spacingspin")
+ xintervalspin = xDialog.getChild("intervalspin")
+ xtextentry = xDialog.getChild("textentry")
+ xlinesspin = xDialog.getChild("linesspin")
+ xblanklines = xDialog.getChild("blanklines")
+ xlinesintextframes = xDialog.getChild("linesintextframes")
+ xshowfooterheadernumbering = xDialog.getChild("showfooterheadernumbering")
+ xrestarteverynewpage = xDialog.getChild("restarteverynewpage")
- self.assertEqual(get_state_as_dict(xshownumbering)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xstyledropdown)["SelectEntryText"], "Bullets")
- self.assertEqual(get_state_as_dict(xformatdropdown)["SelectEntryText"], "A, B, C, ...")
- self.assertEqual(get_state_as_dict(xpositiondropdown)["SelectEntryText"], "Right")
- self.assertEqual(get_state_as_dict(xspacingspin)["Text"], "0.60 cm")
- self.assertEqual(get_state_as_dict(xintervalspin)["Text"], "6")
- self.assertEqual(get_state_as_dict(xtextentry)["Text"], ";")
- self.assertEqual(get_state_as_dict(xlinesspin)["Text"], "4")
- self.assertEqual(get_state_as_dict(xblanklines)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xlinesintextframes)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xshowfooterheadernumbering)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xrestarteverynewpage)["Selected"], "true")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ self.assertEqual(get_state_as_dict(xshownumbering)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xstyledropdown)["SelectEntryText"], "Bullets")
+ self.assertEqual(get_state_as_dict(xformatdropdown)["SelectEntryText"], "A, B, C, ...")
+ self.assertEqual(get_state_as_dict(xpositiondropdown)["SelectEntryText"], "Right")
+ self.assertEqual(get_state_as_dict(xspacingspin)["Text"], "0.60 cm")
+ self.assertEqual(get_state_as_dict(xintervalspin)["Text"], "6")
+ self.assertEqual(get_state_as_dict(xtextentry)["Text"], ";")
+ self.assertEqual(get_state_as_dict(xlinesspin)["Text"], "4")
+ self.assertEqual(get_state_as_dict(xblanklines)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xlinesintextframes)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xshowfooterheadernumbering)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xrestarteverynewpage)["Selected"], "true")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+ self.ui_test.close_doc()
def test_tdf86185(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:LineNumberingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xshownumbering = xDialog.getChild("shownumbering")
- xformatdropdown = xDialog.getChild("formatdropdown")
+ self.ui_test.execute_dialog_through_command(".uno:LineNumberingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xshownumbering = xDialog.getChild("shownumbering")
+ xformatdropdown = xDialog.getChild("formatdropdown")
- xshownumbering.executeAction("CLICK", tuple())
- itemFormat = ["1, 2, 3, ...", "A, B, C, ...", "a, b, c, ...", "I, II, III, ...", "i, ii, iii, ...", "A, .., AA, .., AAA, ..."]
- for i in range(6):
- select_by_text(xformatdropdown, itemFormat[i])
- self.assertEqual(get_state_as_dict(xformatdropdown)["SelectEntryText"], itemFormat[i])
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ xshownumbering.executeAction("CLICK", tuple())
+ itemFormat = ["1, 2, 3, ...", "A, B, C, ...", "a, b, c, ...", "I, II, III, ...", "i, ii, iii, ...", "A, .., AA, .., AAA, ..."]
+ for i in range(6):
+ select_by_text(xformatdropdown, itemFormat[i])
+ self.assertEqual(get_state_as_dict(xformatdropdown)["SelectEntryText"], itemFormat[i])
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/pageDialog.py b/sw/qa/uitest/writer_tests3/pageDialog.py
index dd01f3681068..942aa6d2e96f 100644
--- a/sw/qa/uitest/writer_tests3/pageDialog.py
+++ b/sw/qa/uitest/writer_tests3/pageDialog.py
@@ -122,26 +122,28 @@ class WriterPageDialog(UITestCase):
def test_area_tab(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- buttons = ['btnbitmap', 'btncolor', 'btngradient', 'btnhatch', 'btnpattern']
- for index, button in enumerate(buttons):
+ buttons = ['btnbitmap', 'btncolor', 'btngradient', 'btnhatch', 'btnpattern']
+ for index, button in enumerate(buttons):
- xDialog = self.launch_dialog_and_select_tab(2)
+ xDialog = self.launch_dialog_and_select_tab(2)
- self.click_button(xDialog, button)
+ self.click_button(xDialog, button)
- self.click_button(xDialog, 'ok')
+ self.click_button(xDialog, 'ok')
- self.check_default_area(button)
+ self.check_default_area(button)
- xDialog = self.launch_dialog_and_select_tab(2)
+ xDialog = self.launch_dialog_and_select_tab(2)
- self.click_button(xDialog, 'btnnone')
+ self.click_button(xDialog, 'btnnone')
- self.click_button(xDialog, 'ok')
+ self.click_button(xDialog, 'ok')
+
+ self.check_default_area('btnnone')
- self.check_default_area('btnnone')
+ self.ui_test.close_doc()
def test_paper_format(self):
@@ -151,77 +153,85 @@ class WriterPageDialog(UITestCase):
"C5 Envelope", "C4 Envelope", "#6¾ Envelope", "#7¾ (Monarch) Envelope",
"#9 Envelope", "#10 Envelope", "#11 Envelope", "#12 Envelope", "Japanese Postcard"]
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- for i in range(30):
- with self.subTest(i=i):
- xDialog = self.launch_dialog_and_select_tab(1)
+ for i in range(30):
+ with self.subTest(i=i):
+ xDialog = self.launch_dialog_and_select_tab(1)
- xFormatList = xDialog.getChild("comboPageFormat")
- select_pos(xFormatList, str(i))
+ xFormatList = xDialog.getChild("comboPageFormat")
+ select_pos(xFormatList, str(i))
- self.assertEqual(
- get_state_as_dict(xFormatList)["SelectEntryText"], lPaperFormat[i])
+ self.assertEqual(
+ get_state_as_dict(xFormatList)["SelectEntryText"], lPaperFormat[i])
- self.click_button(xDialog, 'ok')
+ self.click_button(xDialog, 'ok')
+
+ self.ui_test.close_doc()
def test_orientation(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- self.assertEqual(
- document.StyleFamilies.PageStyles.Standard.IsLandscape, False)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.IsLandscape, False)
- xDialog = self.launch_dialog_and_select_tab(1)
+ xDialog = self.launch_dialog_and_select_tab(1)
- self.click_button(xDialog, 'radiobuttonLandscape')
+ self.click_button(xDialog, 'radiobuttonLandscape')
- self.click_button(xDialog, 'ok')
+ self.click_button(xDialog, 'ok')
- self.assertEqual(
- document.StyleFamilies.PageStyles.Standard.IsLandscape, True)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.IsLandscape, True)
- xDialog = self.launch_dialog_and_select_tab(1)
+ xDialog = self.launch_dialog_and_select_tab(1)
- self.click_button(xDialog, 'radiobuttonPortrait')
+ self.click_button(xDialog, 'radiobuttonPortrait')
- self.click_button(xDialog, 'ok')
+ self.click_button(xDialog, 'ok')
- self.assertEqual(
- document.StyleFamilies.PageStyles.Standard.IsLandscape, False)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.IsLandscape, False)
+
+ self.ui_test.close_doc()
def test_text_direction(self):
lTextDirection = ['Left-to-right (horizontal)', 'Right-to-left (horizontal)',
'Right-to-left (vertical)', 'Left-to-right (vertical)']
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ document = self.ui_test.get_component()
- document = self.ui_test.get_component()
+ for i in range(4):
+ with self.subTest(i=i):
+ xDialog = self.launch_dialog_and_select_tab(1)
- for i in range(4):
- with self.subTest(i=i):
- xDialog = self.launch_dialog_and_select_tab(1)
+ xTextDirectionList = xDialog.getChild("comboTextFlowBox")
+ select_pos(xTextDirectionList, str(i))
- xTextDirectionList = xDialog.getChild("comboTextFlowBox")
- select_pos(xTextDirectionList, str(i))
+ self.assertEqual(
+ get_state_as_dict(xTextDirectionList)["SelectEntryText"], lTextDirection[i])
- self.assertEqual(
- get_state_as_dict(xTextDirectionList)["SelectEntryText"], lTextDirection[i])
+ self.click_button(xDialog, 'ok')
- self.click_button(xDialog, 'ok')
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.WritingMode, i)
- self.assertEqual(
- document.StyleFamilies.PageStyles.Standard.WritingMode, i)
+ self.ui_test.close_doc()
def test_cancel_button_page_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- self.ui_test.execute_dialog_through_command(".uno:PageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/sort.py b/sw/qa/uitest/writer_tests3/sort.py
index ccebbe2ba4e4..2868c9f8a49e 100644
--- a/sw/qa/uitest/writer_tests3/sort.py
+++ b/sw/qa/uitest/writer_tests3/sort.py
@@ -12,54 +12,57 @@ from uitest.uihelper.common import type_text
class WriterSort(UITestCase):
def test_sort(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "a")
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- type_text(xWriterEdit, "c")
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- type_text(xWriterEdit, "v")
+ type_text(xWriterEdit, "a")
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ type_text(xWriterEdit, "c")
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ type_text(xWriterEdit, "v")
- selection = self.xUITest.executeCommand(".uno:SelectAll") #select whole text
- #Tools - Sort
- self.ui_test.execute_dialog_through_command(".uno:SortDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xDown = xDialog.getChild("down1")
- xDown.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #check
- self.assertEqual(document.Text.String[0:1], "v")
+ selection = self.xUITest.executeCommand(".uno:SelectAll") #select whole text
+ #Tools - Sort
+ self.ui_test.execute_dialog_through_command(".uno:SortDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xDown = xDialog.getChild("down1")
+ xDown.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #check
+ self.assertEqual(document.Text.String[0:1], "v")
+
+ self.ui_test.close_doc()
def test_sort_numerical(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "1;2;3")
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- type_text(xWriterEdit, "2;8;3")
+ type_text(xWriterEdit, "1;2;3")
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ type_text(xWriterEdit, "2;8;3")
- selection = self.xUITest.executeCommand(".uno:SelectAll") #select whole text
- #Tools - Sort
- self.ui_test.execute_dialog_through_command(".uno:SortDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xDown = xDialog.getChild("down1")
- xcolsb1 = xDialog.getChild("colsb1")
- xtypelb1 = xDialog.getChild("typelb1")
- xcharacter = xDialog.getChild("character")
- xseparator = xDialog.getChild("separator")
- xDown.executeAction("CLICK", tuple())
- select_by_text(xtypelb1, "Numerical")
- xcharacter.executeAction("CLICK", tuple())
- xseparator.executeAction("TYPE", mkPropertyValues({"TEXT":";"}))
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #check
- self.assertEqual(document.Text.String[0:5], "2;8;3")
+ selection = self.xUITest.executeCommand(".uno:SelectAll") #select whole text
+ #Tools - Sort
+ self.ui_test.execute_dialog_through_command(".uno:SortDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xDown = xDialog.getChild("down1")
+ xcolsb1 = xDialog.getChild("colsb1")
+ xtypelb1 = xDialog.getChild("typelb1")
+ xcharacter = xDialog.getChild("character")
+ xseparator = xDialog.getChild("separator")
+ xDown.executeAction("CLICK", tuple())
+ select_by_text(xtypelb1, "Numerical")
+ xcharacter.executeAction("CLICK", tuple())
+ xseparator.executeAction("TYPE", mkPropertyValues({"TEXT":";"}))
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #check
+ self.assertEqual(document.Text.String[0:5], "2;8;3")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/specialCharacter.py b/sw/qa/uitest/writer_tests3/specialCharacter.py
index bda94ff63c53..20955856ba88 100644
--- a/sw/qa/uitest/writer_tests3/specialCharacter.py
+++ b/sw/qa/uitest/writer_tests3/specialCharacter.py
@@ -15,75 +15,76 @@ from uitest.uihelper.common import select_pos
class specialCharacter(UITestCase):
def test_special_character(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:InsertSymbol") # specialCharacter dialog
- xDialog = self.xUITest.getTopFocusWindow()
- xCharSet = xDialog.getChild("showcharset") # default charset
+ self.ui_test.execute_dialog_through_command(".uno:InsertSymbol") # specialCharacter dialog
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCharSet = xDialog.getChild("showcharset") # default charset
- xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "1", "ROW": "4"})) # digit 4 selected
+ xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "1", "ROW": "4"})) # digit 4 selected
- xHexText = xDialog.getChild("hexvalue")
- xDecText = xDialog.getChild("decimalvalue")
+ xHexText = xDialog.getChild("hexvalue")
+ xDecText = xDialog.getChild("decimalvalue")
- self.assertEqual(get_state_as_dict(xHexText)["Text"], "34") # check the values Hex and decimal
- self.assertEqual(get_state_as_dict(xDecText)["Text"], "52")
+ self.assertEqual(get_state_as_dict(xHexText)["Text"], "34") # check the values Hex and decimal
+ self.assertEqual(get_state_as_dict(xDecText)["Text"], "52")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- self.ui_test.execute_dialog_through_command(".uno:InsertSymbol")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:InsertSymbol")
+ xDialog = self.xUITest.getTopFocusWindow()
- xComboFont = xDialog.getChild("fontlb")
- select_pos(xComboFont, "0") # select font
- xComboFont2 = xDialog.getChild("subsetlb")
- select_pos(xComboFont2, "0") # select font subset
+ xComboFont = xDialog.getChild("fontlb")
+ select_pos(xComboFont, "0") # select font
+ xComboFont2 = xDialog.getChild("subsetlb")
+ select_pos(xComboFont2, "0") # select font subset
- xSearchText = xDialog.getChild("search") # test search textBox
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "d"}))
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "i"}))
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "g"}))
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "i"}))
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": " "}))
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "f"}))
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "o"}))
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "u"}))
- xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "r"}))
+ xSearchText = xDialog.getChild("search") # test search textBox
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "d"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "i"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "g"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "i"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": " "}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "f"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "o"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "u"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "r"}))
- # works locally and linux_gcc_release_64, but fails at linux_clang_dbgutil_64.
- # Markus: Actually after a round of debugging I think the problem is actually that the test depends on the used font.
- # Therefore, if the font is not available or not selected by default the test fails.
- # xCharSet = xDialog.getChild("searchcharset") #another charset -> search charset
- # xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "0", "ROW": "0"})) #digit 4 selected, we have only one result;
- # sleep(1) #try sleep here
- # xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "0", "ROW": "0"})) #try it twice, because it works at local,but fail on gerrit
- ##gerrit:self.assertEqual(get_state_as_dict(xHexText)["Text"], "34") # check the values for digit 4; AssertionError: '1' != '34'
+ # works locally and linux_gcc_release_64, but fails at linux_clang_dbgutil_64.
+ # Markus: Actually after a round of debugging I think the problem is actually that the test depends on the used font.
+ # Therefore, if the font is not available or not selected by default the test fails.
+ # xCharSet = xDialog.getChild("searchcharset") #another charset -> search charset
+ # xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "0", "ROW": "0"})) #digit 4 selected, we have only one result;
+ # sleep(1) #try sleep here
+ # xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "0", "ROW": "0"})) #try it twice, because it works at local,but fail on gerrit
+ ##gerrit:self.assertEqual(get_state_as_dict(xHexText)["Text"], "34") # check the values for digit 4; AssertionError: '1' != '34'
- # xHexText = xDialog.getChild("hexvalue")
- # xDecText = xDialog.getChild("decimalvalue")
- # self.assertEqual(get_state_as_dict(xHexText)["Text"], "34") # check the values for digit 4
- # self.assertEqual(get_state_as_dict(xDecText)["Text"], "52")
+ # xHexText = xDialog.getChild("hexvalue")
+ # xDecText = xDialog.getChild("decimalvalue")
+ # self.assertEqual(get_state_as_dict(xHexText)["Text"], "34") # check the values for digit 4
+ # self.assertEqual(get_state_as_dict(xDecText)["Text"], "52")
- # xAddFavBtn = xDialog.getChild("favbtn")
- # xAddFavBtn.executeAction("CLICK", tuple()) # Add to favorites button
+ # xAddFavBtn = xDialog.getChild("favbtn")
+ # xAddFavBtn.executeAction("CLICK", tuple()) # Add to favorites button
- # xInsrBtn = xDialog.getChild("insert")
- # xInsrBtn.executeAction("CLICK", tuple()) # Insert to document
+ # xInsrBtn = xDialog.getChild("insert")
+ # xInsrBtn.executeAction("CLICK", tuple()) # Insert to document
- # self.assertEqual(document.Text.String[0:1], "4") # check inserted character
+ # self.assertEqual(document.Text.String[0:1], "4") # check inserted character
- # self.xUITest.executeCommand(".uno:Undo")
- # self.xUITest.executeCommand(".uno:Redo") #undo, redo
+ # self.xUITest.executeCommand(".uno:Undo")
+ # self.xUITest.executeCommand(".uno:Redo") #undo, redo
- # self.assertEqual(document.Text.String[0:1], "4") # check inserted character after undo, redo
+ # self.assertEqual(document.Text.String[0:1], "4") # check inserted character after undo, redo
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/tdf79236.py b/sw/qa/uitest/writer_tests3/tdf79236.py
index 886120444ac9..bd3862b5e27a 100644
--- a/sw/qa/uitest/writer_tests3/tdf79236.py
+++ b/sw/qa/uitest/writer_tests3/tdf79236.py
@@ -11,111 +11,113 @@ class tdf79236(UITestCase):
def test_paragraph(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, "Test for tdf79236")
+ type_text(xWriterEdit, "Test for tdf79236")
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- selection = self.xUITest.executeCommand(".uno:SelectAll")
+ selection = self.xUITest.executeCommand(".uno:SelectAll")
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).String, "Test for tdf79236")
+ self.assertEqual(document.CurrentSelection.getByIndex(0).String, "Test for tdf79236")
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xParagraphDlg = self.xUITest.getTopFocusWindow()
+ xParagraphDlg = self.xUITest.getTopFocusWindow()
- xLeftSpnBtn = xParagraphDlg.getChild("spinED_LEFTINDENT")
- for _ in range(0,20):
- xLeftSpnBtn.executeAction("UP", tuple())
+ xLeftSpnBtn = xParagraphDlg.getChild("spinED_LEFTINDENT")
+ for _ in range(0,20):
+ xLeftSpnBtn.executeAction("UP", tuple())
- xRightSpnBtn = xParagraphDlg.getChild("spinED_RIGHTINDENT")
- for _ in range(0,20):
- xRightSpnBtn.executeAction("UP", tuple())
+ xRightSpnBtn = xParagraphDlg.getChild("spinED_RIGHTINDENT")
+ for _ in range(0,20):
+ xRightSpnBtn.executeAction("UP", tuple())
- xLineSpnBtn = xParagraphDlg.getChild("spinED_FLINEINDENT")
- for _ in range(0,20):
- xLineSpnBtn.executeAction("UP", tuple())
+ xLineSpnBtn = xParagraphDlg.getChild("spinED_FLINEINDENT")
+ for _ in range(0,20):
+ xLineSpnBtn.executeAction("UP", tuple())
- xBottomSpnBtn = xParagraphDlg.getChild("spinED_BOTTOMDIST")
- for _ in range(0,20):
- xBottomSpnBtn.executeAction("UP", tuple())
+ xBottomSpnBtn = xParagraphDlg.getChild("spinED_BOTTOMDIST")
+ for _ in range(0,20):
+ xBottomSpnBtn.executeAction("UP", tuple())
- xTopSpnBtn = xParagraphDlg.getChild("spinED_TOPDIST")
- for _ in range(0,20):
- xTopSpnBtn.executeAction("UP", tuple())
+ xTopSpnBtn = xParagraphDlg.getChild("spinED_TOPDIST")
+ for _ in range(0,20):
+ xTopSpnBtn.executeAction("UP", tuple())
- xOkBtn = xParagraphDlg.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xParagraphDlg.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 3704)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 3704)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 5503)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 5503)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 3704)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 3704)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 3704)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 5503)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 5503)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 3704)
- self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
- xParagraphDlg = self.xUITest.getTopFocusWindow()
+ xParagraphDlg = self.xUITest.getTopFocusWindow()
- xLeftSpnBtn = xParagraphDlg.getChild("spinED_LEFTINDENT")
- for _ in range(0,20):
- xLeftSpnBtn.executeAction("DOWN", tuple())
+ xLeftSpnBtn = xParagraphDlg.getChild("spinED_LEFTINDENT")
+ for _ in range(0,20):
+ xLeftSpnBtn.executeAction("DOWN", tuple())
- xRightSpnBtn = xParagraphDlg.getChild("spinED_RIGHTINDENT")
- for _ in range(0,20):
- xRightSpnBtn.executeAction("DOWN", tuple())
+ xRightSpnBtn = xParagraphDlg.getChild("spinED_RIGHTINDENT")
+ for _ in range(0,20):
+ xRightSpnBtn.executeAction("DOWN", tuple())
- xLineSpnBtn = xParagraphDlg.getChild("spinED_FLINEINDENT")
- for _ in range(0,20):
- xLineSpnBtn.executeAction("DOWN", tuple())
+ xLineSpnBtn = xParagraphDlg.getChild("spinED_FLINEINDENT")
+ for _ in range(0,20):
+ xLineSpnBtn.executeAction("DOWN", tuple())
- xBottomSpnBtn = xParagraphDlg.getChild("spinED_BOTTOMDIST")
- for _ in range(0,20):
- xBottomSpnBtn.executeAction("DOWN", tuple())
+ xBottomSpnBtn = xParagraphDlg.getChild("spinED_BOTTOMDIST")
+ for _ in range(0,20):
+ xBottomSpnBtn.executeAction("DOWN", tuple())
- xTopSpnBtn = xParagraphDlg.getChild("spinED_TOPDIST")
- for _ in range(0,20):
- xTopSpnBtn.executeAction("DOWN", tuple())
+ xTopSpnBtn = xParagraphDlg.getChild("spinED_TOPDIST")
+ for _ in range(0,20):
+ xTopSpnBtn.executeAction("DOWN", tuple())
- xOkBtn = xParagraphDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xParagraphDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0)
- self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 3704)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 3704)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 5503)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 5503)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 3704)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 3704)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 3704)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 5503)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 5503)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 3704)
- self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0)
- self.assertEqual(document.CurrentSelection.getByIndex(0).String, "Test for tdf79236")
+ self.assertEqual(document.CurrentSelection.getByIndex(0).String, "Test for tdf79236")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests4/insertBreakDialog.py b/sw/qa/uitest/writer_tests4/insertBreakDialog.py
index d9a1535f0d6d..6dda5b2fcf94 100644
--- a/sw/qa/uitest/writer_tests4/insertBreakDialog.py
+++ b/sw/qa/uitest/writer_tests4/insertBreakDialog.py
@@ -26,49 +26,57 @@ class WriterInsertBreakDialog(UITestCase):
def test_insert_line_break(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- xDialog = self.launch_dialog_and_select_option("linerb")
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xDialog = self.launch_dialog_and_select_option("linerb")
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.getPages(1)
+ self.getPages(1)
+
+ self.ui_test.close_doc()
def test_insert_column_break(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ xDialog = self.launch_dialog_and_select_option("columnrb")
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xDialog = self.launch_dialog_and_select_option("columnrb")
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.getPages(1)
- self.getPages(1)
+ self.ui_test.close_doc()
def test_insert_page_break(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ for i in range(9):
+ with self.subTest(i=i):
+ xDialog = self.launch_dialog_and_select_option("pagerb")
- for i in range(9):
- with self.subTest(i=i):
- xDialog = self.launch_dialog_and_select_option("pagerb")
+ xStyleList = xDialog.getChild("stylelb")
+ xStyleList.executeAction("SELECT", mkPropertyValues({"POS": str(i)}))
- xStyleList = xDialog.getChild("stylelb")
- xStyleList.executeAction("SELECT", mkPropertyValues({"POS": str(i)}))
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.getPages(i + 2)
- self.getPages(i + 2)
+ self.ui_test.close_doc()
def test_cancel_button_insert_line_break_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertBreak")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- self.ui_test.execute_dialog_through_command(".uno:InsertBreak")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ self.getPages(1)
- self.getPages(1)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests4/insertPageHeader.py b/sw/qa/uitest/writer_tests4/insertPageHeader.py
index 28e7ff29a314..245073ace5a5 100644
--- a/sw/qa/uitest/writer_tests4/insertPageHeader.py
+++ b/sw/qa/uitest/writer_tests4/insertPageHeader.py
@@ -38,31 +38,35 @@ class WriterInsertPageHeader(UITestCase):
document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
def test_header(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.insert_header()
+ self.insert_header()
- self.delete_header()
+ self.delete_header()
+
+ self.ui_test.close_doc()
def test_tdf107427(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.insert_header()
- self.insert_header()
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xInsertDlg = self.xUITest.getTopFocusWindow()
- xInsertDlg = self.xUITest.getTopFocusWindow()
+ xOkBtn = xInsertDlg.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xOkBtn = xInsertDlg.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ document = self.ui_test.get_component()
- document = self.ui_test.get_component()
+ tables = document.getTextTables()
+ self.assertEqual(len(tables[0].getRows()), 2)
+ self.assertEqual(len(tables[0].getColumns()), 2)
- tables = document.getTextTables()
- self.assertEqual(len(tables[0].getRows()), 2)
- self.assertEqual(len(tables[0].getColumns()), 2)
+ self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:SelectAll")
+ self.delete_header()
- self.delete_header()
+ self.ui_test.close_doc()
diff --git a/sw/qa/uitest/writer_tests4/spellDialog.py b/sw/qa/uitest/writer_tests4/spellDialog.py
index b1458933830d..fea337bd2c3f 100644
--- a/sw/qa/uitest/writer_tests4/spellDialog.py
+++ b/sw/qa/uitest/writer_tests4/spellDialog.py
@@ -59,46 +59,46 @@ frog, dogg, catt"""
# This automates the steps described in the bug report tdf#46852
# Step 1: Create a document with repetitious misspelled words
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- cursor = document.getCurrentController().getViewCursor()
- # Inserted text must be en_US, so make sure to set language in current location
- cursor.CharLocale = Locale("en", "US", "")
- input_text = self.TDF46852_INPUT.replace('\n', '\r') # \r = para break
- document.Text.insertString(cursor, input_text, False)
-
- # Step 2: Place cursor on 4th line after second "frogg"
- cursor.goUp(2, False)
- cursor.goLeft(1, False)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ cursor = document.getCurrentController().getViewCursor()
+ # Inserted text must be en_US, so make sure to set language in current location
+ cursor.CharLocale = Locale("en", "US", "")
+ input_text = self.TDF46852_INPUT.replace('\n', '\r') # \r = para break
+ document.Text.insertString(cursor, input_text, False)
+
+ # Step 2: Place cursor on 4th line after second "frogg"
+ cursor.goUp(2, False)
+ cursor.goLeft(1, False)
+
+ # Step 3: Initiate spellchecking, and make sure "Check grammar" is
+ # unchecked
+ spell_dialog = self.launch_dialog()
+ checkgrammar = spell_dialog.getChild('checkgrammar')
+ if get_state_as_dict(checkgrammar)['Selected'] == 'true':
+ checkgrammar.executeAction('CLICK', ())
+ self.assertTrue(get_state_as_dict(checkgrammar)['Selected'] == 'false')
+
+ # Step 4: Repetitively click on "Correct all" for each misspelling
+ # prompt until end of document is reached.
+ changeall = spell_dialog.getChild('changeall')
+ changeall.executeAction("CLICK", ())
+ changeall.executeAction("CLICK", ())
+ # The third time we click on changeall, the click action is going to
+ # block while two message boxes are shown, so we need to do this third
+ # click specially
+ # Use empty close_button to open consecutive dialogs
+ with self.ui_test.execute_blocking_action(
+ changeall.executeAction, args=('CLICK', ()), close_button="") as dialog:
+ # Step 5: Confirm to "Continue check at beginning of document"
+ xYesBtn = dialog.getChild("yes")
- # Step 3: Initiate spellchecking, and make sure "Check grammar" is
- # unchecked
- spell_dialog = self.launch_dialog()
- checkgrammar = spell_dialog.getChild('checkgrammar')
- if get_state_as_dict(checkgrammar)['Selected'] == 'true':
- checkgrammar.executeAction('CLICK', ())
- self.assertTrue(get_state_as_dict(checkgrammar)['Selected'] == 'false')
-
- # Step 4: Repetitively click on "Correct all" for each misspelling
- # prompt until end of document is reached.
- changeall = spell_dialog.getChild('changeall')
- changeall.executeAction("CLICK", ())
- changeall.executeAction("CLICK", ())
- # The third time we click on changeall, the click action is going to
- # block while two message boxes are shown, so we need to do this third
- # click specially
- # Use empty close_button to open consecutive dialogs
with self.ui_test.execute_blocking_action(
- changeall.executeAction, args=('CLICK', ()), close_button="") as dialog:
- # Step 5: Confirm to "Continue check at beginning of document"
- xYesBtn = dialog.getChild("yes")
-
- with self.ui_test.execute_blocking_action(
- xYesBtn.executeAction, args=('CLICK', ())):
- pass
+ xYesBtn.executeAction, args=('CLICK', ())):
+ pass
- output_text = document.Text.getString().replace('\r\n', '\n')
- self.assertTrue(re.match(self.TDF46852_REGEX, output_text))
+ output_text = document.Text.getString().replace('\r\n', '\n')
+ self.assertTrue(re.match(self.TDF46852_REGEX, output_text))
def test_tdf66043(self):
supported_locale = self.is_supported_locale("en", "US")
diff --git a/sw/qa/uitest/writer_tests4/start.py b/sw/qa/uitest/writer_tests4/start.py
index 83b28d616818..1ee80f604013 100644
--- a/sw/qa/uitest/writer_tests4/start.py
+++ b/sw/qa/uitest/writer_tests4/start.py
@@ -14,32 +14,36 @@ class SimpleWriterTest(UITestCase):
def test_start_writer(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- xWriterEdit.executeAction("SET", mkPropertyValues({"ZOOM": "200"}))
+ xWriterEdit.executeAction("SET", mkPropertyValues({"ZOOM": "200"}))
- self.assertEqual(get_state_as_dict(xWriterEdit)["Zoom"], "200")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["Zoom"], "200")
+
+ self.ui_test.close_doc()
def test_goto_first_page(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ state = get_state_as_dict(xWriterEdit)
+ while state["CurrentPage"] == "1":
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
state = get_state_as_dict(xWriterEdit)
- while state["CurrentPage"] == "1":
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- state = get_state_as_dict(xWriterEdit)
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+
+ xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "1"}))
- xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "1"}))
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "1")
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "1")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests4/tdf113252.py b/sw/qa/uitest/writer_tests4/tdf113252.py
index 11d85e108eeb..5e3f868f37ad 100644
--- a/sw/qa/uitest/writer_tests4/tdf113252.py
+++ b/sw/qa/uitest/writer_tests4/tdf113252.py
@@ -12,27 +12,28 @@ from uitest.uihelper.common import select_pos
class tdf113252(UITestCase):
def test_tdf113252_macro_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
-
- #Start LibreOffice. Go to Tools > Macros > Organize Macros > Basic
- self.ui_test.execute_dialog_through_command(".uno:MacroDialog")
- xDialog = self.xUITest.getTopFocusWindow()
-
- #Click Button Organizer
- xorganize = xDialog.getChild("organize")
- with self.ui_test.execute_blocking_action(xorganize.executeAction, args=('CLICK', ()), close_button="close") as dialog:
- xTabs = dialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- select_pos(xTabs, "1")
- select_pos(xTabs, "2")
- #Click button Close in the next dialog -> crash.
-
- xClose = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xClose)
-
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "1")
-
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ #Start LibreOffice. Go to Tools > Macros > Organize Macros > Basic
+ self.ui_test.execute_dialog_through_command(".uno:MacroDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ #Click Button Organizer
+ xorganize = xDialog.getChild("organize")
+ with self.ui_test.execute_blocking_action(xorganize.executeAction, args=('CLICK', ()), close_button="close") as dialog:
+ xTabs = dialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ select_pos(xTabs, "1")
+ select_pos(xTabs, "2")
+ #Click button Close in the next dialog -> crash.
+
+ xClose = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xClose)
+
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "1")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests4/tdf115572.py b/sw/qa/uitest/writer_tests4/tdf115572.py
index 6289aa9dd1a8..511da669ccc9 100644
--- a/sw/qa/uitest/writer_tests4/tdf115572.py
+++ b/sw/qa/uitest/writer_tests4/tdf115572.py
@@ -15,60 +15,63 @@ class tdf115572(UITestCase):
tableText.setString( text )
def test_tdf115572_table_format_gets_reset_deleting_row(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #insert table 2x2
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
- #select font format - Bold and write text "abc"
- self.xUITest.executeCommand(".uno:Bold")
- tables = document.getTextTables()
- self.insertTextIntoCell(tables[0], "A1", "abc" )
- #go to second row - arrow down
- self.xUITest.executeCommand(".uno:GoDown")
- #delete row
- self.xUITest.executeCommand(".uno:DeleteRows")
- #now the cursor is in the second column - go left
- self.xUITest.executeCommand(".uno:GoLeft")
- self.xUITest.executeCommand(".uno:GoLeft")
- #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
- self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #insert table 2x2
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+ #select font format - Bold and write text "abc"
+ self.xUITest.executeCommand(".uno:Bold")
+ tables = document.getTextTables()
+ self.insertTextIntoCell(tables[0], "A1", "abc" )
+ #go to second row - arrow down
+ self.xUITest.executeCommand(".uno:GoDown")
+ #delete row
+ self.xUITest.executeCommand(".uno:DeleteRows")
+ #now the cursor is in the second column - go left
+ self.xUITest.executeCommand(".uno:GoLeft")
+ self.xUITest.executeCommand(".uno:GoLeft")
+ #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
+ self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
def test_tdf115572_table_format_gets_reset_deleting_column(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #insert table 2x2
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
- #select font format - Bold and write text "abc"
- self.xUITest.executeCommand(".uno:Bold")
- tables = document.getTextTables()
- self.insertTextIntoCell(tables[0], "A1", "abc" )
- #go to second column
- self.xUITest.executeCommand(".uno:GoRight")
- #delete column
- self.xUITest.executeCommand(".uno:DeleteColumns")
- #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
- self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #insert table 2x2
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+ #select font format - Bold and write text "abc"
+ self.xUITest.executeCommand(".uno:Bold")
+ tables = document.getTextTables()
+ self.insertTextIntoCell(tables[0], "A1", "abc" )
+ #go to second column
+ self.xUITest.executeCommand(".uno:GoRight")
+ #delete column
+ self.xUITest.executeCommand(".uno:DeleteColumns")
+ #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
+ self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests4/tdf115573.py b/sw/qa/uitest/writer_tests4/tdf115573.py
index b931cbcdcbd6..af22c155b21e 100644
--- a/sw/qa/uitest/writer_tests4/tdf115573.py
+++ b/sw/qa/uitest/writer_tests4/tdf115573.py
@@ -15,114 +15,121 @@ class tdf115573(UITestCase):
tableText.setString( text )
def test_tdf115573_Table_loses_formatting_inserting_row_before(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #insert table 2x2
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
- #select font format - Bold and write text "abc"
- self.xUITest.executeCommand(".uno:Bold")
- tables = document.getTextTables()
- self.insertTextIntoCell(tables[0], "A1", "abc" )
- #go to second row - arrow down
- self.xUITest.executeCommand(".uno:GoDown")
- #insert row
- self.xUITest.executeCommand(".uno:InsertRowsBefore")
- #go up
- self.xUITest.executeCommand(".uno:GoUp")
- self.xUITest.executeCommand(".uno:GoUp")
- #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
- self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #insert table 2x2
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+ #select font format - Bold and write text "abc"
+ self.xUITest.executeCommand(".uno:Bold")
+ tables = document.getTextTables()
+ self.insertTextIntoCell(tables[0], "A1", "abc" )
+ #go to second row - arrow down
+ self.xUITest.executeCommand(".uno:GoDown")
+ #insert row
+ self.xUITest.executeCommand(".uno:InsertRowsBefore")
+ #go up
+ self.xUITest.executeCommand(".uno:GoUp")
+ self.xUITest.executeCommand(".uno:GoUp")
+ #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
+ self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
def test_tdf115573_Table_loses_formatting_inserting_row_after(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #insert table 2x2
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
- #select font format - Bold and write text "abc"
- self.xUITest.executeCommand(".uno:Bold")
- tables = document.getTextTables()
- self.insertTextIntoCell(tables[0], "A1", "abc" )
- #go to second row - arrow down
- self.xUITest.executeCommand(".uno:GoDown")
- #insert row
- self.xUITest.executeCommand(".uno:InsertRowsAfter")
- #go up
- self.xUITest.executeCommand(".uno:GoUp")
- self.xUITest.executeCommand(".uno:GoUp")
- #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
- self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #insert table 2x2
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+ #select font format - Bold and write text "abc"
+ self.xUITest.executeCommand(".uno:Bold")
+ tables = document.getTextTables()
+ self.insertTextIntoCell(tables[0], "A1", "abc" )
+ #go to second row - arrow down
+ self.xUITest.executeCommand(".uno:GoDown")
+ #insert row
+ self.xUITest.executeCommand(".uno:InsertRowsAfter")
+ #go up
+ self.xUITest.executeCommand(".uno:GoUp")
+ self.xUITest.executeCommand(".uno:GoUp")
+ #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
+ self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
def test_tdf115573_Table_loses_formatting_inserting_column_left(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #insert table 2x2
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
- #select font format - Bold and write text "abc"
- self.xUITest.executeCommand(".uno:Bold")
- tables = document.getTextTables()
- self.insertTextIntoCell(tables[0], "A1", "abc" )
- #insert column left
- self.xUITest.executeCommand(".uno:InsertColumnsBefore")
- #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
- self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #insert table 2x2
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+ #select font format - Bold and write text "abc"
+ self.xUITest.executeCommand(".uno:Bold")
+ tables = document.getTextTables()
+ self.insertTextIntoCell(tables[0], "A1", "abc" )
+ #insert column left
+ self.xUITest.executeCommand(".uno:InsertColumnsBefore")
+ #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
+ self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
def test_tdf115573_Table_loses_formatting_inserting_column_right(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #insert table 2x2
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
- #select font format - Bold and write text "abc"
- self.xUITest.executeCommand(".uno:Bold")
- tables = document.getTextTables()
- self.insertTextIntoCell(tables[0], "A1", "abc" )
- #insert column left
- self.xUITest.executeCommand(".uno:InsertColumnsAfter")
- #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
- self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #insert table 2x2
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+ #select font format - Bold and write text "abc"
+ self.xUITest.executeCommand(".uno:Bold")
+ tables = document.getTextTables()
+ self.insertTextIntoCell(tables[0], "A1", "abc" )
+ #insert column left
+ self.xUITest.executeCommand(".uno:InsertColumnsAfter")
+ #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xweststylelbcjk = xDialog.getChild("weststylelb-cjk")
+ self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold")
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests4/tdf51352.py b/sw/qa/uitest/writer_tests4/tdf51352.py
index 1dd766afbfce..fdc5c66b7e85 100644
--- a/sw/qa/uitest/writer_tests4/tdf51352.py
+++ b/sw/qa/uitest/writer_tests4/tdf51352.py
@@ -12,40 +12,41 @@ class tdf51352(UITestCase):
def test_convert_nested_table_to_text_tdf51352(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- document = self.ui_test.get_component()
- #1. New a text document
- #2. Insert a table and then in one cell create another table
- #-insert a table (by default 2x2)
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- #-put the cursor inside first cell top left for example
- #-insert an inner table (by default 2x2) inside this cell
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- #3. Select the first table
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- self.assertEqual(document.TextTables.getCount(), 2)
- #4. From menu "Table->Convert->Table to Text
- self.ui_test.execute_dialog_through_command(".uno:ConvertTableToText")
- xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- self.assertEqual(document.TextTables.getCount(), 0)
- #5. Undo/Redo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.TextTables.getCount(), 2)
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(document.TextTables.getCount(), 0)
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ document = self.ui_test.get_component()
+ #1. New a text document
+ #2. Insert a table and then in one cell create another table
+ #-insert a table (by default 2x2)
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ #-put the cursor inside first cell top left for example
+ #-insert an inner table (by default 2x2) inside this cell
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ #3. Select the first table
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ self.assertEqual(document.TextTables.getCount(), 2)
+ #4. From menu "Table->Convert->Table to Text
+ self.ui_test.execute_dialog_through_command(".uno:ConvertTableToText")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ self.assertEqual(document.TextTables.getCount(), 0)
+ #5. Undo/Redo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.TextTables.getCount(), 2)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.TextTables.getCount(), 0)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests4/tdf92611.py b/sw/qa/uitest/writer_tests4/tdf92611.py
index be2971055f79..8fee6143c4c7 100644
--- a/sw/qa/uitest/writer_tests4/tdf92611.py
+++ b/sw/qa/uitest/writer_tests4/tdf92611.py
@@ -10,10 +10,12 @@ class tdf92611(UITestCase):
def test_launch_and_close_bibliography(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.xUITest.executeCommand(".uno:BibliographyComponent")
+ self.xUITest.executeCommand(".uno:BibliographyComponent")
- self.xUITest.executeCommand(".uno:CloseWin")
+ self.xUITest.executeCommand(".uno:CloseWin")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/about_test.py b/sw/qa/uitest/writer_tests5/about_test.py
index 0ab691dcc35b..7005dbb65221 100644
--- a/sw/qa/uitest/writer_tests5/about_test.py
+++ b/sw/qa/uitest/writer_tests5/about_test.py
@@ -11,13 +11,15 @@ class AboutDlgTest(UITestCase):
def test_about_dlg(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.ui_test.execute_dialog_through_command(".uno:About")
+ self.ui_test.execute_dialog_through_command(".uno:About")
- xAboutDlg = self.xUITest.getTopFocusWindow()
+ xAboutDlg = self.xUITest.getTopFocusWindow()
- xCloseBtn = xAboutDlg.getChild("btnClose")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ xCloseBtn = xAboutDlg.getChild("btnClose")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/autocorrectOptions.py b/sw/qa/uitest/writer_tests5/autocorrectOptions.py
index bdf28325a700..645a334187eb 100644
--- a/sw/qa/uitest/writer_tests5/autocorrectOptions.py
+++ b/sw/qa/uitest/writer_tests5/autocorrectOptions.py
@@ -12,87 +12,89 @@ from uitest.uihelper.common import select_pos
class autocorrectOptions(UITestCase):
def test_autocorrect_options_writer(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
-
- 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"]
-
- self.assertTrue(int(nrRows) > 0)
-
- #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)["VisibleCount"]
-
- self.assertTrue(int(nrRowsAbb) > 0)
-
- 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)["VisibleCount"]
- nrRowsAbbDiff = int(nrRowsAbbNew) - int(nrRowsAbb)
- self.assertEqual(nrRowsAbbDiff, 1) #we have +1 rule
- delabbrev.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(abbrevlist)["VisibleCount"], 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)["VisibleCount"]
-
- self.assertTrue(int(nrRowsDouble) > 0)
-
- 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)["VisibleCount"]
- 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)["VisibleCount"], nrRowsDouble) #we have default nr of rules
-
- xCancelButton = xDialog.getChild("cancel")
- xCancelButton.executeAction("CLICK", tuple())
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ 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"]
+
+ self.assertTrue(int(nrRows) > 0)
+
+ #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)["VisibleCount"]
+
+ self.assertTrue(int(nrRowsAbb) > 0)
+
+ 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)["VisibleCount"]
+ nrRowsAbbDiff = int(nrRowsAbbNew) - int(nrRowsAbb)
+ self.assertEqual(nrRowsAbbDiff, 1) #we have +1 rule
+ delabbrev.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(abbrevlist)["VisibleCount"], 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)["VisibleCount"]
+
+ self.assertTrue(int(nrRowsDouble) > 0)
+
+ 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)["VisibleCount"]
+ 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)["VisibleCount"], 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/sw/qa/uitest/writer_tests5/columns.py b/sw/qa/uitest/writer_tests5/columns.py
index bede4b0f16db..03ca73b083ad 100644
--- a/sw/qa/uitest/writer_tests5/columns.py
+++ b/sw/qa/uitest/writer_tests5/columns.py
@@ -12,41 +12,43 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class columns(UITestCase):
def test_columns(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- change_measurement_unit(self, "Centimeter")
+ change_measurement_unit(self, "Centimeter")
- #dialog Columns
- self.ui_test.execute_dialog_through_command(".uno:FormatColumns")
- xDialog = self.xUITest.getTopFocusWindow()
+ #dialog Columns
+ self.ui_test.execute_dialog_through_command(".uno:FormatColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
- colsnf = xDialog.getChild("colsnf")
- colsnf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- colsnf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- colsnf.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
- colsnf.executeAction("UP", tuple())
- colsnf.executeAction("DOWN", tuple())
- spacing1mf = xDialog.getChild("spacing1mf")
- spacing1mf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- spacing1mf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- spacing1mf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- autowidth = xDialog.getChild("autowidth")
- autowidth.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.ui_test.execute_dialog_through_command(".uno:FormatColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- colsnf = xDialog.getChild("colsnf")
- spacing1mf = xDialog.getChild("spacing1mf")
- autowidth = xDialog.getChild("autowidth")
+ colsnf = xDialog.getChild("colsnf")
+ colsnf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ colsnf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ colsnf.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
+ colsnf.executeAction("UP", tuple())
+ colsnf.executeAction("DOWN", tuple())
+ spacing1mf = xDialog.getChild("spacing1mf")
+ spacing1mf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ spacing1mf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ spacing1mf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ autowidth = xDialog.getChild("autowidth")
+ autowidth.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.ui_test.execute_dialog_through_command(".uno:FormatColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ colsnf = xDialog.getChild("colsnf")
+ spacing1mf = xDialog.getChild("spacing1mf")
+ autowidth = xDialog.getChild("autowidth")
- self.assertEqual(get_state_as_dict(colsnf)["Text"], "2")
- self.assertEqual(get_state_as_dict(spacing1mf)["Text"], "1.00 cm")
- self.assertEqual(get_state_as_dict(autowidth)["Selected"], "false")
- xOKBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.assertEqual(get_state_as_dict(colsnf)["Text"], "2")
+ self.assertEqual(get_state_as_dict(spacing1mf)["Text"], "1.00 cm")
+ self.assertEqual(get_state_as_dict(autowidth)["Selected"], "false")
+ xOKBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/tdf107494.py b/sw/qa/uitest/writer_tests5/tdf107494.py
index 98de7442e5f3..0657f33f0635 100644
--- a/sw/qa/uitest/writer_tests5/tdf107494.py
+++ b/sw/qa/uitest/writer_tests5/tdf107494.py
@@ -12,71 +12,74 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf107494(UITestCase):
def test_tdf107494_delete_header_with_image(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #insert header
- self.assertEqual(document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
- self.xUITest.executeCommand(".uno:InsertPageHeader?PageStyle:string=Default%20Page%20Style&On:bool=true")
- self.assertEqual(document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True)
- #insert image
- text = document.getText()
- cursor = text.createTextCursor()
- oStyleFamilies = document.getStyleFamilies()
- #https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=71227
- obj2 = oStyleFamilies.getByName("PageStyles")
- obj3 = obj2.getByName("Standard")
- oHeaderText = obj3.HeaderText
- oHeaderText.setString("New text for header") #write text to header
- obj4 = oHeaderText.createTextCursor()
- text = obj4.getText()
- cursor = text.createTextCursor()
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #insert header
+ self.assertEqual(document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
+ self.xUITest.executeCommand(".uno:InsertPageHeader?PageStyle:string=Default%20Page%20Style&On:bool=true")
+ self.assertEqual(document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True)
+ #insert image
+ text = document.getText()
+ cursor = text.createTextCursor()
+ oStyleFamilies = document.getStyleFamilies()
+ #https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=71227
+ obj2 = oStyleFamilies.getByName("PageStyles")
+ obj3 = obj2.getByName("Standard")
+ oHeaderText = obj3.HeaderText
+ oHeaderText.setString("New text for header") #write text to header
+ obj4 = oHeaderText.createTextCursor()
+ text = obj4.getText()
+ cursor = text.createTextCursor()
- textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
- provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
- graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice_external_logo_100px.png")}))
- textGraphic.Graphic = graphic
- text.insertTextContent(cursor, textGraphic, False)
- # Delete the header
- self.ui_test.execute_dialog_through_command(".uno:InsertPageHeader?PageStyle:string=Default%20Page%20Style&On:bool=false")
- xDialog = self.xUITest.getTopFocusWindow() #question dialog
- xOption = xDialog.getChild("yes")
- xOption.executeAction("CLICK", tuple())
+ textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
+ provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
+ graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice_external_logo_100px.png")}))
+ textGraphic.Graphic = graphic
+ text.insertTextContent(cursor, textGraphic, False)
+ # Delete the header
+ self.ui_test.execute_dialog_through_command(".uno:InsertPageHeader?PageStyle:string=Default%20Page%20Style&On:bool=false")
+ xDialog = self.xUITest.getTopFocusWindow() #question dialog
+ xOption = xDialog.getChild("yes")
+ xOption.executeAction("CLICK", tuple())
- self.assertEqual(document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
+ self.assertEqual(document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
+
+ self.ui_test.close_doc()
def test_tdf107494_delete_footer_with_image(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #insert footer
- self.assertEqual(document.StyleFamilies.PageStyles.Standard.FooterIsOn, False)
- self.xUITest.executeCommand(".uno:InsertPageFooter?PageStyle:string=Default%20Page%20Style&On:bool=true")
- self.assertEqual(document.StyleFamilies.PageStyles.Standard.FooterIsOn, True)
- #insert image
- text = document.getText()
- cursor = text.createTextCursor()
- oStyleFamilies = document.getStyleFamilies()
- #https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=71227
- obj2 = oStyleFamilies.getByName("PageStyles")
- obj3 = obj2.getByName("Standard")
- oFooterText = obj3.FooterText
- oFooterText.setString("New text for footer") #write text to footer
- obj4 = oFooterText.createTextCursor()
- text = obj4.getText()
- cursor = text.createTextCursor()
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #insert footer
+ self.assertEqual(document.StyleFamilies.PageStyles.Standard.FooterIsOn, False)
+ self.xUITest.executeCommand(".uno:InsertPageFooter?PageStyle:string=Default%20Page%20Style&On:bool=true")
+ self.assertEqual(document.StyleFamilies.PageStyles.Standard.FooterIsOn, True)
+ #insert image
+ text = document.getText()
+ cursor = text.createTextCursor()
+ oStyleFamilies = document.getStyleFamilies()
+ #https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=71227
+ obj2 = oStyleFamilies.getByName("PageStyles")
+ obj3 = obj2.getByName("Standard")
+ oFooterText = obj3.FooterText
+ oFooterText.setString("New text for footer") #write text to footer
+ obj4 = oFooterText.createTextCursor()
+ text = obj4.getText()
+ cursor = text.createTextCursor()
- textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
- provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
- graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice_external_logo_100px.png")}))
- textGraphic.Graphic = graphic
- text.insertTextContent(cursor, textGraphic, False)
- # Delete the footer
- self.ui_test.execute_dialog_through_command(".uno:InsertPageFooter?PageStyle:string=Default%20Page%20Style&On:bool=false")
- xDialog = self.xUITest.getTopFocusWindow() #question dialog
- xOption = xDialog.getChild("yes")
- xOption.executeAction("CLICK", tuple())
+ textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
+ provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
+ graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice_external_logo_100px.png")}))
+ textGraphic.Graphic = graphic
+ text.insertTextContent(cursor, textGraphic, False)
+ # Delete the footer
+ self.ui_test.execute_dialog_through_command(".uno:InsertPageFooter?PageStyle:string=Default%20Page%20Style&On:bool=false")
+ xDialog = self.xUITest.getTopFocusWindow() #question dialog
+ xOption = xDialog.getChild("yes")
+ xOption.executeAction("CLICK", tuple())
- self.assertEqual(document.StyleFamilies.PageStyles.Standard.FooterIsOn, False)
+ self.assertEqual(document.StyleFamilies.PageStyles.Standard.FooterIsOn, False)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/tdf122045.py b/sw/qa/uitest/writer_tests5/tdf122045.py
index 4b410aad9d3c..c40469a70de8 100644
--- a/sw/qa/uitest/writer_tests5/tdf122045.py
+++ b/sw/qa/uitest/writer_tests5/tdf122045.py
@@ -12,29 +12,31 @@ class tdf122045(UITestCase):
def test_tdf122045(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:PageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
- btncolor = xDialog.getChild("btncolor")
- btncolor.executeAction("CLICK", tuple())
+ btncolor = xDialog.getChild("btncolor")
+ btncolor.executeAction("CLICK", tuple())
- xApplyBtn = xDialog.getChild("apply")
- xApplyBtn.executeAction("CLICK", tuple())
+ xApplyBtn = xDialog.getChild("apply")
+ xApplyBtn.executeAction("CLICK", tuple())
- self.assertTrue(document.isModified())
- self.assertEqual("0x729fcf", hex(document.StyleFamilies.PageStyles.Standard.BackColor))
+ self.assertTrue(document.isModified())
+ self.assertEqual("0x729fcf", hex(document.StyleFamilies.PageStyles.Standard.BackColor))
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- self.assertTrue(document.isModified())
- self.assertEqual("0x729fcf", hex(document.StyleFamilies.PageStyles.Standard.BackColor))
+ self.assertTrue(document.isModified())
+ self.assertEqual("0x729fcf", hex(document.StyleFamilies.PageStyles.Standard.BackColor))
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/tdf122722.py b/sw/qa/uitest/writer_tests5/tdf122722.py
index 9b3e43565ce4..4e91519a37af 100644
--- a/sw/qa/uitest/writer_tests5/tdf122722.py
+++ b/sw/qa/uitest/writer_tests5/tdf122722.py
@@ -12,60 +12,61 @@ from uitest.uihelper.common import select_pos
class tdf122722(UITestCase):
def test_tdf122722_format_character_hidden(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- #1. Start LibreOffice
- #2. Create New Writer Document
- #3. Type "LibreOffice" in Writer
- type_text(xWriterEdit, "LibreOffice")
- #4. Select "LibreOffice" with mouse, and right click
- self.xUITest.executeCommand(".uno:SelectAll")
- self.assertEqual(document.Text.String[0:11], "LibreOffice")
- #5. Appear Context Menu, Character -> Character
- #6. Opened Character, Select "Font Effect" tab
- #7. Check Hidden, and click [OK]
- #8. Crash a LibreOffice
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ #1. Start LibreOffice
+ #2. Create New Writer Document
+ #3. Type "LibreOffice" in Writer
+ type_text(xWriterEdit, "LibreOffice")
+ #4. Select "LibreOffice" with mouse, and right click
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.assertEqual(document.Text.String[0:11], "LibreOffice")
+ #5. Appear Context Menu, Character -> Character
+ #6. Opened Character, Select "Font Effect" tab
+ #7. Check Hidden, and click [OK]
+ #8. Crash a LibreOffice
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
- xEffects = xDialog.getChild("effectslb")
- xRelief = xDialog.getChild("relieflb")
- xHidden = xDialog.getChild("hiddencb")
- xOverline = xDialog.getChild("overlinelb")
- xStrikeout = xDialog.getChild("strikeoutlb")
- xUnderline = xDialog.getChild("underlinelb")
- xEmphasis = xDialog.getChild("emphasislb")
- xPosition = xDialog.getChild("positionlb")
+ xEffects = xDialog.getChild("effectslb")
+ xRelief = xDialog.getChild("relieflb")
+ xHidden = xDialog.getChild("hiddencb")
+ xOverline = xDialog.getChild("overlinelb")
+ xStrikeout = xDialog.getChild("strikeoutlb")
+ xUnderline = xDialog.getChild("underlinelb")
+ xEmphasis = xDialog.getChild("emphasislb")
+ xPosition = xDialog.getChild("positionlb")
- xHidden.executeAction("CLICK", tuple())
+ xHidden.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #un-hidden
- self.ui_test.execute_dialog_through_command(".uno:FontDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #un-hidden
+ self.ui_test.execute_dialog_through_command(".uno:FontDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
- xEffects = xDialog.getChild("effectslb")
- xRelief = xDialog.getChild("relieflb")
- xHidden = xDialog.getChild("hiddencb")
- xOverline = xDialog.getChild("overlinelb")
- xStrikeout = xDialog.getChild("strikeoutlb")
- xUnderline = xDialog.getChild("underlinelb")
- xEmphasis = xDialog.getChild("emphasislb")
- xPosition = xDialog.getChild("positionlb")
+ xEffects = xDialog.getChild("effectslb")
+ xRelief = xDialog.getChild("relieflb")
+ xHidden = xDialog.getChild("hiddencb")
+ xOverline = xDialog.getChild("overlinelb")
+ xStrikeout = xDialog.getChild("strikeoutlb")
+ xUnderline = xDialog.getChild("underlinelb")
+ xEmphasis = xDialog.getChild("emphasislb")
+ xPosition = xDialog.getChild("positionlb")
- self.assertEqual(get_state_as_dict(xHidden)["Selected"], "true")
- xHidden.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(xHidden)["Selected"], "true")
+ xHidden.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- self.assertEqual(document.Text.String[0:11], "LibreOffice")
+ self.assertEqual(document.Text.String[0:11], "LibreOffice")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/tdf123378.py b/sw/qa/uitest/writer_tests5/tdf123378.py
index 444a92c0a028..d7b832e25c8c 100644
--- a/sw/qa/uitest/writer_tests5/tdf123378.py
+++ b/sw/qa/uitest/writer_tests5/tdf123378.py
@@ -12,15 +12,16 @@ class tdf123378(UITestCase):
def test_tdf123378_print_sets_modified(self):
# FIXME unstable test
return
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- self.xUITest.executeCommand(".uno:Print")
- xDialog = self.xUITest.getTopFocusWindow()
- xOK = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xOK)
+ self.xUITest.executeCommand(".uno:Print")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOK = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xOK)
- self.assertEqual(document.isModified(), False)
+ self.assertEqual(document.isModified(), False)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/tdf123446.py b/sw/qa/uitest/writer_tests5/tdf123446.py
index 15aa646ff93b..5a48578fa593 100644
--- a/sw/qa/uitest/writer_tests5/tdf123446.py
+++ b/sw/qa/uitest/writer_tests5/tdf123446.py
@@ -11,32 +11,33 @@ from uitest.uihelper.common import type_text
class tdf123446(UITestCase):
def test_tsd123446_undo_redo_ToC_crash(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- #- Add a word to an empty document.
- type_text(xWriterEdit, "LibreOffice")
- #- Change its style to Heading 2.
- self.xUITest.executeCommand(".uno:StyleApply?Style:string=Heading%202&FamilyName:string=ParagraphStyles")
- #- Position cursor somewhere in the middle of the word, and add Table of Contents
- #(no need to change anything in the dialog).
- self.xUITest.executeCommand(".uno:GoLeft")
- self.xUITest.executeCommand(".uno:GoLeft")
- self.xUITest.executeCommand(".uno:GoLeft")
- self.xUITest.executeCommand(".uno:GoLeft")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ #- Add a word to an empty document.
+ type_text(xWriterEdit, "LibreOffice")
+ #- Change its style to Heading 2.
+ self.xUITest.executeCommand(".uno:StyleApply?Style:string=Heading%202&FamilyName:string=ParagraphStyles")
+ #- Position cursor somewhere in the middle of the word, and add Table of Contents
+ #(no need to change anything in the dialog).
+ self.xUITest.executeCommand(".uno:GoLeft")
+ self.xUITest.executeCommand(".uno:GoLeft")
+ self.xUITest.executeCommand(".uno:GoLeft")
+ self.xUITest.executeCommand(".uno:GoLeft")
- self.ui_test.execute_dialog_through_command(".uno:InsertMultiIndex")
- xDialog = self.xUITest.getTopFocusWindow()
- xokbtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xokbtn)
- #- Undo the ToC insertion.
- self.xUITest.executeCommand(".uno:Undo")
- #- Redo the ToC insertion.
- self.xUITest.executeCommand(".uno:Redo")
- #=> Crash. Now we verify the text
- # This second undo crash in Clang build https://bugs.documentfoundation.org/show_bug.cgi?id=123313#c9
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Text.String[0:7], "LibreOf")
+ self.ui_test.execute_dialog_through_command(".uno:InsertMultiIndex")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xokbtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xokbtn)
+ #- Undo the ToC insertion.
+ self.xUITest.executeCommand(".uno:Undo")
+ #- Redo the ToC insertion.
+ self.xUITest.executeCommand(".uno:Redo")
+ #=> Crash. Now we verify the text
+ # This second undo crash in Clang build https://bugs.documentfoundation.org/show_bug.cgi?id=123313#c9
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Text.String[0:7], "LibreOf")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/titlePage.py b/sw/qa/uitest/writer_tests5/titlePage.py
index 5f3e9f8fcf91..f048bc6ea006 100644
--- a/sw/qa/uitest/writer_tests5/titlePage.py
+++ b/sw/qa/uitest/writer_tests5/titlePage.py
@@ -9,28 +9,30 @@ from uitest.framework import UITestCase
class titlePage(UITestCase):
def test_title_page(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #dialog Title Page
- self.ui_test.execute_dialog_through_command(".uno:TitlePageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- #print(xDialog.getChildren())
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #dialog Title Page
+ self.ui_test.execute_dialog_through_command(".uno:TitlePageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #print(xDialog.getChildren())
- #select new Pages; nr of pages =2 (click UP), save; verify pageCount = 3
- newPages = xDialog.getChild("RB_INSERT_NEW_PAGES")
- newPages.executeAction("CLICK", tuple())
- xpageCount = xDialog.getChild("NF_PAGE_COUNT")
- xpageCount.executeAction("UP", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.assertEqual(document.CurrentController.PageCount, 3)
+ #select new Pages; nr of pages =2 (click UP), save; verify pageCount = 3
+ newPages = xDialog.getChild("RB_INSERT_NEW_PAGES")
+ newPages.executeAction("CLICK", tuple())
+ xpageCount = xDialog.getChild("NF_PAGE_COUNT")
+ xpageCount.executeAction("UP", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ self.assertEqual(document.CurrentController.PageCount, 3)
- # check cancel button
- self.ui_test.execute_dialog_through_command(".uno:TitlePageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
- self.assertEqual(document.CurrentController.PageCount, 3)
+ # check cancel button
+ self.ui_test.execute_dialog_through_command(".uno:TitlePageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+ self.assertEqual(document.CurrentController.PageCount, 3)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/xwindow.py b/sw/qa/uitest/writer_tests5/xwindow.py
index 05db1a8f3b4d..cdacffcb70ae 100644
--- a/sw/qa/uitest/writer_tests5/xwindow.py
+++ b/sw/qa/uitest/writer_tests5/xwindow.py
@@ -76,100 +76,101 @@ class XWindow(UITestCase):
def test_listeners(self):
global mouseListenerCount
- with self.ui_test.create_doc_in_start_center("writer"):
- xDoc = self.ui_test.get_component()
-
- # create new mouse listener
- xFrame = xDoc.getCurrentController().getFrame()
- self.assertIsNotNone(xFrame)
- xWindow = xFrame.getContainerWindow()
- self.assertIsNotNone(xWindow)
-
- # add new mouse listener
- xMouseListener = XMouseListenerExtended()
- self.assertIsNotNone(xMouseListener)
- xWindow.addMouseListener(xMouseListener)
- self.assertEqual(1, mouseListenerCount)
-
- # add new key listener
- xKeyListener = XKeyListenerExtended()
- self.assertIsNotNone(xKeyListener)
- xWindow.addKeyListener(xKeyListener)
-
- # create dummy mouse event
- xMouseEvent = MouseEvent()
- xMouseEvent.Modifiers = 0
- xMouseEvent.Buttons = MouseButton.LEFT
- xMouseEvent.X = 10
- xMouseEvent.Y = 10
- xMouseEvent.ClickCount = 1
- xMouseEvent.PopupTrigger = False
- xMouseEvent.Source = xWindow
-
- xMouseEvent2 = MouseEvent()
- xMouseEvent2.Modifiers = 0
- xMouseEvent2.Buttons = MouseButton.LEFT
- xMouseEvent2.X = 300
- xMouseEvent2.Y = 300
- xMouseEvent2.ClickCount = 1
- xMouseEvent2.PopupTrigger = False
- xMouseEvent2.Source = xWindow
-
- # send mouse event
- xToolkitRobot = xWindow.getToolkit()
- self.assertIsNotNone(xToolkitRobot)
-
- # Click in the menubar/toolbar area
- xToolkitRobot.mouseMove(xMouseEvent)
- xToolkitRobot.mousePress(xMouseEvent)
- xToolkitRobot.mouseRelease(xMouseEvent)
-
- # Click into the document content
- xToolkitRobot.mousePress(xMouseEvent2)
- xToolkitRobot.mouseRelease(xMouseEvent2)
-
- # send key press event
- xKeyEvent = KeyEvent()
- xKeyEvent.Modifiers = 0
- xKeyEvent.KeyCode = 70
- xKeyEvent.KeyChar = 70
- xKeyEvent.Source = xWindow
-
- xToolkitRobot.keyPress(xKeyEvent)
- xToolkitRobot.keyRelease(xKeyEvent)
-
- # Wait for async events to be processed
- xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
- xToolkit.processEventsToIdle()
-
- # remove mouse listener
- xWindow.removeMouseListener(xMouseListener)
- self.assertEqual(1, mouseListenerCount)
- del xMouseListener
-
- # remove key listener
- xWindow.removeKeyListener(xKeyListener)
- del xKeyListener
-
- global keymousePressedEventsIntercepted
- # Not expected any interceptions
- self.assertEqual(0, keymousePressedEventsIntercepted)
-
- global keymouseReleasedEventsIntercepted
- # Not expected any interceptions
- self.assertEqual(0, keymouseReleasedEventsIntercepted)
-
- global mousePressedEventsIntercepted
- self.assertEqual(0, mousePressedEventsIntercepted)
-
- global mouseReleasedEventsIntercepted
- self.assertEqual(0, mouseReleasedEventsIntercepted)
-
- global mouseEventsIntercepted
- # Not expected 3 interceptions
- self.assertEqual(0, mouseEventsIntercepted)
-
- # close document
+ self.ui_test.create_doc_in_start_center("writer")
+ xDoc = self.ui_test.get_component()
+
+ # create new mouse listener
+ xFrame = xDoc.getCurrentController().getFrame()
+ self.assertIsNotNone(xFrame)
+ xWindow = xFrame.getContainerWindow()
+ self.assertIsNotNone(xWindow)
+
+ # add new mouse listener
+ xMouseListener = XMouseListenerExtended()
+ self.assertIsNotNone(xMouseListener)
+ xWindow.addMouseListener(xMouseListener)
+ self.assertEqual(1, mouseListenerCount)
+
+ # add new key listener
+ xKeyListener = XKeyListenerExtended()
+ self.assertIsNotNone(xKeyListener)
+ xWindow.addKeyListener(xKeyListener)
+
+ # create dummy mouse event
+ xMouseEvent = MouseEvent()
+ xMouseEvent.Modifiers = 0
+ xMouseEvent.Buttons = MouseButton.LEFT
+ xMouseEvent.X = 10
+ xMouseEvent.Y = 10
+ xMouseEvent.ClickCount = 1
+ xMouseEvent.PopupTrigger = False
+ xMouseEvent.Source = xWindow
+
+ xMouseEvent2 = MouseEvent()
+ xMouseEvent2.Modifiers = 0
+ xMouseEvent2.Buttons = MouseButton.LEFT
+ xMouseEvent2.X = 300
+ xMouseEvent2.Y = 300
+ xMouseEvent2.ClickCount = 1
+ xMouseEvent2.PopupTrigger = False
+ xMouseEvent2.Source = xWindow
+
+ # send mouse event
+ xToolkitRobot = xWindow.getToolkit()
+ self.assertIsNotNone(xToolkitRobot)
+
+ # Click in the menubar/toolbar area
+ xToolkitRobot.mouseMove(xMouseEvent)
+ xToolkitRobot.mousePress(xMouseEvent)
+ xToolkitRobot.mouseRelease(xMouseEvent)
+
+ # Click into the document content
+ xToolkitRobot.mousePress(xMouseEvent2)
+ xToolkitRobot.mouseRelease(xMouseEvent2)
+
+ # send key press event
+ xKeyEvent = KeyEvent()
+ xKeyEvent.Modifiers = 0
+ xKeyEvent.KeyCode = 70
+ xKeyEvent.KeyChar = 70
+ xKeyEvent.Source = xWindow
+
+ xToolkitRobot.keyPress(xKeyEvent)
+ xToolkitRobot.keyRelease(xKeyEvent)
+
+ # Wait for async events to be processed
+ xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+ xToolkit.processEventsToIdle()
+
+ # remove mouse listener
+ xWindow.removeMouseListener(xMouseListener)
+ self.assertEqual(1, mouseListenerCount)
+ del xMouseListener
+
+ # remove key listener
+ xWindow.removeKeyListener(xKeyListener)
+ del xKeyListener
+
+ global keymousePressedEventsIntercepted
+ # Not expected any interceptions
+ self.assertEqual(0, keymousePressedEventsIntercepted)
+
+ global keymouseReleasedEventsIntercepted
+ # Not expected any interceptions
+ self.assertEqual(0, keymouseReleasedEventsIntercepted)
+
+ global mousePressedEventsIntercepted
+ self.assertEqual(0, mousePressedEventsIntercepted)
+
+ global mouseReleasedEventsIntercepted
+ self.assertEqual(0, mouseReleasedEventsIntercepted)
+
+ global mouseEventsIntercepted
+ # Not expected 3 interceptions
+ self.assertEqual(0, mouseEventsIntercepted)
+
+ # close document
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests5/zoom.py b/sw/qa/uitest/writer_tests5/zoom.py
index 405c1b584b10..df92b35e929e 100644
--- a/sw/qa/uitest/writer_tests5/zoom.py
+++ b/sw/qa/uitest/writer_tests5/zoom.py
@@ -11,92 +11,94 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class writerZoom(UITestCase):
def test_zoom_writer(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- #dialog View-Zoom-Zoom
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ #dialog View-Zoom-Zoom
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
- #select Optimal & Automatic - OK - open and verify
- optimal = xDialog.getChild("optimal")
- optimal.executeAction("CLICK", tuple())
- automatic = xDialog.getChild("automatic")
- automatic.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ #select Optimal & Automatic - OK - open and verify
+ optimal = xDialog.getChild("optimal")
+ optimal.executeAction("CLICK", tuple())
+ automatic = xDialog.getChild("automatic")
+ automatic.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
- optimal = xDialog.getChild("optimal")
- automatic = xDialog.getChild("automatic")
- self.assertEqual(get_state_as_dict(optimal)["Checked"], "true")
- self.assertEqual(get_state_as_dict(automatic)["Checked"], "true")
- #select fit weight & Single page - OK - open and verify
- fitwandh = xDialog.getChild("fitwandh")
- singlepage = xDialog.getChild("singlepage")
- fitwandh.executeAction("CLICK", tuple())
- singlepage.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
+ optimal = xDialog.getChild("optimal")
+ automatic = xDialog.getChild("automatic")
+ self.assertEqual(get_state_as_dict(optimal)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(automatic)["Checked"], "true")
+ #select fit weight & Single page - OK - open and verify
+ fitwandh = xDialog.getChild("fitwandh")
+ singlepage = xDialog.getChild("singlepage")
+ fitwandh.executeAction("CLICK", tuple())
+ singlepage.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
- singlepage = xDialog.getChild("singlepage")
- fitwandh = xDialog.getChild("fitwandh")
- self.assertEqual(get_state_as_dict(singlepage)["Checked"], "true")
- self.assertEqual(get_state_as_dict(fitwandh)["Checked"], "true")
- #select fit width & columns - OK - open and verify
- fitw = xDialog.getChild("fitw")
- columnssb = xDialog.getChild("columnssb")
- columns = xDialog.getChild("columns")
- fitw.executeAction("CLICK", tuple())
- columns.executeAction("CLICK", tuple())
- columnssb.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- columnssb.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- columnssb.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
+ singlepage = xDialog.getChild("singlepage")
+ fitwandh = xDialog.getChild("fitwandh")
+ self.assertEqual(get_state_as_dict(singlepage)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(fitwandh)["Checked"], "true")
+ #select fit width & columns - OK - open and verify
+ fitw = xDialog.getChild("fitw")
+ columnssb = xDialog.getChild("columnssb")
+ columns = xDialog.getChild("columns")
+ fitw.executeAction("CLICK", tuple())
+ columns.executeAction("CLICK", tuple())
+ columnssb.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ columnssb.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ columnssb.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
- fitw = xDialog.getChild("fitw")
- columnssb = xDialog.getChild("columnssb")
- columns = xDialog.getChild("columns")
- self.assertEqual(get_state_as_dict(fitw)["Checked"], "true")
- self.assertEqual(get_state_as_dict(columns)["Checked"], "true")
- self.assertEqual(get_state_as_dict(columnssb)["Text"], "3")
- #select 100% & Automatic - OK - open and verify
- automatic = xDialog.getChild("automatic")
- x100pc = xDialog.getChild("100pc")
- x100pc.executeAction("CLICK", tuple())
- automatic.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
+ fitw = xDialog.getChild("fitw")
+ columnssb = xDialog.getChild("columnssb")
+ columns = xDialog.getChild("columns")
+ self.assertEqual(get_state_as_dict(fitw)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(columns)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(columnssb)["Text"], "3")
+ #select 100% & Automatic - OK - open and verify
+ automatic = xDialog.getChild("automatic")
+ x100pc = xDialog.getChild("100pc")
+ x100pc.executeAction("CLICK", tuple())
+ automatic.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
- automatic = xDialog.getChild("automatic")
- x100pc = xDialog.getChild("100pc")
- self.assertEqual(get_state_as_dict(automatic)["Checked"], "true")
- self.assertEqual(get_state_as_dict(x100pc)["Checked"], "true")
- #select variable 103% & Automatic - OK - open and verify
- variable = xDialog.getChild("variable")
- zoomsb = xDialog.getChild("zoomsb")
- variable.executeAction("CLICK", tuple())
- zoomsb.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- zoomsb.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- zoomsb.executeAction("TYPE", mkPropertyValues({"TEXT":"101"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
+ automatic = xDialog.getChild("automatic")
+ x100pc = xDialog.getChild("100pc")
+ self.assertEqual(get_state_as_dict(automatic)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(x100pc)["Checked"], "true")
+ #select variable 103% & Automatic - OK - open and verify
+ variable = xDialog.getChild("variable")
+ zoomsb = xDialog.getChild("zoomsb")
+ variable.executeAction("CLICK", tuple())
+ zoomsb.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ zoomsb.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ zoomsb.executeAction("TYPE", mkPropertyValues({"TEXT":"101"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
- variable = xDialog.getChild("variable")
- zoomsb = xDialog.getChild("zoomsb")
- self.assertEqual(get_state_as_dict(variable)["Checked"], "true")
- self.assertEqual(get_state_as_dict(zoomsb)["Text"], "101%")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
+ variable = xDialog.getChild("variable")
+ zoomsb = xDialog.getChild("zoomsb")
+ self.assertEqual(get_state_as_dict(variable)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(zoomsb)["Text"], "101%")
+ 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/sw/qa/uitest/writer_tests6/infobar.py b/sw/qa/uitest/writer_tests6/infobar.py
index 0f850690e462..84dfdb3ac887 100644
--- a/sw/qa/uitest/writer_tests6/infobar.py
+++ b/sw/qa/uitest/writer_tests6/infobar.py
@@ -16,44 +16,45 @@ from com.sun.star.container import NoSuchElementException
class tdf97926(UITestCase):
def test_infobar_add(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- controller = self.ui_test.get_component().getCurrentController()
- buttons = [StringPair("Close", ".uno:CloseDoc")]
+ self.ui_test.create_doc_in_start_center("writer")
+ controller = self.ui_test.get_component().getCurrentController()
+ buttons = [StringPair("Close", ".uno:CloseDoc")]
+ controller.appendInfobar(
+ "my", "Hello world", "The quick, brown fox jumps over a lazy dog.", InfobarType.INFO, buttons, True)
+
+ # Adding another infobar with the same ID should throw an exception
+ with self.assertRaises(IllegalArgumentException):
controller.appendInfobar(
"my", "Hello world", "The quick, brown fox jumps over a lazy dog.", InfobarType.INFO, buttons, True)
-
- # Adding another infobar with the same ID should throw an exception
- with self.assertRaises(IllegalArgumentException):
- controller.appendInfobar(
- "my", "Hello world", "The quick, brown fox jumps over a lazy dog.", InfobarType.INFO, buttons, True)
+ self.ui_test.close_doc()
def test_infobar_update(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- controller = self.ui_test.get_component().getCurrentController()
- buttons = [StringPair("Close", ".uno:CloseDoc")]
- controller.appendInfobar(
- "my", "Hello world", "The quick, brown fox jumps over a lazy dog.", InfobarType.INFO, buttons, True)
- controller.updateInfobar("my", "Hello universe", "", InfobarType.WARNING)
+ self.ui_test.create_doc_in_start_center("writer")
+ controller = self.ui_test.get_component().getCurrentController()
+ buttons = [StringPair("Close", ".uno:CloseDoc")]
+ controller.appendInfobar(
+ "my", "Hello world", "The quick, brown fox jumps over a lazy dog.", InfobarType.INFO, buttons, True)
+ controller.updateInfobar("my", "Hello universe", "", InfobarType.WARNING)
- # Updating non-existing infobars should throw an exception
- with self.assertRaises(NoSuchElementException):
- controller.updateInfobar("notexisting", "", "", InfobarType.WARNING)
+ # Updating non-existing infobars should throw an exception
+ with self.assertRaises(NoSuchElementException):
+ controller.updateInfobar("notexisting", "", "", InfobarType.WARNING)
- # Passing invalid values for InfobarType should throw an exception
- with self.assertRaises(IllegalArgumentException):
- controller.updateInfobar("my", "", "", 120)
+ # Passing invalid values for InfobarType should throw an exception
+ with self.assertRaises(IllegalArgumentException):
+ controller.updateInfobar("my", "", "", 120)
def test_infobar_remove(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- controller = self.ui_test.get_component().getCurrentController()
- buttons = [StringPair("Close", ".uno:CloseDoc")]
- controller.appendInfobar(
- "my", "Hello world", "The quick, brown fox jumps over a lazy dog.", InfobarType.INFO, buttons, True)
+ self.ui_test.create_doc_in_start_center("writer")
+ controller = self.ui_test.get_component().getCurrentController()
+ buttons = [StringPair("Close", ".uno:CloseDoc")]
+ controller.appendInfobar(
+ "my", "Hello world", "The quick, brown fox jumps over a lazy dog.", InfobarType.INFO, buttons, True)
- controller.removeInfobar("my")
+ controller.removeInfobar("my")
- # Removing an already removed infobar should throw an exception
- with self.assertRaises(NoSuchElementException):
- controller.removeInfobar("my")
+ # Removing an already removed infobar should throw an exception
+ with self.assertRaises(NoSuchElementException):
+ controller.removeInfobar("my")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests6/tdf107847.py b/sw/qa/uitest/writer_tests6/tdf107847.py
index 4fd2aaf1b86a..522fe99beba1 100644
--- a/sw/qa/uitest/writer_tests6/tdf107847.py
+++ b/sw/qa/uitest/writer_tests6/tdf107847.py
@@ -11,25 +11,26 @@ from uitest.uihelper.common import select_pos
class tdf107847(UITestCase):
def test_tdf_107847_macro_tab_crash(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_dialog_through_command(".uno:InsertFrame") # insert frame
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- select_pos(xTabs, "2")
- select_pos(xTabs, "3")
- select_pos(xTabs, "4")
- select_pos(xTabs, "5")
- select_pos(xTabs, "6")
- select_pos(xTabs, "7")
- select_pos(xTabs, "8") #tab Macro
- xokbtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xokbtn)
+ self.ui_test.execute_dialog_through_command(".uno:InsertFrame") # insert frame
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ select_pos(xTabs, "2")
+ select_pos(xTabs, "3")
+ select_pos(xTabs, "4")
+ select_pos(xTabs, "5")
+ select_pos(xTabs, "6")
+ select_pos(xTabs, "7")
+ select_pos(xTabs, "8") #tab Macro
+ xokbtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xokbtn)
- self.assertEqual(document.TextFrames.getCount(), 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.TextFrames.getCount(), 0)
+ self.assertEqual(document.TextFrames.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.TextFrames.getCount(), 0)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests6/tdf118883.py b/sw/qa/uitest/writer_tests6/tdf118883.py
index 1affcec41bd7..9a7397d413b1 100644
--- a/sw/qa/uitest/writer_tests6/tdf118883.py
+++ b/sw/qa/uitest/writer_tests6/tdf118883.py
@@ -10,30 +10,31 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class Tdf118883(UITestCase):
def test_tdf118883(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- # Insert shape with Ctrl key
- xArgs = mkPropertyValues({"KeyModifier": 8192})
- self.xUITest.executeCommandWithParameters(".uno:BasicShapes.rectangle", xArgs)
+ # Insert shape with Ctrl key
+ xArgs = mkPropertyValues({"KeyModifier": 8192})
+ self.xUITest.executeCommandWithParameters(".uno:BasicShapes.rectangle", xArgs)
- writer_document = self.ui_test.get_component()
- self.assertEqual(1, writer_document.DrawPage.getCount())
+ writer_document = self.ui_test.get_component()
+ self.assertEqual(1, writer_document.DrawPage.getCount())
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
- self.ui_test.execute_dialog_through_command(".uno:CloseDoc")
- xDialog = self.xUITest.getTopFocusWindow()
- xDiscardBtn = xDialog.getChild("discard")
- self.ui_test.close_dialog_through_button(xDiscardBtn)
+ self.ui_test.execute_dialog_through_command(".uno:CloseDoc")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xDiscardBtn = xDialog.getChild("discard")
+ self.ui_test.close_dialog_through_button(xDiscardBtn)
- with self.ui_test.create_doc_in_start_center("calc"):
+ calc_doc = self.ui_test.create_doc_in_start_center("calc")
- self.xUITest.executeCommand(".uno:Paste")
+ self.xUITest.executeCommand(".uno:Paste")
- calc_document = self.ui_test.get_component()
+ calc_document = self.ui_test.get_component()
- # Without the fix in place, this test would have failed with
- # AssertionError: 1 != 0
- self.assertEqual(1, calc_document.DrawPages[0].getCount())
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 1 != 0
+ self.assertEqual(1, calc_document.DrawPages[0].getCount())
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests6/tdf125104.py b/sw/qa/uitest/writer_tests6/tdf125104.py
index feda505caed1..0fa36587b20e 100644
--- a/sw/qa/uitest/writer_tests6/tdf125104.py
+++ b/sw/qa/uitest/writer_tests6/tdf125104.py
@@ -25,39 +25,41 @@ class tdf125104(UITestCase):
self.ui_test.close_dialog_through_button(okBtn)
def test_tdf125104_pageFormat_numbering(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
-
- # insert page numbers on multiple pages
- self.xUITest.executeCommand(".uno:InsertPageNumberField")
- self.xUITest.executeCommand(".uno:InsertPagebreak")
- self.xUITest.executeCommand(".uno:InsertPageNumberField")
- text = document.Text.String.replace('\r\n', '\n')
- self.assertEqual(text[0:1], "1")
- self.assertEqual(text[2:3], "2")
-
- # Bug 125104 - Changing page numbering to "1st, 2nd, 3rd,..." causes crashes when trying to change Page settings later
- self.set_combo_layout_format(self.open_page_style_dialog(), "1st, 2nd, 3rd, ...")
- text = document.Text.String.replace('\r\n', '\n')
- self.assertEqual(text[0:3], "1st")
- self.assertEqual(text[4:7], "2nd")
-
- xDialog = self.open_page_style_dialog()
- comboLayoutFormat = xDialog.getChild("comboLayoutFormat")
- self.assertEqual(get_state_as_dict(comboLayoutFormat)["SelectEntryText"], "1st, 2nd, 3rd, ...")
- cancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(cancelBtn)
-
- # change to devanagari alphabet format
- self.set_combo_layout_format(self.open_page_style_dialog(), "क, ख, ग, ...")
- text = document.Text.String.replace('\r\n', '\n')
- self.assertEqual(text[0:1], "क")
- self.assertEqual(text[2:3], "ख")
-
- # change to devanagari number format
- self.set_combo_layout_format(self.open_page_style_dialog(), "१, २, ३, ...")
- text = document.Text.String.replace('\r\n', '\n')
- self.assertEqual(text[0:1], "१")
- self.assertEqual(text[2:3], "२")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+
+ # insert page numbers on multiple pages
+ self.xUITest.executeCommand(".uno:InsertPageNumberField")
+ self.xUITest.executeCommand(".uno:InsertPagebreak")
+ self.xUITest.executeCommand(".uno:InsertPageNumberField")
+ text = document.Text.String.replace('\r\n', '\n')
+ self.assertEqual(text[0:1], "1")
+ self.assertEqual(text[2:3], "2")
+
+ # Bug 125104 - Changing page numbering to "1st, 2nd, 3rd,..." causes crashes when trying to change Page settings later
+ self.set_combo_layout_format(self.open_page_style_dialog(), "1st, 2nd, 3rd, ...")
+ text = document.Text.String.replace('\r\n', '\n')
+ self.assertEqual(text[0:3], "1st")
+ self.assertEqual(text[4:7], "2nd")
+
+ xDialog = self.open_page_style_dialog()
+ comboLayoutFormat = xDialog.getChild("comboLayoutFormat")
+ self.assertEqual(get_state_as_dict(comboLayoutFormat)["SelectEntryText"], "1st, 2nd, 3rd, ...")
+ cancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(cancelBtn)
+
+ # change to devanagari alphabet format
+ self.set_combo_layout_format(self.open_page_style_dialog(), "क, ख, ग, ...")
+ text = document.Text.String.replace('\r\n', '\n')
+ self.assertEqual(text[0:1], "क")
+ self.assertEqual(text[2:3], "ख")
+
+ # change to devanagari number format
+ self.set_combo_layout_format(self.open_page_style_dialog(), "१, २, ३, ...")
+ text = document.Text.String.replace('\r\n', '\n')
+ self.assertEqual(text[0:1], "१")
+ self.assertEqual(text[2:3], "२")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests6/tdf126168.py b/sw/qa/uitest/writer_tests6/tdf126168.py
index f3af18638b37..db60e9edbea0 100644
--- a/sw/qa/uitest/writer_tests6/tdf126168.py
+++ b/sw/qa/uitest/writer_tests6/tdf126168.py
@@ -11,37 +11,38 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf126168(UITestCase):
def test_tdf126168_frame_undo_redo_crash(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- #2) Menu > Insert > Frame > Frame
- #3) Press OK in Frame dialog
- self.ui_test.execute_dialog_through_command(".uno:InsertFrame") # insert frame
- xDialog = self.xUITest.getTopFocusWindow()
- xokbtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xokbtn)
- self.assertEqual(document.TextFrames.getCount(), 1)
- #New Style from Selection [uno:StyleNewByExample]
- self.ui_test.execute_dialog_through_command(".uno:StyleNewByExample")
- #5) Enter a name in the Create Style dialog and press OK
- xDialog = self.xUITest.getTopFocusWindow()
- stylename = xDialog.getChild("stylename")
- stylename.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
- xokbtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xokbtn)
- #6) ctrl+z 3 times
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.TextFrames.getCount(), 0)
- #7) shift+ctrl+z 3 times
- self.xUITest.executeCommand(".uno:Redo")
- self.xUITest.executeCommand(".uno:Redo")
- self.xUITest.executeCommand(".uno:Redo")
+ #2) Menu > Insert > Frame > Frame
+ #3) Press OK in Frame dialog
+ self.ui_test.execute_dialog_through_command(".uno:InsertFrame") # insert frame
+ xDialog = self.xUITest.getTopFocusWindow()
+ xokbtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xokbtn)
+ self.assertEqual(document.TextFrames.getCount(), 1)
+ #New Style from Selection [uno:StyleNewByExample]
+ self.ui_test.execute_dialog_through_command(".uno:StyleNewByExample")
+ #5) Enter a name in the Create Style dialog and press OK
+ xDialog = self.xUITest.getTopFocusWindow()
+ stylename = xDialog.getChild("stylename")
+ stylename.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ xokbtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xokbtn)
+ #6) ctrl+z 3 times
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.TextFrames.getCount(), 0)
+ #7) shift+ctrl+z 3 times
+ self.xUITest.executeCommand(".uno:Redo")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.xUITest.executeCommand(".uno:Redo")
- #Results: crash
- self.assertEqual(document.CurrentController.PageCount, 1)
+ #Results: crash
+ self.assertEqual(document.CurrentController.PageCount, 1)
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests6/tdf128431.py b/sw/qa/uitest/writer_tests6/tdf128431.py
index 498a44300e24..17d876bb9a4c 100644
--- a/sw/qa/uitest/writer_tests6/tdf128431.py
+++ b/sw/qa/uitest/writer_tests6/tdf128431.py
@@ -12,30 +12,32 @@ from uitest.uihelper.common import change_measurement_unit
class tdf128431(UITestCase):
def test_tdf128431_pageFormat_sync_padding(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
-
- self.ui_test.execute_dialog_through_command(".uno:PageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, 6) #borders
-
- sync = xDialog.getChild("sync")
- bottomft = xDialog.getChild("bottommf")
- topft = xDialog.getChild("topmf")
- rightft = xDialog.getChild("rightmf")
- leftft = xDialog.getChild("leftmf")
-
- self.assertEqual(get_state_as_dict(sync)["Selected"], "true")
- bottomft.executeAction("UP", tuple())
- self.assertEqual(get_state_as_dict(bottomft)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(topft)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(rightft)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(leftft)["Text"], "0.10 cm")
-
- okBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(okBtn)
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, 6) #borders
+
+ sync = xDialog.getChild("sync")
+ bottomft = xDialog.getChild("bottommf")
+ topft = xDialog.getChild("topmf")
+ rightft = xDialog.getChild("rightmf")
+ leftft = xDialog.getChild("leftmf")
+
+ self.assertEqual(get_state_as_dict(sync)["Selected"], "true")
+ bottomft.executeAction("UP", tuple())
+ self.assertEqual(get_state_as_dict(bottomft)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(topft)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(rightft)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(leftft)["Text"], "0.10 cm")
+
+ okBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(okBtn)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests6/tdf131041.py b/sw/qa/uitest/writer_tests6/tdf131041.py
index 237112c7195a..94a6f2b750e7 100644
--- a/sw/qa/uitest/writer_tests6/tdf131041.py
+++ b/sw/qa/uitest/writer_tests6/tdf131041.py
@@ -10,39 +10,41 @@ from uitest.uihelper.common import select_pos, get_state_as_dict
class tdf131041(UITestCase):
def test_run(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
+ self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:PageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, 4) #header
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, 4) #header
- xHeaderOn = xDialog.getChild("checkHeaderOn")
- xMoreBtn = xDialog.getChild("buttonMore")
+ xHeaderOn = xDialog.getChild("checkHeaderOn")
+ xMoreBtn = xDialog.getChild("buttonMore")
- self.assertEqual(get_state_as_dict(xHeaderOn)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xMoreBtn)["Enabled"], "false")
+ self.assertEqual(get_state_as_dict(xHeaderOn)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xMoreBtn)["Enabled"], "false")
- xHeaderOn.executeAction("CLICK", tuple())
+ xHeaderOn.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(xHeaderOn)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xMoreBtn)["Enabled"], "true")
+ self.assertEqual(get_state_as_dict(xHeaderOn)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xMoreBtn)["Enabled"], "true")
- self.ui_test.execute_dialog_through_action(xMoreBtn, "CLICK")
+ self.ui_test.execute_dialog_through_action(xMoreBtn, "CLICK")
- xBorderDlg = self.xUITest.getTopFocusWindow()
+ xBorderDlg = self.xUITest.getTopFocusWindow()
- #modify any property
- bottomft = xBorderDlg.getChild("bottommf")
- bottomft.executeAction("UP", tuple())
+ #modify any property
+ bottomft = xBorderDlg.getChild("bottommf")
+ bottomft.executeAction("UP", tuple())
- #it would crash here
- okBtn = xBorderDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(okBtn)
+ #it would crash here
+ okBtn = xBorderDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(okBtn)
- xDialog = self.xUITest.getTopFocusWindow()
- okBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(okBtn)
+ xDialog = self.xUITest.getTopFocusWindow()
+ okBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(okBtn)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests6/tdf44837.py b/sw/qa/uitest/writer_tests6/tdf44837.py
index 0245939b1938..9373d6c89901 100644
--- a/sw/qa/uitest/writer_tests6/tdf44837.py
+++ b/sw/qa/uitest/writer_tests6/tdf44837.py
@@ -12,32 +12,33 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf44837(UITestCase):
def test_tdf448373_Replace_All_clears_current_selection(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- document = self.ui_test.get_component()
-
- type_text(xWriterEdit, "asd asd")
- self.xUITest.executeCommand(".uno:SelectAll")
-
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"b"})) #replace textbox
-
- selectionOnly = xDialog.getChild("selection")
- selectionOnly.executeAction("CLICK", tuple())
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
-
- self.assertEqual(document.Text.String[0:8], "bsd bsd")
- self.assertEqual(len(document.CurrentSelection[0].String) > 1, True)
- #follow-up bug 125663
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ document = self.ui_test.get_component()
+
+ type_text(xWriterEdit, "asd asd")
+ self.xUITest.executeCommand(".uno:SelectAll")
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"b"})) #replace textbox
+
+ selectionOnly = xDialog.getChild("selection")
+ selectionOnly.executeAction("CLICK", tuple())
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
+
+ self.assertEqual(document.Text.String[0:8], "bsd bsd")
+ self.assertEqual(len(document.CurrentSelection[0].String) > 1, True)
+ #follow-up bug 125663
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests7/tdf109083.py b/sw/qa/uitest/writer_tests7/tdf109083.py
index cfc3b5660888..bf61a0e4ee3f 100644
--- a/sw/qa/uitest/writer_tests7/tdf109083.py
+++ b/sw/qa/uitest/writer_tests7/tdf109083.py
@@ -12,55 +12,56 @@ from uitest.uihelper.common import select_pos
#Bug 109083 - Updating table style: changes didn't propagate to other tables when selection was over two columns at the moment of updating
class tdf109083(UITestCase):
def test_tdf109083(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- #generate two 2x2 tables with the same autoformat table style (Default Table Style)
- #Note that this style is different than applying nothing!
- for i in range(0, 2):
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
- formatlbinstable = xDialog.getChild("formatlbinstable")
- entry = formatlbinstable.getChild("1")
- entry.executeAction("SELECT", tuple())
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ #generate two 2x2 tables with the same autoformat table style (Default Table Style)
+ #Note that this style is different than applying nothing!
+ for i in range(0, 2):
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ formatlbinstable = xDialog.getChild("formatlbinstable")
+ entry = formatlbinstable.getChild("1")
+ entry.executeAction("SELECT", tuple())
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
- #select the last row of the first table
- for i in range (0,2):
- self.xUITest.executeCommand(".uno:GoDown")
- for i in range (0,2):
- self.xUITest.executeCommand(".uno:CharRightSel")
- #set a specific color on the selected cells (last row)
- self.xUITest.executeCommandWithParameters(".uno:TableCellBackgroundColor", mkPropertyValues({"TableCellBackgroundColor" : 16776960 }))
+ #select the last row of the first table
+ for i in range (0,2):
+ self.xUITest.executeCommand(".uno:GoDown")
+ for i in range (0,2):
+ self.xUITest.executeCommand(".uno:CharRightSel")
+ #set a specific color on the selected cells (last row)
+ self.xUITest.executeCommandWithParameters(".uno:TableCellBackgroundColor", mkPropertyValues({"TableCellBackgroundColor" : 16776960 }))
- #Sidebar -> Table Styles -> Style Actions -> "Update Selected Style" (note: the row is still selected)
- self.xUITest.executeCommand(".uno:Sidebar")
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "StyleListPanel"}))
- xLeft = xWriterEdit.getChild('left')
- xLeft.executeAction("CLICK", mkPropertyValues({"POS": "5"}))
- xRight = xWriterEdit.getChild('right')
- xRight.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
- #select the second table
- for i in range (0,2):
- self.xUITest.executeCommand(".uno:GoDown")
+ #Sidebar -> Table Styles -> Style Actions -> "Update Selected Style" (note: the row is still selected)
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "StyleListPanel"}))
+ xLeft = xWriterEdit.getChild('left')
+ xLeft.executeAction("CLICK", mkPropertyValues({"POS": "5"}))
+ xRight = xWriterEdit.getChild('right')
+ xRight.executeAction("CLICK", mkPropertyValues({"POS": "3"}))
+ #select the second table
+ for i in range (0,2):
+ self.xUITest.executeCommand(".uno:GoDown")
- #first row's cells must be yellow, second/last row's cells must be updated to yellow by now
- for i in range (0,4):
- self.ui_test.execute_dialog_through_command(".uno:TableDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4") #tab Background
- btncolor = xDialog.getChild("btncolor")
- btncolor.executeAction("CLICK", tuple())
- hex_custom = xDialog.getChild("hex_custom")
- if i >= 2:
- self.assertEqual(get_state_as_dict(hex_custom)["Text"], "ffff00")
- else:
- self.assertEqual(get_state_as_dict(hex_custom)["Text"], "ffffff")
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
- self.xUITest.executeCommand(".uno:GoRight")
+ #first row's cells must be yellow, second/last row's cells must be updated to yellow by now
+ for i in range (0,4):
+ self.ui_test.execute_dialog_through_command(".uno:TableDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4") #tab Background
+ btncolor = xDialog.getChild("btncolor")
+ btncolor.executeAction("CLICK", tuple())
+ hex_custom = xDialog.getChild("hex_custom")
+ if i >= 2:
+ self.assertEqual(get_state_as_dict(hex_custom)["Text"], "ffff00")
+ else:
+ self.assertEqual(get_state_as_dict(hex_custom)["Text"], "ffffff")
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+ self.xUITest.executeCommand(".uno:GoRight")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests7/tdf115853.py b/sw/qa/uitest/writer_tests7/tdf115853.py
index c9a5a2d53c8a..42cddb2b388b 100644
--- a/sw/qa/uitest/writer_tests7/tdf115853.py
+++ b/sw/qa/uitest/writer_tests7/tdf115853.py
@@ -15,28 +15,30 @@ from uitest.uihelper.common import select_pos
class tdf115853(UITestCase):
def test_tdf115853(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.create_doc_in_start_center("writer")
+ self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties")
+ xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
+ xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
+ select_pos(xTabs, "2")
- xAddBtn = xDialog.getChild("add")
- xAddBtn.executeAction("CLICK", tuple())
+ xAddBtn = xDialog.getChild("add")
+ xAddBtn.executeAction("CLICK", tuple())
- xNameBox1 = xDialog.getChild("namebox1")
- xNameBox1.executeAction("TYPE", mkPropertyValues({"TEXT":"Text"}))
+ xNameBox1 = xDialog.getChild("namebox1")
+ xNameBox1.executeAction("TYPE", mkPropertyValues({"TEXT":"Text"}))
- xAddBtn = xDialog.getChild("add")
- xAddBtn.executeAction("CLICK", tuple())
+ xAddBtn = xDialog.getChild("add")
+ xAddBtn.executeAction("CLICK", tuple())
- # Without the fix in place, this test would have failed with
- # AssertionError: 'Text' != ''
- self.assertEqual("Text", get_state_as_dict(xNameBox1)['Text'])
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'Text' != ''
+ self.assertEqual("Text", get_state_as_dict(xNameBox1)['Text'])
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests7/tdf119661.py b/sw/qa/uitest/writer_tests7/tdf119661.py
index f0b1049e7825..9ad178f8a722 100644
--- a/sw/qa/uitest/writer_tests7/tdf119661.py
+++ b/sw/qa/uitest/writer_tests7/tdf119661.py
@@ -15,78 +15,78 @@ class tdf119661(UITestCase):
def test_tdf119661(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- self.ui_test.execute_dialog_through_command(".uno:InsertGraphic")
+ self.ui_test.execute_dialog_through_command(".uno:InsertGraphic")
- xOpenDialog = self.xUITest.getTopFocusWindow()
+ xOpenDialog = self.xUITest.getTopFocusWindow()
- xFileName = xOpenDialog.getChild("file_name")
- xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": get_url_for_data_file("LibreOffice.jpg")}))
+ xFileName = xOpenDialog.getChild("file_name")
+ xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": get_url_for_data_file("LibreOffice.jpg")}))
- xLink = xOpenDialog.getChild("link")
- self.assertEqual("false", get_state_as_dict(xLink)['Selected'])
+ xLink = xOpenDialog.getChild("link")
+ self.assertEqual("false", get_state_as_dict(xLink)['Selected'])
- xLink.executeAction("CLICK", tuple())
+ xLink.executeAction("CLICK", tuple())
- xOpenBtn = xOpenDialog.getChild("open")
- xOpenBtn.executeAction("CLICK", tuple())
+ xOpenBtn = xOpenDialog.getChild("open")
+ xOpenBtn.executeAction("CLICK", tuple())
- #Confirmation dialog is displayed
- xWarnDialog = self.xUITest.getTopFocusWindow()
- xOK = xWarnDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ #Confirmation dialog is displayed
+ xWarnDialog = self.xUITest.getTopFocusWindow()
+ xOK = xWarnDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- self.ui_test.execute_dialog_through_command(".uno:LinkDialog")
+ self.ui_test.execute_dialog_through_command(".uno:LinkDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- sLinks = "TB_LINKS"
- xLinks = xDialog.getChild(sLinks)
- self.assertEqual(1, len(xLinks.getChildren()))
+ sLinks = "TB_LINKS"
+ xLinks = xDialog.getChild(sLinks)
+ self.assertEqual(1, len(xLinks.getChildren()))
- sFileName = "FULL_FILE_NAME"
- xFileName = xDialog.getChild(sFileName)
- self.assertTrue(get_state_as_dict(xFileName)["Text"].endswith("/LibreOffice.jpg"))
+ sFileName = "FULL_FILE_NAME"
+ xFileName = xDialog.getChild(sFileName)
+ self.assertTrue(get_state_as_dict(xFileName)["Text"].endswith("/LibreOffice.jpg"))
- sBreakLink = "BREAK_LINK"
- xBreakLink = xDialog.getChild(sBreakLink)
+ sBreakLink = "BREAK_LINK"
+ xBreakLink = xDialog.getChild(sBreakLink)
- with self.ui_test.execute_blocking_action(xBreakLink.executeAction,
- args=("CLICK", tuple()), close_button="yes"):
- pass
+ with self.ui_test.execute_blocking_action(xBreakLink.executeAction,
+ args=("CLICK", tuple()), close_button="yes"):
+ pass
- xClose = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xClose)
+ xClose = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xClose)
- with TemporaryDirectory() as tempdir:
- xFilePath = os.path.join(tempdir, "tdf119661-tmp.odt")
+ with TemporaryDirectory() as tempdir:
+ xFilePath = os.path.join(tempdir, "tdf119661-tmp.odt")
- # Save Copy as
- self.ui_test.execute_dialog_through_command(".uno:SaveAs")
- xDialog = self.xUITest.getTopFocusWindow()
+ # Save Copy as
+ self.ui_test.execute_dialog_through_command(".uno:SaveAs")
+ xDialog = self.xUITest.getTopFocusWindow()
- xFileName = xDialog.getChild("file_name")
- xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": xFilePath}))
+ xFileName = xDialog.getChild("file_name")
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": xFilePath}))
- xOpenBtn = xDialog.getChild("open")
- self.ui_test.close_dialog_through_button(xOpenBtn)
+ xOpenBtn = xDialog.getChild("open")
+ self.ui_test.close_dialog_through_button(xOpenBtn)
- # Close the Writer document
- self.ui_test.close_doc()
+ # Close the Writer document
+ self.ui_test.close_doc()
- with self.ui_test.load_file(systemPathToFileUrl(xFilePath)):
+ with self.ui_test.load_file(systemPathToFileUrl(xFilePath)):
- self.xUITest.executeCommand(".uno:LinkDialog")
+ self.xUITest.executeCommand(".uno:LinkDialog")
- # Since the image is no longer linked, the link dialog is not open.
- # Without the fix in place, this dialog would have been opened
- xMainWin = self.xUITest.getTopFocusWindow()
- self.assertTrue(sLinks not in xMainWin.getChildren())
- self.assertTrue(sFileName not in xMainWin.getChildren())
- self.assertTrue(sBreakLink not in xMainWin.getChildren())
- self.assertTrue("writer_edit" in xMainWin.getChildren())
+ # Since the image is no longer linked, the link dialog is not open.
+ # Without the fix in place, this dialog would have been opened
+ xMainWin = self.xUITest.getTopFocusWindow()
+ self.assertTrue(sLinks not in xMainWin.getChildren())
+ self.assertTrue(sFileName not in xMainWin.getChildren())
+ self.assertTrue(sBreakLink not in xMainWin.getChildren())
+ self.assertTrue("writer_edit" in xMainWin.getChildren())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests7/tdf133348.py b/sw/qa/uitest/writer_tests7/tdf133348.py
index a05541f8f96b..e9f91d8f17b6 100644
--- a/sw/qa/uitest/writer_tests7/tdf133348.py
+++ b/sw/qa/uitest/writer_tests7/tdf133348.py
@@ -10,52 +10,54 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf133348(UITestCase):
def test_tdf133348(self):
- with self.ui_test.create_doc_in_start_center("writer"):
-
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
-
- document = self.ui_test.get_component()
-
- selection = self.xUITest.executeCommand(".uno:SelectAll")
- xArgs = mkPropertyValues({"Text": "C1"})
- self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
-
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
- xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xEntry = xPages.getChild('0')
- xEntry.executeAction("EXPAND", tuple())
- xGeneralEntry = xEntry.getChild('0')
- xGeneralEntry.executeAction("SELECT", tuple())
- xFirstName = xDialogOpt.getChild("firstname")
- props = {"TEXT": "Known Author"}
- actionProps = mkPropertyValues(props)
- xFirstName.executeAction("TYPE", actionProps)
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xArgs = mkPropertyValues({"Text": "C2"})
- self.xUITest.executeCommandWithParameters(".uno:ReplyComment", xArgs)
-
- # Wait for async events to be processed
- xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
- xToolkit.processEventsToIdle()
-
- xEnum = document.TextFields.createEnumeration()
- self.assertEqual(xEnum.nextElement().Author.strip(), 'Unknown Author')
- self.assertEqual(xEnum.nextElement().Author.strip(), 'Known Author')
-
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Undo")
-
- # Without the fix in place, it would have crashed here
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Undo")
-
- # all comments have been deleted
- self.assertFalse(document.TextFields.createEnumeration().hasMoreElements())
+ self.ui_test.create_doc_in_start_center("writer")
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ document = self.ui_test.get_component()
+
+ selection = self.xUITest.executeCommand(".uno:SelectAll")
+ xArgs = mkPropertyValues({"Text": "C1"})
+ self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
+
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+ xPages = xDialogOpt.getChild("pages")
+ xEntry = xPages.getChild('0')
+ xEntry.executeAction("EXPAND", tuple())
+ xGeneralEntry = xEntry.getChild('0')
+ xGeneralEntry.executeAction("SELECT", tuple())
+ xFirstName = xDialogOpt.getChild("firstname")
+ props = {"TEXT": "Known Author"}
+ actionProps = mkPropertyValues(props)
+ xFirstName.executeAction("TYPE", actionProps)
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xArgs = mkPropertyValues({"Text": "C2"})
+ self.xUITest.executeCommandWithParameters(".uno:ReplyComment", xArgs)
+
+ # Wait for async events to be processed
+ xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+ xToolkit.processEventsToIdle()
+
+ xEnum = document.TextFields.createEnumeration()
+ self.assertEqual(xEnum.nextElement().Author.strip(), 'Unknown Author')
+ self.assertEqual(xEnum.nextElement().Author.strip(), 'Known Author')
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
+
+ # Without the fix in place, it would have crashed here
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
+
+ # all comments have been deleted
+ self.assertFalse(document.TextFields.createEnumeration().hasMoreElements())
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests7/tdf140731.py b/sw/qa/uitest/writer_tests7/tdf140731.py
index 2b6864459c10..79972c8ad7f8 100644
--- a/sw/qa/uitest/writer_tests7/tdf140731.py
+++ b/sw/qa/uitest/writer_tests7/tdf140731.py
@@ -11,46 +11,47 @@ from uitest.uihelper.common import type_text
class tdf140731(UITestCase):
def test_tdf140731(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- type_text(xWriterEdit, 'Lorem')
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F3"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- #generating a big text with ~60k words and several paragraphs
- for i in range(0,8):
- self.xUITest.executeCommand(".uno:SelectAll")
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+c"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+v"}))
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+v"}))
- xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "1"}))
-
- #Format->Text operations on small selections (which would generate <~500 redlines), changetracking still working
- self.xUITest.executeCommand(".uno:TrackChanges")
- xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "1", "END_POS": "1000"}))
- self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
- document = self.ui_test.get_component()
- self.assertTrue(document.Redlines.createEnumeration().hasMoreElements())
-
- #Removing all the redlines.
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
- xAccBtn = xTrackDlg.getChild("rejectall")
- xAccBtn.executeAction("CLICK", tuple())
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
-
- #Without the fix in place, on big selections writer would freeze. Now it ignores change tracking.
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ type_text(xWriterEdit, 'Lorem')
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F3"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ #generating a big text with ~60k words and several paragraphs
+ for i in range(0,8):
self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
- self.assertFalse(document.Redlines.createEnumeration().hasMoreElements())
-
- #The patch has no effects on the Format->Text operations
- self.assertEqual(document.Text.String[0:26], "Lorem Ipsum Dolor Sit Amet")
- self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:ChangeCaseToUpper")
- self.assertEqual(document.Text.String[0:26], "LOREM IPSUM DOLOR SIT AMET")
-
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+c"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+v"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+v"}))
+ xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "1"}))
+
+ #Format->Text operations on small selections (which would generate <~500 redlines), changetracking still working
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "1", "END_POS": "1000"}))
+ self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
+ document = self.ui_test.get_component()
+ self.assertTrue(document.Redlines.createEnumeration().hasMoreElements())
+
+ #Removing all the redlines.
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
+ xAccBtn = xTrackDlg.getChild("rejectall")
+ xAccBtn.executeAction("CLICK", tuple())
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
+
+ #Without the fix in place, on big selections writer would freeze. Now it ignores change tracking.
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
+ self.assertFalse(document.Redlines.createEnumeration().hasMoreElements())
+
+ #The patch has no effects on the Format->Text operations
+ self.assertEqual(document.Text.String[0:26], "Lorem Ipsum Dolor Sit Amet")
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:ChangeCaseToUpper")
+ self.assertEqual(document.Text.String[0:26], "LOREM IPSUM DOLOR SIT AMET")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests7/tdf140863.py b/sw/qa/uitest/writer_tests7/tdf140863.py
index b78fc15f61a7..f0355e4684ed 100644
--- a/sw/qa/uitest/writer_tests7/tdf140863.py
+++ b/sw/qa/uitest/writer_tests7/tdf140863.py
@@ -12,62 +12,64 @@ class tdf140863(UITestCase):
def test_tdf140863(self):
- with self.ui_test.create_doc_in_start_center("writer"):
+ self.ui_test.create_doc_in_start_center("writer")
- # Insert one section
- self.ui_test.execute_dialog_through_command(".uno:InsertSection")
+ # Insert one section
+ self.ui_test.execute_dialog_through_command(".uno:InsertSection")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- # Insert a page break in the section
- xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.xUITest.executeCommand(".uno:InsertPagebreak")
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+ # Insert a page break in the section
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.xUITest.executeCommand(".uno:InsertPagebreak")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
- document = self.ui_test.get_component()
- self.assertEqual(1, len(document.TextSections))
- self.assertTrue(document.TextSections.Section1.IsVisible)
+ document = self.ui_test.get_component()
+ self.assertEqual(1, len(document.TextSections))
+ self.assertTrue(document.TextSections.Section1.IsVisible)
- self.ui_test.execute_dialog_through_command(".uno:EditRegion")
+ self.ui_test.execute_dialog_through_command(".uno:EditRegion")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- xHide = xDialog.getChild('hide')
- self.assertEqual('false', get_state_as_dict(xHide)['Selected'])
+ xHide = xDialog.getChild('hide')
+ self.assertEqual('false', get_state_as_dict(xHide)['Selected'])
- xHide.executeAction('CLICK', tuple())
+ xHide.executeAction('CLICK', tuple())
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.assertEqual(1, len(document.TextSections))
- self.assertFalse(document.TextSections.Section1.IsVisible)
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "1")
+ self.assertEqual(1, len(document.TextSections))
+ self.assertFalse(document.TextSections.Section1.IsVisible)
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "1")
- self.ui_test.execute_dialog_through_command(".uno:EditRegion")
+ self.ui_test.execute_dialog_through_command(".uno:EditRegion")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- xHide = xDialog.getChild('hide')
- self.assertEqual('true', get_state_as_dict(xHide)['Selected'])
+ xHide = xDialog.getChild('hide')
+ self.assertEqual('true', get_state_as_dict(xHide)['Selected'])
- xHide.executeAction('CLICK', tuple())
+ xHide.executeAction('CLICK', tuple())
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.assertEqual(1, len(document.TextSections))
- self.assertTrue(document.TextSections.Section1.IsVisible)
+ self.assertEqual(1, len(document.TextSections))
+ self.assertTrue(document.TextSections.Section1.IsVisible)
- # Without the fix in place, this test would have failed with
- # AssertionError: '1' != '2'
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '1' != '2'
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests7/tdf90401.py b/sw/qa/uitest/writer_tests7/tdf90401.py
index 32c523c85a61..cb70c401b142 100644
--- a/sw/qa/uitest/writer_tests7/tdf90401.py
+++ b/sw/qa/uitest/writer_tests7/tdf90401.py
@@ -98,4 +98,6 @@ class tdf90401(UITestCase):
# This was 'NL\t11/03/2020 19:19:05\t', containing personal info
self.assertEqual(state['SelectEntryText'], 'Author1\t01/01/1970 00:00:00\t')
+ self.ui_test.close_doc()
+
# vim: set shiftwidth=4 softtabstop=4 expandtab: