Skip to content

Move to the paged document support in Verify 33.3 - #498

Merged
SimonCropp merged 1 commit into
mainfrom
paged-documents
Oct 5, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
paged-documents

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

Moves Verify.QuestPDF onto the source and derived targets that Verify 33.3 added for paged documents (Verify#1951), and takes the package from 2.10.0 to 3.0.0.

The converter now says which of its targets is the document and which were computed from it. Verify compares the document first, so a file derived from it is only given the benefit of its comparer while the document itself is unchanged, and DiffEngine's viewer shows the files derived from a document beneath it and accepts them with it.

It is a major version because what an existing test suite has to change is listed below. Verify and its adapter are pinned at 33.3.0.

Migrating from 2.x

Version 3 moves to the paged document support in Verify 33.3. The settings for choosing what is verified are now those of Verify:

2.x 3.x
VerifyQuestPdf.Initialize(QuestPdfOutputs.None) VerifyQuestPdf.Initialize() and VerifierSettings.ExcludeDerivedTargets("png")
VerifyQuestPdf.Initialize(QuestPdfOutputs.Png) or QuestPdfOutputs.All VerifyQuestPdf.Initialize()
.PagesToInclude(2) Unchanged. It is now a member of VerifySettings and SettingsTask, and of VerifierSettings for every test
.PagesToInclude(pageNumber => pageNumber == 2) Unchanged for a lambda. The delegate VerifyQuestPDF.ShouldIncludePage is replaced by VerifyTests.IncludePage

The page images are renamed. The number of a page is now 1 based, is always present, and is the number the page has in the document:

2.x 3.x
Tests.Report#00.verified.png Tests.Report#page_0001.verified.png
Tests.Report#01.verified.png Tests.Report#page_0002.verified.png
Tests.Report.verified.png for a document with one page Tests.Report#page_0001.verified.png
Tests.Report.verified.png for PagesToInclude(pageNumber => pageNumber == 2) Tests.Report#page_0002.verified.png
Tests.Report.verified.pdf Unchanged
Tests.Report.verified.txt The same name, with the content below

In 2.x the pages PagesToInclude kept were numbered again from zero, so the name of a page file depended on which other pages were verified.

The info file has the shape every paged document has: the metadata and settings under Document, and Pages as PageCount.

{                                     {
  Pages: 2,                             Document: {
  Metadata: {                             Metadata: {
    Title: The Title                        Title: The Title
  },                                      },
  Settings: {                             Settings: {
    ContentDirection: LeftToRight           ContentDirection: LeftToRight
  }                                       }
}                                       },
                                        PageCount: 2
                                      }

Renamed snapshots show as a new file and a pending delete. Accepting both, or running once with AutoVerify, moves a test over.

Testing

Built in Release and run with the commands CI uses, against Verify 33.3.0 from nuget.org: 12 passed.

@SimonCropp SimonCropp added this to the 3.0.0 milestone Oct 5, 2026
@SimonCropp
SimonCropp merged commit cc84752 into main Oct 5, 2026
6 checks passed
@SimonCropp
SimonCropp deleted the paged-documents branch October 5, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant