[Libreoffice-commits] dev-tools.git: 3 commits - uitest/mass-testing

2020-05-12 Thread Xisco Fauli (via logerrit)
 uitest/mass-testing/run.py|   40 ++---
 uitest/mass-testing/writer.py |   77 ++
 2 files changed, 24 insertions(+), 93 deletions(-)

New commits:
commit 5f97b55c1cd78a69dc1434be22cfb542d6a361fb
Author: Xisco Fauli 
AuthorDate: Tue May 12 11:57:38 2020 +0200
Commit: Xisco Fauli 
CommitDate: Tue May 12 12:17:24 2020 +0200

mass-uitesting: remove unneeded tests

Change-Id: I1e8cdb4557b67add41619cf415ca8232f9b1fe5d

diff --git a/uitest/mass-testing/writer.py b/uitest/mass-testing/writer.py
index 92f8d17..5603186 100755
--- a/uitest/mass-testing/writer.py
+++ b/uitest/mass-testing/writer.py
@@ -148,73 +148,4 @@ class massTesting(UITestCase):
 
 self.ui_test.close_doc()
 
-def test_change_text_formatting_and_undo(self):
-xEdit = self.load_file()
-if xEdit:
-self.xUITest.executeCommand(".uno:SelectAll")
-self.xUITest.executeCommand(".uno:Bold")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:Italic")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:Underline")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:UnderlineDouble")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:Strikeout")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:Overline")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:SuperScript")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:SubScript")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:Shadowed")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:OutlineFont")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:Grow")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:Shrink")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:ChangeCaseToUpper")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:ChangeCaseToLower")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:ChangeCaseRotateCase")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:ChangeCaseToSentenceCase")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:ChangeCaseToToggleCase")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:SmallCaps")
-self.xUITest.executeCommand(".uno:Undo")
-
-self.ui_test.close_doc()
-
-def test_default_bullet_list_and_undo(self):
-xEdit = self.load_file()
-if xEdit:
-self.xUITest.executeCommand(".uno:SelectAll")
-self.xUITest.executeCommand(".uno:DefaultBullet")
-self.xUITest.executeCommand(".uno:Undo")
-
-self.ui_test.close_doc()
-
-def test_change_alignment_and_undo(self):
-xEdit = self.load_file()
-if xEdit:
-self.xUITest.executeCommand(".uno:SelectAll")
-self.xUITest.executeCommand(".uno:CommonAlignLeft")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:CommonAlignHorizontalCenter")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:CommonAlignRight")
-self.xUITest.executeCommand(".uno:Undo")
-self.xUITest.executeCommand(".uno:CommonAlignJustified")
-self.xUITest.executeCommand(".uno:Undo")
-
-self.ui_test.close_doc()
-
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
commit 4c315059aad3df8971a15253634ee343772c5ce7
Author: Xisco Fauli 
AuthorDate: Tue May 12 11:55:08 2020 +0200
Commit: Xisco Fauli 
CommitDate: Tue May 12 12:17:13 2020 +0200

mass-uitesting: fix insert header and footer

Change-Id: I66ffeac9b0140e93a3a2b9dde856134dc952ed45

diff --git a/uitest/mass-testing/writer.py b/uitest/mass-testing/writer.py
index dbae5ce..92f8d17 100755
--- a/uitest/mass-testing/writer.py
+++ b/uitest/mass-testing/writer.py
@@ -79,13 +79,13 @@ class massTesting(UITestCase):
 #Insert Default header if it doesn't exists
 if not document.StyleFamilies.PageStyles.Standard.HeaderIsOn:
 self.xUITest.executeCommand(
-

[Libreoffice-commits] dev-tools.git: 3 commits - uitest/mass-testing

2019-04-24 Thread Libreoffice Gerrit user
 uitest/mass-testing/calc.py |  194 ++--
 uitest/mass-testing/run.py  |   11 +-
 2 files changed, 127 insertions(+), 78 deletions(-)

New commits:
commit ed1ccab0acf93bb91158f656ccd8c8f96f5cc9ae
Author: Xisco Fauli 
AuthorDate: Wed Apr 24 11:20:54 2019 +0200
Commit: Xisco Fauli 
CommitDate: Wed Apr 24 11:20:54 2019 +0200

mass-uitesting: keep results if resume is used

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 40d88c6..18f45a7 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -91,12 +91,15 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug, 
isResume):
 filesRun = pickle.load(pickle_in)
 
 if sourceHash not in filesRun:
-filesRun[sourceHash] = []
+filesRun[sourceHash] = {'files': []}
+
+if 'results' in filesRun[sourceHash]:
+results = filesRun[sourceHash]['results']
 
 for fileName in listFiles:
 
 if isResume:
-if fileName in filesRun[sourceHash]:
+if fileName in filesRun[sourceHash]['files']:
 print("SKIP: " + fileName)
 continue
 
@@ -193,7 +196,9 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug, 
isResume):
 break
 
 if isResume:
-filesRun[sourceHash].append(fileName)
+filesRun[sourceHash]['files'].append(fileName)
+
+filesRun[sourceHash]['results'] = results
 
 with open(pklFile, 'wb') as pickle_out:
 pickle.dump(filesRun, pickle_out)
commit 94d928c4859f964f184cfb46e5e4040898038f9f
Author: Xisco Fauli 
AuthorDate: Wed Apr 24 02:24:51 2019 +0200
Commit: Xisco Fauli 
CommitDate: Wed Apr 24 10:57:42 2019 +0200

mass-uitesting: Perform all tests in more sheets

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
index d6f0122..a6911ad 100755
--- a/uitest/mass-testing/calc.py
+++ b/uitest/mass-testing/calc.py
@@ -10,6 +10,9 @@ from uitest.framework import UITestCase
 from libreoffice.uno.propertyvalue import mkPropertyValues
 import time
 
+#Max number of sheets to jump to
+maxSheets = 10
+
 class massTesting(UITestCase):
 
 def load_file(self):
@@ -40,91 +43,126 @@ class massTesting(UITestCase):
 
 return xEdit
 
+def go_to_first_sheet(self):
+document = self.ui_test.get_component()
+nrSheets = document.Sheets.getCount()  #number of sheets in the 
document
+#go to first sheet
+for i in range(nrSheets - 1):
+self.xUITest.executeCommand(".uno:JumpToPrevTable")
+
+# Make sure all sheets are visible
+self.xUITest.executeCommand(".uno:Hide")
+self.xUITest.executeCommand(".uno:Show")
+xDialog = self.xUITest.getTopFocusWindow()
+xOKBtn = xDialog.getChild("ok")
+self.ui_test.close_dialog_through_button(xOKBtn)
+
+return nrSheets
+
 def test_remove_all_and_undo(self):
 xEdit = self.load_file()
 if xEdit:
-self.xUITest.executeCommand(".uno:SelectAll")
-xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DELETE"}))
+nrSheets = self.go_to_first_sheet()
 
-self.xUITest.executeCommand(".uno:Undo")
+for i in range(nrSheets)[:maxSheets]:
+self.xUITest.executeCommand(".uno:SelectAll")
+xEdit.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"DELETE"}))
+
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:JumpToNextTable")
 
 self.ui_test.close_doc()
 
 def test_insert_column_and_undo(self):
 xEdit = self.load_file()
 if xEdit:
-self.xUITest.executeCommand(".uno:InsertColumnsBefore")
-self.xUITest.executeCommand(".uno:Undo")
+nrSheets = self.go_to_first_sheet()
+
+for i in range(nrSheets)[:maxSheets]:
+self.xUITest.executeCommand(".uno:InsertColumnsBefore")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:JumpToNextTable")
 
 self.ui_test.close_doc()
 
 def test_insert_row_and_undo(self):
 xEdit = self.load_file()
 if xEdit:
-self.xUITest.executeCommand(".uno:InsertRowsBefore")
-self.xUITest.executeCommand(".uno:Undo")
+nrSheets = self.go_to_first_sheet()
+
+for i in range(nrSheets)[:maxSheets]:
+self.xUITest.executeCommand(".uno:InsertRowsBefore")
+self.xUITest.executeCommand(".uno:Undo")
+self.xUITest.executeCommand(".uno:JumpToNextTable")
 
 self.ui_test.close_doc()
 
 def test_copy_all_paste_undo(self):
 xEdit = self.load_file()
 if xEdit:
-self.xUITest.executeCommand(".uno:SelectAll")
+nrSheets = 

[Libreoffice-commits] dev-tools.git: 3 commits - uitest/mass-testing

2019-04-18 Thread Libreoffice Gerrit user
 uitest/mass-testing/calc.py |   40 +---
 uitest/mass-testing/run.py  |   23 +--
 2 files changed, 50 insertions(+), 13 deletions(-)

New commits:
commit 8b3e626d2f21a65242cf3de4f08c3810ade3e5ee
Author: Xisco Fauli 
AuthorDate: Thu Apr 18 12:48:28 2019 +0200
Commit: Xisco Fauli 
CommitDate: Thu Apr 18 12:55:53 2019 +0200

mass-uitesting: Fix UnicodeDecodeError

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 8de5d35..6e3aeb6 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -74,8 +74,8 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug):
 totalSkip = 0
 
 sofficePath = liboPath + "instdir/program/soffice"
-process = Popen([sofficePath, "--version"], encoding="utf-8", stdout=PIPE, 
stderr=PIPE)
-stdout, stderr = process.communicate()
+process = Popen([sofficePath, "--version"], stdout=PIPE, stderr=PIPE)
+stdout = process.communicate()[0].decode("utf-8")
 sourceHash = stdout.split(" ")[2].strip()
 
 #Keep track of the files run
@@ -110,9 +110,9 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug):
 "--soffice=path:" + sofficePath,
 "--userdir=file://" + profilePath,
 "--file=" + component + ".py"], stdin=PIPE, stdout=PIPE, 
stderr=PIPE,
-encoding="utf-8", preexec_fn=os.setsid) as process:
+preexec_fn=os.setsid) as process:
 try:
-outputLines = process.communicate(timeout=60)[0].splitlines()
+outputLines = 
process.communicate(timeout=60)[0].decode('utf-8').splitlines()
 importantInfo = ''
 for line in outputLines:
 if isDebug:
commit 50957cb6316b0d6157dc0c787550954baf95f727
Author: Xisco Fauli 
AuthorDate: Thu Apr 18 12:42:46 2019 +0200
Commit: Xisco Fauli 
CommitDate: Thu Apr 18 12:55:53 2019 +0200

mass-uitesting: Use a different log for each component

and put them in 'logs' folder

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 819ca20..8de5d35 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -32,12 +32,12 @@ class DefaultHelpParser(argparse.ArgumentParser):
 self.print_help()
 sys.exit(2)
 
-def start_logger():
+def start_logger(component):
 rootLogger = logging.getLogger()
 rootLogger.setLevel(os.environ.get("LOGLEVEL", "INFO"))
 
 logFormatter = logging.Formatter("%(asctime)s %(message)s")
-fileHandler = logging.FileHandler("massTesting.log")
+fileHandler = logging.FileHandler("./logs/" + component + ".log")
 fileHandler.setFormatter(logFormatter)
 rootLogger.addHandler(fileHandler)
 
@@ -81,8 +81,9 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug):
 #Keep track of the files run
 filesRun = {}
 
-if os.path.exists('run.pkl'):
-with open('run.pkl', 'rb') as pickle_in:
+pklFile = './logs/' + component + '.pkl'
+if os.path.exists(pklFile):
+with open(pklFile, 'rb') as pickle_in:
 filesRun = pickle.load(pickle_in)
 
 if sourceHash not in filesRun:
@@ -148,7 +149,7 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug):
 
 filesRun[sourceHash].append(fileName)
 
-with open('run.pkl', 'wb') as pickle_out:
+with open(pklFile, 'wb') as pickle_out:
 pickle.dump(filesRun, pickle_out)
 
 totalTests = totalPass + totalTimeout + totalSkip + totalFail
@@ -194,8 +195,10 @@ if __name__ == '__main__':
 os.environ["URE_BOOTSTRAP"] = "file://" + liboPath + 
"instdir/program/fundamentalrc"
 os.environ["SAL_USE_VCLPLUGIN"] = "gen"
 
-logger = start_logger()
+if not os.path.exists('./logs'):
+os.makedirs('./logs')
 
+logger = start_logger(component)
 
 listFiles = get_file_names(component, filesPath)
 
commit 6b15ed3504d6cc0cce0e9a2788047b1193ecf33d
Author: Xisco Fauli 
AuthorDate: Thu Apr 18 12:39:28 2019 +0200
Commit: Xisco Fauli 
CommitDate: Thu Apr 18 12:55:53 2019 +0200

mass-uitesting: Add a few calc tests

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
index 39cbcda..14383a9 100755
--- a/uitest/mass-testing/calc.py
+++ b/uitest/mass-testing/calc.py
@@ -34,17 +34,51 @@ class massTesting(UITestCase):
 
 try:
 xDoc = self.xUITest.getTopFocusWindow()
-xEdit = xDoc.getChild("edit")
+xEdit = xDoc.getChild("grid_window")
 except:
 #In case the mimetype is wrong and the file is open with another 
component
 handle_skip()
 
 return xEdit
 
-def test_calc(self):
+def test_remove_all_and_undo(self):
 xEdit = self.load_file()
 if xEdit:
-continue
+self.xUITest.executeCommand(".uno:SelectAll")
+xEdit.executeAction("TYPE",