2014-11-16 05:40:02 +00:00
|
|
|
### Dependencies
|
|
|
|
|
2014-11-16 14:57:38 +00:00
|
|
|
- python2 and packages
|
|
|
|
- Python Imaging Library
|
2016-09-26 14:30:38 +00:00
|
|
|
- Selenium
|
2014-11-16 14:57:38 +00:00
|
|
|
- unittest
|
|
|
|
- Firefox
|
2016-09-26 11:16:48 +00:00
|
|
|
- firefoxdriver
|
2014-11-16 05:40:02 +00:00
|
|
|
|
|
|
|
### Usage
|
|
|
|
- Run all tests:
|
2016-09-26 14:30:38 +00:00
|
|
|
- python test_output.py
|
|
|
|
- python test_local_browser.py
|
2014-11-16 05:40:02 +00:00
|
|
|
- Environment variables:
|
2016-09-26 16:28:01 +00:00
|
|
|
- `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
|
2014-11-20 04:23:19 +00:00
|
|
|
- Install `sauceclient` for Python
|
2014-11-20 04:19:45 +00:00
|
|
|
- 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
|
2016-09-26 14:30:38 +00:00
|
|
|
- python test_remote_browser.py
|
2014-11-16 05:40:02 +00:00
|
|
|
|
2014-11-20 04:19:45 +00:00
|
|
|
### Add new test cases
|
2014-11-16 05:40:02 +00:00
|
|
|
|
|
|
|
- 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.
|
2014-11-20 04:19:45 +00:00
|
|
|
- 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`
|