This project aims to test the conversion, opening files after conversion, and comparing documents.
- Python 3.11
- MS Office 2019
- LibreOffice Community Version: 7.3.0.3
Instruction: Python Poetry Installation Guide
-
MS office settings
- Turn on the dark theme in ms office and in LibreOffice
- In MS PowerPoint change
Options\Advanced\Display\Open all documents using this views
onNormal - slide only
-
Change config.py file.
- Set environment variables
- version - the document server version (Example: "8.1.0.50")
- source_doc_folder - path to folders with documents before conversion, the folder names must match the file extension (if the file extension in the folder is ".doc", then the folder name must be "doc")
- converted_doc_folder - path to folders with documents after conversion.
The names of folders should have the
form "
<version>_(dir_<extension before conversion> _<extension after conversion>)_(os_<operation system>)_(mode_<Default or t-format>)
" Example:8.1.0.50_(dir_xps-docx)_(os_linux)_(mode_Default)
. - list_of_file_names - array for selective comparison by filename
- Set environment variables
- To send termination reports of the script to Telegram, you need:
- to add 2 environment variables
TELEGRAM_TOKEN
- with a token from your bot on telegramCHANNEL_ID
- with the channel id on telegram
- or 2 files in the path
~/.telegram
:token
- with a token from your bot on telegramchat
- with the channel id on telegram
- to send messages via proxy, add a file at the path
~/.telegram/proxy.json
containing:
{
"login": "",
"password": "",
"ip": "",
"port": ""
}
invoke compare-test
- To compare images by file names
from "converted_doc_folder"
--direction
or -d
- specifies which files to compare.
Example: -d doc-docx
to compare doc-docx files.
--telegram
or -t
- to send reports in a telegram.
--ls
or -l
- to open files from files_array in config.py
invoke make-files
--telegram
or -t
- to send reports in a telegram.
--direction
or -d
- Specifies the direction for converting files.
Example: -d doc-docx
--version
or -v
- Specifies the version x2t libs.
Example: invoke make-files -v 7.4.0.163
invoke open-test
- Running file opening tests
--direction
or -d
- specifies which files to open.
Example: -d docx
to open only docx files. if no required - all
files will be opened
--ls
or -l
- to open files from files_array in config.py
--path "./path/to/your/folder"
- to open files in the specified folder.
--telegram
or -t
- to send reports in a telegram.
--fast_test
or -f
- to run tests without taking
into account the tested files
invoke conversion-test
--direction
or -d
- Specifies the direction for converting files.
Example: -d doc-docx
. if not required -
conversion to all formats will be performed.
--ls
or -l
- to conversion files from files_array in config.py
--telegram
or -t
- to send reports in a telegram.
--version
or -v
- Specifies the version x2t libs.
invoke download-core
--version
or -v
- Specifies the version x2t libs.
invoke download-files
--cores
or -c
- The amount CPU cores
to use for parallel downloading. (default: None)