diff --git a/test/Application.cfc b/test/Application.cfc new file mode 100644 index 0000000..dd928ce --- /dev/null +++ b/test/Application.cfc @@ -0,0 +1,3 @@ +component { + this.pdf.type = 'classic'; +} diff --git a/test/README.md b/test/README.md new file mode 100644 index 0000000..92d43cf --- /dev/null +++ b/test/README.md @@ -0,0 +1,9 @@ +This is the manual test suite for the PDF extension. + +## Running tests + +In the `test` folder: + +- Install the most recently built extension by running `bin/install_extension.sh` +- Run `box start`. This should open a browser to the test suite page. +- Scroll down the page and make sure that each PDF looks like the reference image. diff --git a/test/bin/install_extension.sh b/test/bin/install_extension.sh new file mode 100755 index 0000000..008f430 --- /dev/null +++ b/test/bin/install_extension.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -e + +script_dir=$(cd `dirname $0` && pwd) +repo_root=${script_dir}/../../ + +cd "${repo_root}test" +lucee_home=$(box server info property=serverHomeDirectory) + +if [ -z "${lucee_home}" ]; then + echo "ERROR: Could not find Lucee home directory" + exit 1 +fi + +deploy_dir=${lucee_home}/WEB-INF/lucee-server/deploy + +echo "Found Lucee home directory at ${lucee_home}" +echo "Copying the following files to ${deploy_dir}:" +ls "${repo_root}"dist/*.lex + +cp "${repo_root}"dist/*.lex "${deploy_dir}" + +echo "Waiting for Lucee to install the extension..." +while ls "${deploy_dir}"/*.lex &> /dev/null; do + sleep 1 + echo -n . +done +echo +echo "Extension installed" diff --git a/test/box.json b/test/box.json new file mode 100644 index 0000000..53dfe8b --- /dev/null +++ b/test/box.json @@ -0,0 +1,57 @@ +{ + "author":"", + "bugs":"", + "changelog":"", + "contributors":[], + "dependencies":{}, + "description":"", + "devDependencies":{}, + "documentation":"", + "homepage":"", + "ignore":[ + "**/.*", + "/test/", + "/tests/" + ], + "installPaths":{}, + "instructions":"", + "keywords":[], + "license":[ + { + "type":"", + "URL":"" + } + ], + "location":"ForgeboxStorage", + "name":"My Package", + "private":false, + "projectURL":"", + "repository":{ + "type":"", + "URL":"" + }, + "scripts":{}, + "shortDescription":"A sweet package", + "slug":"my-package", + "testbox":{ + "bundles":"", + "directory":"tests.specs", + "labels":"", + "options":{}, + "recurse":true, + "reporter":"", + "runner":[ + { + "default":"" + } + ], + "testBundles":"", + "testSpecs":"", + "testSuites":"", + "verbose":true, + "watchDelay":500, + "watchPaths":"**.cfc" + }, + "type":"modules", + "version":"0.0.0" +} diff --git a/test/expected_output/classic_basic.png b/test/expected_output/classic_basic.png new file mode 100644 index 0000000..956541a Binary files /dev/null and b/test/expected_output/classic_basic.png differ diff --git a/test/expected_output/classic_images.png b/test/expected_output/classic_images.png new file mode 100644 index 0000000..8ddff84 Binary files /dev/null and b/test/expected_output/classic_images.png differ diff --git a/test/expected_output/modern_basic.png b/test/expected_output/modern_basic.png new file mode 100644 index 0000000..01b479f Binary files /dev/null and b/test/expected_output/modern_basic.png differ diff --git a/test/expected_output/modern_section.png b/test/expected_output/modern_section.png new file mode 100644 index 0000000..6806035 Binary files /dev/null and b/test/expected_output/modern_section.png differ diff --git a/test/index.cfm b/test/index.cfm new file mode 100644 index 0000000..0d639a6 --- /dev/null +++ b/test/index.cfm @@ -0,0 +1,44 @@ + +
+