diff options
Diffstat (limited to 'sw/qa/uitest/writer_tests')
49 files changed, 1058 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests/compareDocuments.py b/sw/qa/uitest/writer_tests/compareDocuments.py new file mode 100644 index 000000000..310d9cd73 --- /dev/null +++ b/sw/qa/uitest/writer_tests/compareDocuments.py @@ -0,0 +1,57 @@ +#! /usr/bin/env python +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.path import get_srcdir_url +from uitest.uihelper.common import get_state_as_dict +from libreoffice.uno.propertyvalue import mkPropertyValues +import datetime + +def get_url_for_data_file(file_name): + return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + + +class compareDocuments(UITestCase): + + def test_tdf130960(self): + + writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf130960.odt")) + + document = self.ui_test.get_component() + xWriterDoc = self.xUITest.getTopFocusWindow() + + self.ui_test.execute_dialog_through_command(".uno:CompareDocuments") + + xOpenDialog = self.xUITest.getTopFocusWindow() + xFileName = xOpenDialog.getChild("file_name") + xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": get_url_for_data_file("tdf130960_2.odt")})) + + xOpenBtn = xOpenDialog.getChild("open") + xOpenBtn.executeAction("CLICK", tuple()) + + # Close the dialog and open it again so the list of changes is updated + xTrackDlg = self.xUITest.getTopFocusWindow() + xcloseBtn = xTrackDlg.getChild("close") + xcloseBtn.executeAction("CLICK", tuple()) + + self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges") + xTrackDlg = self.xUITest.getTopFocusWindow() + changesList = xTrackDlg.getChild("writerchanges") + + text = "Unknown Author\t" + datetime.datetime.now().strftime("%m/%d/%Y") + self.assertEqual(2, len(changesList.getChildren())) + self.assertTrue(get_state_as_dict(changesList.getChild('0'))["Text"].startswith(text)) + self.assertTrue(get_state_as_dict(changesList.getChild('1'))["Text"].startswith(text)) + + xcloseBtn = xTrackDlg.getChild("close") + xcloseBtn.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests/data/LibreOffice.jpg b/sw/qa/uitest/writer_tests/data/LibreOffice.jpg Binary files differnew file mode 100644 index 000000000..23812dcfd --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/LibreOffice.jpg diff --git a/sw/qa/uitest/writer_tests/data/LibreOffice_external_logo_100px.png b/sw/qa/uitest/writer_tests/data/LibreOffice_external_logo_100px.png Binary files differnew file mode 100644 index 000000000..d55048283 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/LibreOffice_external_logo_100px.png diff --git a/sw/qa/uitest/writer_tests/data/date_form_field.odt b/sw/qa/uitest/writer_tests/data/date_form_field.odt Binary files differnew file mode 100644 index 000000000..8335a1cc1 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/date_form_field.odt diff --git a/sw/qa/uitest/writer_tests/data/date_form_field_custom_format.odt b/sw/qa/uitest/writer_tests/data/date_form_field_custom_format.odt Binary files differnew file mode 100644 index 000000000..fadd890ed --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/date_form_field_custom_format.odt diff --git a/sw/qa/uitest/writer_tests/data/date_form_field_with_placeholder.odt b/sw/qa/uitest/writer_tests/data/date_form_field_with_placeholder.odt Binary files differnew file mode 100644 index 000000000..6f8a63784 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/date_form_field_with_placeholder.odt diff --git a/sw/qa/uitest/writer_tests/data/date_form_field_without_current_date.odt b/sw/qa/uitest/writer_tests/data/date_form_field_without_current_date.odt Binary files differnew file mode 100644 index 000000000..802dff32d --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/date_form_field_without_current_date.odt diff --git a/sw/qa/uitest/writer_tests/data/drop_down_form_field.doc b/sw/qa/uitest/writer_tests/data/drop_down_form_field.doc Binary files differnew file mode 100644 index 000000000..cf94a1fda --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/drop_down_form_field.doc diff --git a/sw/qa/uitest/writer_tests/data/drop_down_form_field.docx b/sw/qa/uitest/writer_tests/data/drop_down_form_field.docx Binary files differnew file mode 100644 index 000000000..d039cd2b6 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/drop_down_form_field.docx diff --git a/sw/qa/uitest/writer_tests/data/drop_down_form_field.odt b/sw/qa/uitest/writer_tests/data/drop_down_form_field.odt Binary files differnew file mode 100644 index 000000000..f27b11574 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/drop_down_form_field.odt diff --git a/sw/qa/uitest/writer_tests/data/empty_drop_down_form_field.odt b/sw/qa/uitest/writer_tests/data/empty_drop_down_form_field.odt Binary files differnew file mode 100644 index 000000000..bd85dc2a9 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/empty_drop_down_form_field.odt diff --git a/sw/qa/uitest/writer_tests/data/findReplace.odt b/sw/qa/uitest/writer_tests/data/findReplace.odt Binary files differnew file mode 100644 index 000000000..97f92b778 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/findReplace.odt diff --git a/sw/qa/uitest/writer_tests/data/shape.odt b/sw/qa/uitest/writer_tests/data/shape.odt Binary files differnew file mode 100644 index 000000000..7b3ebf027 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/shape.odt diff --git a/sw/qa/uitest/writer_tests/data/splitTable.odt b/sw/qa/uitest/writer_tests/data/splitTable.odt Binary files differnew file mode 100644 index 000000000..269f1f654 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/splitTable.odt diff --git a/sw/qa/uitest/writer_tests/data/tableToText.odt b/sw/qa/uitest/writer_tests/data/tableToText.odt Binary files differnew file mode 100644 index 000000000..5f8f9b01d --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tableToText.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf108124.odt b/sw/qa/uitest/writer_tests/data/tdf108124.odt Binary files differnew file mode 100644 index 000000000..af0260928 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf108124.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf113284.odt b/sw/qa/uitest/writer_tests/data/tdf113284.odt Binary files differnew file mode 100644 index 000000000..b062fc2e8 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf113284.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf116242.odt b/sw/qa/uitest/writer_tests/data/tdf116242.odt Binary files differnew file mode 100644 index 000000000..6f995b065 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf116242.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf117039.odt b/sw/qa/uitest/writer_tests/data/tdf117039.odt Binary files differnew file mode 100644 index 000000000..6f8f61d83 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf117039.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf118208.odt b/sw/qa/uitest/writer_tests/data/tdf118208.odt Binary files differnew file mode 100644 index 000000000..8390f28e8 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf118208.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf118540.docx b/sw/qa/uitest/writer_tests/data/tdf118540.docx Binary files differnew file mode 100644 index 000000000..64022073e --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf118540.docx diff --git a/sw/qa/uitest/writer_tests/data/tdf120731.odt b/sw/qa/uitest/writer_tests/data/tdf120731.odt Binary files differnew file mode 100644 index 000000000..30638ec2c --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf120731.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf122449.odt b/sw/qa/uitest/writer_tests/data/tdf122449.odt Binary files differnew file mode 100644 index 000000000..fb809c1ba --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf122449.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf123547.docx b/sw/qa/uitest/writer_tests/data/tdf123547.docx Binary files differnew file mode 100644 index 000000000..2b6ed9bd5 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf123547.docx diff --git a/sw/qa/uitest/writer_tests/data/tdf124586.odt b/sw/qa/uitest/writer_tests/data/tdf124586.odt Binary files differnew file mode 100644 index 000000000..4d3852ae5 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf124586.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf124675.docx b/sw/qa/uitest/writer_tests/data/tdf124675.docx Binary files differnew file mode 100644 index 000000000..13ee05c5e --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf124675.docx diff --git a/sw/qa/uitest/writer_tests/data/tdf126017.odt b/sw/qa/uitest/writer_tests/data/tdf126017.odt Binary files differnew file mode 100644 index 000000000..96d6a67a8 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf126017.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf126627.odt b/sw/qa/uitest/writer_tests/data/tdf126627.odt Binary files differnew file mode 100644 index 000000000..79b481015 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf126627.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf130960.odt b/sw/qa/uitest/writer_tests/data/tdf130960.odt Binary files differnew file mode 100644 index 000000000..788db8e96 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf130960.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf130960_2.odt b/sw/qa/uitest/writer_tests/data/tdf130960_2.odt Binary files differnew file mode 100644 index 000000000..2123a85c4 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf130960_2.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf131931.odt b/sw/qa/uitest/writer_tests/data/tdf131931.odt Binary files differnew file mode 100644 index 000000000..7a2eae064 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf131931.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf49683.rtf b/sw/qa/uitest/writer_tests/data/tdf49683.rtf new file mode 100644 index 000000000..6dd4739e7 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf49683.rtf @@ -0,0 +1,81 @@ +{\rtf1\ansi\deff4\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset128 Times New Roman;}{\f4\fswiss\fprq0\fcharset0 Arial;}{\f5\fswiss\fprq2\fcharset128 Arial Narrow;}{\f6\froman\fprq2\fcharset0 Garamond;}{\f7\fnil\fprq2\fcharset128 WenQuanYi Zen Hei;}{\f8\fswiss\fprq2\fcharset0 Lucida Sans Unicode;}{\f9\fnil\fprq2\fcharset0 MS Mincho;}{\f10\fnil\fprq2\fcharset128 Lohit Hindi;}{\f11\fnil\fprq0\fcharset128 Lohit Hindi;}} +{\colortbl;\red0\green0\blue0;\red128\green128\blue128;} +{\stylesheet{\s0\snext0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043 Standaard;} +{\s15\sbasedon0\snext16\aspalpha\sb240\sa120\keepn\hich\af7\langfe255\dbch\af10\afs28\loch\f5\fs28\lang1043 Kop;} +{\s16\sbasedon0\snext16\aspalpha\sb0\sa120\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 Tekstblok;} +{\s17\sbasedon16\snext17\aspalpha\sb0\sa120\hich\af8\langfe255\dbch\af4\afs24\loch\f4\fs24\lang1043 Lijst;} +{\s18\sbasedon0\snext18\aspalpha\sb120\sa120\noline\i\hich\af8\langfe255\dbch\af11\afs24\ai\loch\f6\fs24\lang1043 Bijschrift;} +{\s19\sbasedon0\snext19\aspalpha\hich\af8\langfe255\dbch\af4\afs24\loch\f4\fs24\lang1043 Index;} +{\s20\sbasedon0\snext16\aspalpha\sb240\sa120\keepn\hich\af9\langfe255\dbch\af2\afs28\loch\f2\fs28\lang1043 Heading;} +{\s21\sbasedon0\snext21\aspalpha\sb120\sa120\i\hich\af8\langfe255\dbch\af4\afs24\ai\loch\f4\fs24\lang1043 caption;} +{\s22\sbasedon0\snext16\aspalpha\sb240\sa120\keepn\hich\af9\langfe255\dbch\af2\afs28\loch\f2\fs28\lang1043 WW-Heading;} +{\s23\sbasedon0\snext23\aspalpha\sb120\sa120\i\hich\af8\langfe255\dbch\af4\afs24\ai\loch\f4\fs24\lang1043 WW-caption;} +{\s24\sbasedon0\snext24\tqc\tx4818\tqr\tx9637\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 header;} +{\s25\sbasedon0\snext25\qr\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043 _GegegRiagg;} +{\s26\sbasedon0\snext26\tqc\tx4320\tqr\tx8640\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 WW-header;} +{\s27\sbasedon0\snext27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043 _GegegDoc;} +{\s28\sbasedon0\snext28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 Table Contents;} +{\s29\sbasedon0\snext29\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 WW-Table Contents;} +{\s30\sbasedon27\snext30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043 _GegegVast11;} +{\s31\sbasedon30\snext31\aspalpha\b\hich\af8\langfe255\dbch\af6\afs22\ab\loch\f6\fs22\lang1043 _GegegVast11Vet;} +{\s32\sbasedon29\snext32\qc\aspalpha\b\hich\af8\langfe255\dbch\af6\afs24\ab\loch\f6\fs24\lang1043 Table Heading;} +{\s33\sbasedon0\snext33\tqc\tx4320\tqr\tx8640\aspalpha\noline\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 Koptekst;} +{\s34\sbasedon0\snext34\aspalpha\noline\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043 Inhoud tabel;} +{\s35\sbasedon34\snext35\qc\aspalpha\noline\b\hich\af8\langfe255\dbch\af6\afs24\ab\loch\f6\fs24\lang1043 Tabelkop;} +}{\info{\keywords bhavb}{\author Cor Nouws}{\creatim\yr2009\mo10\dy20\hr14\min33}{\revtim\yr2009\mo10\dy20\hr14\min47}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice 3.4.5}{\vern3400}}\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709\deftab709 + +{\*\pgdsctbl +{\pgdsc0\pgdscuse195\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\headery709\margbsxn1134{\header\trowd\trql\trleft-1102\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx-270\cellx-89\cellx7970\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl{\i0\b0\rtlch \ltrch\loch +Kenmerk:}\cell\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl{\rtlch \ltrch\loch +}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl{\rtlch \ltrch\loch +*BriefReferentie*}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043{\afs4\rtlch \ltrch\loch\fs4 +} +\par }\pgdscnxt0 Standard;} +{\pgdsc1\pgdscuse195\pgndec\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\margbsxn1134\pgdscnxt0 First Page;} +{\pgdsc2\pgdscuse195\pgndec\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\margbsxn1134\pgdscnxt0 First Page;} +{\pgdsc3\pgdscuse195\pgndec\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\margbsxn1134\pgdscnxt0 Eerste pagina;}} +\formshade{\*\pgdscno3}\paperh16838\paperw11906\margl1417\margr1417\margt1247\margb1134\sectd\sbknone\sectunlocked1\pgndec\pgwsxn11906\pghsxn16838\marglsxn1417\margrsxn1417\margtsxn1247\headery709\margbsxn1134{\header\trowd\trql\trleft-1102\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx-270\cellx-89\cellx7970\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl{\i0\b0\rtlch \ltrch\loch +Kenmerk:}\cell\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl{\rtlch \ltrch\loch +}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl{\rtlch \ltrch\loch +*BriefReferentie*}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043{\afs4\rtlch \ltrch\loch\fs4 +} +\par }\titlepg\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\trowd\trql\trleft0\ltrrow\trrh2098\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx4748\cellx9072\pgndec\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\pard\plain \s25\qr\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\row\pard\trowd\trql\trleft0\ltrrow\trrh1191\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx4748\cellx9072\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +*HuisartsNaam*} +\par \pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +*HuisartsAdres*} +\par \pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +*HuisartsPostcode* *HuisartsPlaats*}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\row\pard\trowd\trql\trleft0\ltrrow\trrh624\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx4748\cellx9072\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +*ClientPostcode* *ClientPlaats*}\cell\pard\plain \s25\qr\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +*ClientAfdelingPlaatsLower*, *BriefDatum*}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch +} +\par \trowd\trql\trleft-1102\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx-270\cellx-89\cellx7970\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +Betreft:}\cell\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\b\ab\rtlch \ltrch\loch +}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch +} +\par \trowd\trql\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx1245\cellx1365\cellx9072\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\pard\plain \s31\aspalpha\b\hich\af8\langfe255\dbch\af6\afs22\ab\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\row\pard\trowd\trql\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx1245\cellx1365\cellx9072\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\pard\plain \s31\aspalpha\b\hich\af8\langfe255\dbch\af6\afs22\ab\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\row\pard\trowd\trql\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx1245\cellx1365\cellx9072\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\pard\plain \s30\aspalpha\hich\af8\langfe255\dbch\af6\afs22\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\pard\plain \s31\aspalpha\b\hich\af8\langfe255\dbch\af6\afs22\ab\loch\f6\fs22\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch +} +\par \trowd\trql\trleft-1102\ltrrow\trpaddft3\trpaddt0\trpaddfl3\trpaddl0\trpaddfb3\trpaddb0\trpaddfr3\trpaddr0\cellx-270\cellx-89\cellx7970\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +Kenmerk:}\cell\pard\plain \s27\aspalpha\hich\af8\langfe255\dbch\af6\afs18\loch\f6\fs18\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +}\cell\pard\plain \s28\aspalpha\hich\af8\langfe255\dbch\af6\afs24\loch\f6\fs24\lang1043\intbl\ltrpar{\rtlch \ltrch\loch +*BriefReferentie*}\cell\row\pard\pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch +} +\par \pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch +} +\par \pard\plain \s0\aspalpha\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\hich\af8\langfe255\dbch\af6\afs24\cf0\kerning1\lang1081\loch\f6\fs24\lang1043\ltrpar{\rtlch \ltrch\loch +} +\par }
\ No newline at end of file diff --git a/sw/qa/uitest/writer_tests/data/tdf51816.odt b/sw/qa/uitest/writer_tests/data/tdf51816.odt Binary files differnew file mode 100644 index 000000000..a7816a74f --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf51816.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf58050.html b/sw/qa/uitest/writer_tests/data/tdf58050.html new file mode 100644 index 000000000..9d61cf1c4 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf58050.html @@ -0,0 +1,19 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"/> + <title></title> + <meta name="generator" content="LibreOffice 5.1.6.2 (Linux)"/> + <meta name="author" content="-- "/> + <meta name="created" content="2018-02-24T09:48:50.194598073"/> + <meta name="changedby" content="-- "/> + <meta name="changed" content="2018-02-24T09:50:10.334408638"/> + <style type="text/css"> + @page { margin: 56.7pt } + p { margin-bottom: 7pt; line-height: 120% } + </style> +</head> +<body lang="en-US" dir="ltr"> +<p style="margin-bottom: 0pt; line-height: 100%">Bug 58050 test</p> +</body> +</html>
\ No newline at end of file diff --git a/sw/qa/uitest/writer_tests/data/tdf68347.odt b/sw/qa/uitest/writer_tests/data/tdf68347.odt Binary files differnew file mode 100644 index 000000000..2e72fb541 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf68347.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf81292.odt b/sw/qa/uitest/writer_tests/data/tdf81292.odt Binary files differnew file mode 100644 index 000000000..47e4ee9ab --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf81292.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf81457.odt b/sw/qa/uitest/writer_tests/data/tdf81457.odt Binary files differnew file mode 100644 index 000000000..04c18dd3a --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf81457.odt diff --git a/sw/qa/uitest/writer_tests/data/tdf99334.odt b/sw/qa/uitest/writer_tests/data/tdf99334.odt Binary files differnew file mode 100644 index 000000000..9cbdcbc41 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/tdf99334.odt diff --git a/sw/qa/uitest/writer_tests/data/textToTable.odt b/sw/qa/uitest/writer_tests/data/textToTable.odt Binary files differnew file mode 100644 index 000000000..088b6b4c1 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/textToTable.odt diff --git a/sw/qa/uitest/writer_tests/data/trackedChanges.odt b/sw/qa/uitest/writer_tests/data/trackedChanges.odt Binary files differnew file mode 100644 index 000000000..61f546695 --- /dev/null +++ b/sw/qa/uitest/writer_tests/data/trackedChanges.odt diff --git a/sw/qa/uitest/writer_tests/insertCaption.py b/sw/qa/uitest/writer_tests/insertCaption.py new file mode 100644 index 000000000..de73b3b76 --- /dev/null +++ b/sw/qa/uitest/writer_tests/insertCaption.py @@ -0,0 +1,76 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict +import time +from uitest.debug import sleep +from uitest.uihelper.common import select_pos + +class insertCaption(UITestCase): + + def test_insert_caption(self): + 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()) + + xHeight = xDialogFr.getChild("height") + xHeight.executeAction("UP", tuple()) + xHeight.executeAction("UP", tuple()) + + xOkBtn=xDialogFr.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) + + self.assertEqual(document.TextFrames.getCount(), 1) + + 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.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":"-"})) + + 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.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()) + + 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/tdf53460.py b/sw/qa/uitest/writer_tests/tdf53460.py new file mode 100644 index 000000000..f8fc0ad47 --- /dev/null +++ b/sw/qa/uitest/writer_tests/tdf53460.py @@ -0,0 +1,78 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.debug import sleep + +class tdf53460(UITestCase): + + def test_resize_table_with_keyboard_tdf53460(self): + + 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"})) + + 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": "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"})) + + 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 new file mode 100644 index 000000000..145b0bd99 --- /dev/null +++ b/sw/qa/uitest/writer_tests/tdf78068.py @@ -0,0 +1,36 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict, type_text + +import time +from uitest.debug import sleep +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import select_pos + +class tdf78068(UITestCase): + + def test_tdf78068_format_paragraph_crash(self): + 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.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sw/qa/uitest/writer_tests/tdf81457.py b/sw/qa/uitest/writer_tests/tdf81457.py new file mode 100644 index 000000000..3b7108866 --- /dev/null +++ b/sw/qa/uitest/writer_tests/tdf81457.py @@ -0,0 +1,35 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.path import get_srcdir_url +from uitest.uihelper.common import get_state_as_dict +import time +from uitest.debug import sleep +from uitest.uihelper.common import select_pos + +def get_url_for_data_file(file_name): + return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + +class tdf81457(UITestCase): + +#tdf 81457 + def test_open_documentProperties_tdf81457(self): + writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf81457.odt")) + self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties") + xDialog = self.xUITest.getTopFocusWindow() + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "2") #tab Custom properties + xOkBtn = xDialog.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sw/qa/uitest/writer_tests/tdf93068.py b/sw/qa/uitest/writer_tests/tdf93068.py new file mode 100644 index 000000000..fb883d58a --- /dev/null +++ b/sw/qa/uitest/writer_tests/tdf93068.py @@ -0,0 +1,36 @@ +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +import time +from uitest.uihelper.common import get_state_as_dict, type_text + +class tdf93068(UITestCase): + + def test_tdf93068(self): + + self.ui_test.create_doc_in_start_center("writer") + + xWriterDoc = self.xUITest.getTopFocusWindow() + + 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() + xDiscardBtn = xFontDlg.getChild("reset") + xDiscardBtn.executeAction("CLICK", tuple()) + xOKBtn = xFontDlg.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + self.ui_test.close_doc() diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py new file mode 100644 index 000000000..1fb999e63 --- /dev/null +++ b/sw/qa/uitest/writer_tests/trackedChanges.py @@ -0,0 +1,229 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# tests for tracked changes ; tdf912270 + +from uitest.framework import UITestCase +from uitest.debug import sleep +from uitest.path import get_srcdir_url +import time +from uitest.uihelper.common import get_state_as_dict, type_text + + +def get_url_for_data_file(file_name): + return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + +class trackedchanges(UITestCase): + + def test_tdf91270(self): + + self.ui_test.create_doc_in_start_center("writer") + + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + type_text(xWriterEdit, "Test") + + self.xUITest.executeCommand(".uno:TrackChanges") + + 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.close_doc() + + def test_tracked_changes_accept(self): + + 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.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.ui_test.close_doc() + + def test_tracked_changes_acceptall(self): + + 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.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()) + + + self.assertEqual(document.Text.String[0:16], "Test LibreOffice") + self.ui_test.close_doc() + + def test_tracked_changes_reject(self): + + 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.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()) + + self.assertEqual(document.Text.String[0:1], "") + self.ui_test.close_doc() + + def test_tracked_changes_rejectall(self): + + 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.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()) + + self.assertEqual(document.Text.String[0:1], "") + self.ui_test.close_doc() + + def test_tracked_changes_zprev_next(self): + + 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): + self.ui_test.load_file(get_url_for_data_file("trackedChanges.odt")) + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + document = self.ui_test.get_component() + + listText = [ + "Unknown Author\t01/24/2020 16:19:32\t", + "Unknown Author\t01/24/2020 16:19:35\t", + "Unknown Author\t01/24/2020 16:19:39\t", + "Unknown Author\t01/24/2020 16:19:39\t", + "Xisco Fauli\t01/27/2020 17:42:55\t"] + + self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges") + xTrackDlg = self.xUITest.getTopFocusWindow() + changesList = xTrackDlg.getChild("writerchanges") + + resultsAccept = [ + "The tennis ball is a small ball. The baskedtball is much bigger.", + "The tennis ball is a small ball. The baskedtball is much bigger.", + "The tennis ball is a small ball. The baskedtball is much bigger.", + "The tennis ball is a small ball. The basketball is much bigger.", + "The tennis ball is a small ball. The basketball is much bigger.", + "The tennis ball is a small ball. The basketball is much bigger."] + + for i in range(len(listText)): + self.assertEqual(document.Text.String.strip(), resultsAccept[i]) + self.assertEqual(get_state_as_dict(changesList.getChild('0'))["Text"], listText[i] ) + xAccBtn = xTrackDlg.getChild("accept") + xAccBtn.executeAction("CLICK", tuple()) + + self.assertEqual(document.Text.String.strip(), resultsAccept[5]) + #List is empty + self.assertFalse('0' in changesList.getChildren()) + + for i in reversed(range(len(listText))): + xUndoBtn = xTrackDlg.getChild("undo") + xUndoBtn.executeAction("CLICK", tuple()) + self.assertEqual(document.Text.String.strip(), resultsAccept[i]) + self.assertEqual(get_state_as_dict(changesList.getChild('0'))["Text"], listText[i] ) + + resultsReject = [ + "The tennis ball is a small ball. The baskedtball is much bigger.", + "The tenis ball is a small ball. The baskedtball is much bigger.", + "The tenis ball is a small bal. The baskedtball is much bigger.", + "The tenis ball is a small bal. The baskedtball is much bigger.", + "The tenis ball is a small bal. The baskedball is much bigger.", + "The tenis ball is a small bal. The baskedball is much biger."] + + for i in range(len(listText)): + self.assertEqual(document.Text.String.strip(), resultsReject[i]) + self.assertEqual(get_state_as_dict(changesList.getChild('0'))["Text"], listText[i] ) + xAccBtn = xTrackDlg.getChild("reject") + xAccBtn.executeAction("CLICK", tuple()) + + self.assertEqual(document.Text.String.strip(), resultsReject[5]) + #List is empty + self.assertFalse('0' in changesList.getChildren()) + + for i in reversed(range(len(listText))): + xUndoBtn = xTrackDlg.getChild("undo") + xUndoBtn.executeAction("CLICK", tuple()) + self.assertEqual(document.Text.String.strip(), resultsReject[i]) + self.assertEqual(get_state_as_dict(changesList.getChild('0'))["Text"], listText[i] ) + + xcloseBtn = xTrackDlg.getChild("close") + xcloseBtn.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests/versionDialog.py b/sw/qa/uitest/writer_tests/versionDialog.py new file mode 100644 index 000000000..6a97bfd20 --- /dev/null +++ b/sw/qa/uitest/writer_tests/versionDialog.py @@ -0,0 +1,47 @@ +#! /usr/bin/env python +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.path import get_srcdir_url +from uitest.uihelper.common import get_state_as_dict + +def get_url_for_data_file(file_name): + return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + + +class versionDialog(UITestCase): + + def test_tdf131931(self): + + writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf131931.odt")) + + document = self.ui_test.get_component() + xWriterDoc = self.xUITest.getTopFocusWindow() + + self.ui_test.execute_dialog_through_command(".uno:VersionDialog") + + xVersionDialog = self.xUITest.getTopFocusWindow() + + versiondList = xVersionDialog.getChild("versions") + + text = "04/06/2020 15:18\t\tHELLO" + self.assertEqual(1, len(versiondList.getChildren())) + self.assertEqual(get_state_as_dict(versiondList.getChild('0'))["Text"].strip(), text) + + xDeleteBtn = xVersionDialog.getChild("delete") + xDeleteBtn.executeAction("CLICK", tuple()) + + self.assertEqual(0, len(versiondList.getChildren())) + + xCloseBtn = xVersionDialog.getChild("close") + xCloseBtn.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/writer_tests/watermark.py b/sw/qa/uitest/writer_tests/watermark.py new file mode 100644 index 000000000..9fb587aa7 --- /dev/null +++ b/sw/qa/uitest/writer_tests/watermark.py @@ -0,0 +1,66 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict +import time +from uitest.debug import sleep +from uitest.uihelper.common import select_pos + + +class watermark(UITestCase): + + def test_insert_watermark(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: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"], "46°") + 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 new file mode 100644 index 000000000..07a4c6934 --- /dev/null +++ b/sw/qa/uitest/writer_tests/wordCount.py @@ -0,0 +1,298 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.debug import sleep +from uitest.uihelper.common import get_state_as_dict, type_text +from uitest.path import get_srcdir_url + +def get_url_for_data_file(file_name): + return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name + +class writerWordCount(UITestCase): + + def test_word_count_dialog(self): + + 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 + writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf68347.odt")) + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + document = self.ui_test.get_component() + + xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "24", "END_POS": "39"})) #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"], "4") + self.assertEqual(get_state_as_dict(xdocwords)["Text"], "12") + self.assertEqual(get_state_as_dict(xselectchars)["Text"], "15") + self.assertEqual(get_state_as_dict(xdocchars)["Text"], "54") + self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "12") + #bug Bug 117703 Word Count: Wrong result for "Characters excluding spaces" + #self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "44") + 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_tdf91100(self): + 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.close_doc() + + def test_tdf58050(self): + writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf58050.html")) + + 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"], "3") + self.assertEqual(get_state_as_dict(xselectchars)["Text"], "0") + self.assertEqual(get_state_as_dict(xdocchars)["Text"], "14") + self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "0") + self.assertEqual(get_state_as_dict(xdoccharsnospaces)["Text"], "12") + 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_a(self): + + 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): + + 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): + writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf51816.odt")) + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + document = self.ui_test.get_component() + #1. Open attached document + #2. Tools> Word count + 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") + + #3. Click after "At nunc" then <Ctrl><Shift><Left> + self.xUITest.executeCommand(".uno:GoRight") + self.xUITest.executeCommand(".uno:GoRight") + self.xUITest.executeCommand(".uno:GoRight") + self.xUITest.executeCommand(".uno:GoRight") + self.xUITest.executeCommand(".uno:GoRight") + self.xUITest.executeCommand(".uno:GoRight") + self.xUITest.executeCommand(".uno:GoRight") + self.xUITest.executeCommand(".uno:WordLeftSel") + + #needs to wait, because Word count dialog is already open and it takes time to refresh the counter + #Expected result : Words 1 & Characters 4 #Actual result : Words 0 & Characters 0 + self.ui_test.wait_until_property_is_updated(xselectwords, "Text", "1") + self.assertEqual(get_state_as_dict(xselectwords)["Text"], "1") + self.assertEqual(get_state_as_dict(xselectchars)["Text"], "4") + + #4. Click after "At nunc" then <Shift><Home> + self.xUITest.executeCommand(".uno:StartOfParaSel") + + #needs to wait, because Word count dialog is already open and it takes time to refresh the counter + #Expected result : Words 2 & Characters 7 & excluding space 6 #Actual result : Words 0 & Characters 0 + self.ui_test.wait_until_property_is_updated(xselectwords, "Text", "2") + self.assertEqual(get_state_as_dict(xselectwords)["Text"], "2") + self.assertEqual(get_state_as_dict(xselectchars)["Text"], "7") + + self.assertEqual(get_state_as_dict(xselectcharsnospaces)["Text"], "6") + + xCloseBtn = xDialog.getChild("close") + self.ui_test.close_dialog_through_button(xCloseBtn) + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: |