form-tester 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -70,7 +70,21 @@ Dokumenter verification (only when modal confirms storage):
|
|
|
70
70
|
2. The document list loads sorted newest first. The first entry should match the form title.
|
|
71
71
|
3. Click "Se detaljer" on the first document, then click "Åpne dokumentet".
|
|
72
72
|
4. IMPORTANT - document capture depends on format:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
|
|
74
|
+
PDF documents (shown in a PDF viewer/modal/iframe):
|
|
75
|
+
Do NOT screenshot PDFs. Instead, download the actual PDF file:
|
|
76
|
+
a. Take a snapshot to find the PDF viewer element: `form-tester exec snapshot`
|
|
77
|
+
b. Find the iframe or embed/object element that displays the PDF. Look for src attributes containing .pdf or blob: URLs.
|
|
78
|
+
c. Extract the PDF URL: `form-tester exec eval "document.querySelector('iframe')?.src || document.querySelector('embed')?.src || document.querySelector('object')?.data"`
|
|
79
|
+
d. If the URL is a blob: URL or direct PDF link, download it: `form-tester exec eval "async () => { const r = await fetch(document.querySelector('iframe')?.src); const b = await r.blob(); return URL.createObjectURL(b); }"`
|
|
80
|
+
e. Or use the download button if the PDF viewer has one — look for a download icon/button in the snapshot and click it.
|
|
81
|
+
f. Save the PDF: `form-tester exec pdf --filename "$OUTPUT_DIR/document.pdf"`
|
|
82
|
+
g. If all else fails, right-click save or use: `form-tester exec run-code "async page => { const frame = page.frameLocator('iframe').first(); /* extract content */ }"`
|
|
83
|
+
|
|
84
|
+
HTML documents (opens in a new tab or renders in page):
|
|
85
|
+
Take a FULL-PAGE screenshot of the ENTIRE document (`form-tester exec screenshot --filename "$OUTPUT_DIR/document_screenshot.png" --full-page`). HTML documents cannot be downloaded as files, so the full-page screenshot is the primary artifact. Also save the snapshot and raw HTML with:
|
|
86
|
+
`form-tester exec eval "document.documentElement.outerHTML"` and save to document.html.
|
|
87
|
+
|
|
88
|
+
XML/other formats: Note the document type in test_results.txt and skip capture.
|
|
89
|
+
|
|
76
90
|
5. Include the document verification results in test_results.txt (document title, whether it matched the form h1, document type: HTML/PDF/XML).
|
|
@@ -83,6 +83,12 @@ After submission, read the modal text:
|
|
|
83
83
|
- If it does NOT mention Dokumenter -> skip verification, note in test_results.txt.
|
|
84
84
|
|
|
85
85
|
Document capture depends on format:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
|
|
87
|
+
**PDF documents** (shown in PDF viewer/modal/iframe): Do NOT screenshot PDFs. Download the file instead:
|
|
88
|
+
1. Take a snapshot to find the PDF viewer: `form-tester exec snapshot`
|
|
89
|
+
2. Extract the PDF URL from the iframe/embed: `form-tester exec eval "document.querySelector('iframe')?.src || document.querySelector('embed')?.src || document.querySelector('object')?.data"`
|
|
90
|
+
3. Download via: `form-tester exec pdf --filename "$OUTPUT_DIR/document.pdf"` or click the download button in the PDF viewer if available.
|
|
91
|
+
|
|
92
|
+
**HTML documents**: take a full-page screenshot of the ENTIRE document (`form-tester exec screenshot --filename "..." --full-page`). Also save raw HTML with `form-tester exec eval "document.documentElement.outerHTML"`.
|
|
93
|
+
|
|
94
|
+
**XML/other**: note the type in test_results.txt and skip capture.
|
package/form-tester.js
CHANGED
|
@@ -6,7 +6,7 @@ const { spawn, execSync } = require("child_process");
|
|
|
6
6
|
|
|
7
7
|
const CONFIG_PATH = path.join(process.cwd(), "form-tester.config.json");
|
|
8
8
|
const OUTPUT_BASE = path.resolve(process.cwd(), "output");
|
|
9
|
-
const LOCAL_VERSION = "0.7.
|
|
9
|
+
const LOCAL_VERSION = "0.7.3";
|
|
10
10
|
const RECOMMENDED_PERSON = "Uromantisk Direktør";
|
|
11
11
|
|
|
12
12
|
// Recording — persisted to disk so `form-tester exec` can append across processes
|
package/package.json
CHANGED