Content
View differences
Updated by Andrej Sandorf almost 3 years ago
Currently there are tests for:
multiple work packages export job
[https://github.com/opf/openproject/blob/dev/spec/workers/work\_packages/exports/export\_job\_integration\_spec.rb](https://github.com/opf/openproject/blob/dev/spec/workers/work_packages/exports/export_job_integration_spec.rb)
single work package export
[https://github.com/opf/openproject/blob/dev/spec/controllers/work\_packages\_controller\_spec.rb#L279](https://github.com/opf/openproject/blob/dev/spec/controllers/work_packages_controller_spec.rb#L279)
markdown formatting
[https://github.com/opf/md-to-pdf/tree/main/spec](https://github.com/opf/md-to-pdf/tree/main/spec)
But no content tests in relation to the work package data (except (expect markdown)
## Content tests:
1. export pdf with test configuration
2. read with pdf-inspector gem
3. test for expected content
Note: PDF generation includes temp file writing, so try to test as much as possible in with one generated PDF and not create one PDF for each check.
PDF Table
* [x] Check if title as expected
* [x] Check if all work packages are in the table
* [x] Check if all selected columns are in the table
* [x] Check if table is grouped, if enabled
* [x] Check if sum row exists, if enabled
PDF Report
* [x] Check if title as expected
* [x] Index contains all work packages in the query
* [x] Check if sum table exists, if enabled
* [x] Check if sum table is grouped, if enabled
* [x] Check there are detail sections for all work packages in the query
* Check if images are exported, if enabled
Detail Section (Single & Query Export)
* [x] Check if title as expected
* [x] Check if attributes table exists
* [x] Check if description and all custom fields exist
* [x] Check if images are exported, if enabled
multiple work packages export job
[https://github.com/opf/openproject/blob/dev/spec/workers/work\_packages/exports/export\_job\_integration\_spec.rb](https://github.com/opf/openproject/blob/dev/spec/workers/work_packages/exports/export_job_integration_spec.rb)
single work package export
[https://github.com/opf/openproject/blob/dev/spec/controllers/work\_packages\_controller\_spec.rb#L279](https://github.com/opf/openproject/blob/dev/spec/controllers/work_packages_controller_spec.rb#L279)
markdown formatting
[https://github.com/opf/md-to-pdf/tree/main/spec](https://github.com/opf/md-to-pdf/tree/main/spec)
But no content tests in relation to the work package data (except
## Content tests:
1. export pdf with test configuration
2. read with pdf-inspector gem
3. test for expected content
Note: PDF generation includes temp file writing, so try to test as much as possible in with one generated PDF and not create one PDF for each check.
PDF Table
* [x] Check if title as expected
* [x] Check if all work packages are in the table
* [x] Check if all selected columns are in the table
* [x] Check if table is grouped, if enabled
* [x] Check if sum row exists, if enabled
PDF Report
* [x] Check if title as expected
* [x] Index contains all work packages in the query
* [x] Check if sum table exists, if enabled
* [x] Check if sum table is grouped, if enabled
* [x] Check there are detail sections for all work packages in the query
* Check if images are exported, if enabled
Detail Section (Single & Query Export)
* [x] Check if title as expected
* [x] Check if attributes table exists
* [x] Check if description and all custom fields exist
* [x] Check if images are exported, if enabled