manykarim / robotframework-doctestlibrary

Robot Framework DocTest library. Simple Automated Visual Document Testing.
Apache License 2.0
46 stars 20 forks source link

How argument check_text_content of Compare Images should work? #31

Closed MoreFamed closed 1 year ago

MoreFamed commented 2 years ago

Hi, how should keyword Compare Images with argument _check_textcontent work, please? When comparing two PDF documents with different font or indentation of text, I always got the same result (FAIL) regardless of the value (True or False) of argument _check_textcontent. It seems like the argument does not work at all. The documentation is not much helpful with this issue... Thank you.

manykarim commented 2 years ago

Thank you for your comment regarding the check_text_content argument. Please find below two examples which check text content in a PDF via OCR or from PDF Data. Text Content can be compared two ways - by reading text via OCR or - on a pdf - reading the text value directly from the PDF content.

Compare two different PDF Files with moved text but same content OCR
    Compare Images    testdata/sample_1_page.pdf    testdata/sample_1_page_moved.pdf    check_text_content=${true}
Compare two different PDF Files with moved text but same content pdfminer
    Compare Images    testdata/sample_1_page.pdf    testdata/sample_1_page_moved.pdf    check_text_content=${true}    get_pdf_content=${true}

The acceptance tests can be found here: https://github.com/manykarim/robotframework-doctestlibrary/blob/main/atest/Compare.robot

I will try to document it a bit better in the next days, please let me know in case of any more questions.

manykarim commented 1 year ago

Added to Keyword Documentation in v.0.4.1