1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00
pdf2htmlEX/test
2018-10-10 22:32:32 -04:00
..
browser_tests regenerated references. 2016-09-26 18:28:01 +02:00
old working on unittest 2014-11-16 00:06:43 +08:00
test_output fix #501 2015-05-01 13:45:30 +08:00
.gitattributes improving tests 2014-11-19 00:48:18 +08:00
browser_tests.py Removed --embed altogether. 2016-12-11 14:37:19 +01:00
fancy.min.css improve test runner 2014-11-16 13:40:02 +08:00
README.md regenerated references. 2016-09-26 18:28:01 +02:00
start_xvfb.sh travis debug 2014-11-18 13:17:22 +08:00
test_local_browser.py Turn on tests since pdf2htmlEX build is now working. local_browser tests have to be disabled until geckobrowser can be reliably installed on Travis 2018-10-10 22:32:32 -04:00
test_output.py Always conserve output files in /tmp/pdf2htmlEX. 2016-09-26 16:31:46 +02:00
test_remote_browser.py copy edit 2016-09-26 17:14:06 +02:00
test.py.in Always conserve output files in /tmp/pdf2htmlEX. 2016-09-26 16:31:46 +02:00

Dependencies

  • python2 and packages
    • Python Imaging Library
    • Selenium
    • unittest
  • Firefox
    • firefoxdriver

Usage

  • Run all tests:
    • python test_output.py
    • python test_local_browser.py
  • Environment variables:
    • export P2H_TEST_GEN=1 to generate new reference files (when done, unset P2H_TEST_GEN)
    • export P2H_TEST_REMOTE=1 to test different browsers using Sauce Labs
      • Install sauceclient for Python
      • Set correct values for SAUCE_USERNAME and SAUCE_ACCESS_KEY
      • Setup a HTTP server at / on port 8000
      • Enable Sauce Connect
      • See .travis.yml as an example
      • python test_remote_browser.py

Add new test cases

  • Make sure you have the proper copyrights.
  • Using meaningful file names, a description of the file, or issueXXX.pdf.
  • Make each test case minimal:
    • One page only, unless the test case is about multiple pages.
    • Grayscale only, unless the test case is about colors.
    • Remove unnecessary elements.
  • [Optional] Include the source files that the PDF file is generated from.
  • Add the new PDF file to the correct folder in test/, and add a new function in the corresponding Python file
  • Run P2H_TEST_GEN=1 test/test.py test_issueXXX to generate the reference, assuming that the new function is called test_issueXXX