summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-02-01 11:16:42 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2023-02-01 11:10:11 +0000
commitb2f3072bdf419492ad20cbfb1da14e2d53acf83b (patch)
tree1ae194405992f5464a9bd9a70fcfc9185f2c9c2c /sw
parentb052ec2f2fbe0f3044ba824c064a280a5ee9cd7f (diff)
tdf#107427: sw: move UItest to CppUnittest
Change-Id: I13b8757c384c3ecd23c0b06b93e2db03ce0b364e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146431 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter8.cxx33
-rw-r--r--sw/qa/uitest/writer_tests4/insertPageHeader.py18
2 files changed, 33 insertions, 18 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 2bd6b415f11e..18d390ef64ce 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -842,6 +842,39 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf146248)
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPageStyle, "HeaderIsOn"));
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf107427)
+{
+ createSwDoc();
+
+ dispatchCommand(mxComponent,
+ ".uno:InsertPageHeader?PageStyle:string=Default%20Page%20Style&On:bool=true",
+ {});
+ uno::Sequence<beans::PropertyValue> aArgs(comphelper::InitPropertySequence(
+ { { "Rows", uno::Any(sal_Int32(2)) }, { "Columns", uno::Any(sal_Int32(2)) } }));
+
+ dispatchCommand(mxComponent, ".uno:InsertTable", aArgs);
+ Scheduler::ProcessEventsToIdle();
+
+ xmlDocUniquePtr pLayout = parseLayoutDump();
+ assertXPath(pLayout, "/root/page[1]/header/tab/row", 2);
+
+ SwDoc* pDoc = getSwDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ // Delete the header
+ pWrtShell->ChangeHeaderOrFooter(u"Default Page Style", true, false, false);
+
+ discardDumpedLayout();
+ pLayout = parseLayoutDump();
+ assertXPath(pLayout, "/root/page[1]/header", 0);
+
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ Scheduler::ProcessEventsToIdle();
+
+ discardDumpedLayout();
+ pLayout = parseLayoutDump();
+ assertXPath(pLayout, "/root/page[1]/header/tab/row", 2);
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf141613)
{
createSwDoc();
diff --git a/sw/qa/uitest/writer_tests4/insertPageHeader.py b/sw/qa/uitest/writer_tests4/insertPageHeader.py
index e71749b82931..7f965cc9040d 100644
--- a/sw/qa/uitest/writer_tests4/insertPageHeader.py
+++ b/sw/qa/uitest/writer_tests4/insertPageHeader.py
@@ -44,22 +44,4 @@ class WriterInsertPageHeader(UITestCase):
self.delete_header()
-
- def test_tdf107427(self):
- with self.ui_test.create_doc_in_start_center("writer") as document:
-
- self.insert_header()
-
- with self.ui_test.execute_dialog_through_command(".uno:InsertTable"):
- pass
-
-
- tables = document.getTextTables()
- self.assertEqual(len(tables[0].getRows()), 2)
- self.assertEqual(len(tables[0].getColumns()), 2)
-
- self.xUITest.executeCommand(".uno:SelectAll")
-
- self.delete_header()
-
# vim: set shiftwidth=4 softtabstop=4 expandtab: