Repository navigation
Move to the paged document support in Verify 33.3: text by page, and a sheet is a page - #160
Merged
Merged
Conversation
With a rendering backend the text of a docx is under the page it is on, so PagesToInclude limits it as it does the images. Each paragraph and table row is put on the page a bookmark at its start lands on. Morph 1.19.0, and workbooks are rendered with SheetPagination.OnePagePerSheet: a page is a visible sheet, drawn whole. The Word and PowerPoint page images change with the Morph version.
Morph 1.20.0 reports the text of each page, which replaces putting a bookmark on every paragraph and asking where each landed. A paragraph that runs over the end of a page is now divided where the page ends, and the page count is in the info file when no page is drawn.
PagesToInclude leaves out the csv of a sheet with its image, with or without a renderer. A hidden sheet is drawn and exported as any other, from a copy of the workbook in which every sheet is shown, and is named under HiddenSheets in the info file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves Verify.OpenXml onto the source and derived targets that Verify 33.3 added for paged documents (Verify#1951), and takes the package from 1.28.0 to 2.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.
Verifyand its adapter are pinned at 33.3.0.Beyond the move
DocumentConverter.GetPageTextsof Morph 1.20.0 (Morph#186), soPagesToIncludelimits it as it does the images. A paragraph or a table row that runs over the end of a page is divided where the page ends. Without a backend, or belownet10.0, there is no layout, and the text is that of the whole document as before.SheetPagination.OnePagePerSheetof Morph 1.19.0: a sheet is the one image, however long it is and whatever paper its page setup names. It was a page for each page of the print layout.PagesToIncludeleaves out the csv of a sheet with its image. A page is a sheet in tab order, which does not depend on a renderer, so the csv is left out the same way where there is none.PagesToInclude, with a png and a csv. Morph draws a workbook as it prints, so one with a hidden sheet is drawn from a copy in which every sheet is shown. They are named underHiddenSheetsin the info file.Migrating from 1.x
Version 2 moves to the paged document support in Verify 33.3. Pages and single sheets are renamed, the text moves into the info file, and
OpenXmlOutputsgives way to Verify's own settings.Settings
Initializeno longer takes anOpenXmlOutputs. Each output that could be left out of it is now left out by a setting of Verify, for every test onVerifierSettingsor for a single verification:OpenXmlOutputsPngExcludeDerivedTargets("png")TextPageText(PageTextPlacement.None)CsvExcludeDerivedTargets("csv")So
Initialize(OpenXmlOutputs.Csv)becomes:Files
For a test
Tests.Report:Tests.Report.verified.png, the page of a document with oneTests.Report#page_0001.verified.pngTests.Report#00.verified.png,#01, the pages of a document with severalTests.Report#page_0001.verified.png,#page_0002Tests.Report.verified.csv, the sheet of a workbook with oneTests.Report#Sheet1.verified.csv, by the name of the sheetTests.Report#Sheet1.verified.csv, a sheet of a workbook with severalTests.Report#00.verified.txt, the info of a docx or pptxTests.Report.verified.txtTests.Report#01.verified.txt, the text of a docx or pptxPageText(PageTextPlacement.PerPage)in#page_0001.verified.txtfor each slide of a pptx and each page of a docx, or#text.verified.txtfor a docx read without a rendering backendTests.Report.verified.txt, the info of an xlsxTests.Report.verified.docx,.xlsx,.pptxA renamed snapshot shows as a new file and a pending delete. Accepting both, or running once with AutoVerify, moves a test over. The content of a sheet is unchanged, so source control shows it as a rename. The page images are drawn by Morph 1.20.0 where they were by 1.18.0, and those of a workbook are of a sheet where they were of a printed page, so they differ.
The info file
What was at the top of the info file is now under
Document, with the page count and the text beside it. For a docx:With a rendering backend the text of a docx is the
Textof each page instead, as it is for a pptx.For an xlsx the properties of the workbook, with its
Sheets, move underDocumentthe same way.For a pptx
SlideCountis nowPageCount, and the text is theTextof each page, where it was one text with---between the slides. Slides are read in the order they are shown in, that ofp:sldIdLst, so that the text of a slide is on the page it is drawn on. They were read in the order of the slide parts, which is not the order of a deck whose slides have been moved.Testing
Run locally in Debug against Verify 33.3.0 and Morph 1.20.0 from nuget.org:
Verify.OpenXml.Tests,Tests.Skia,Tests.ImageSharpandStaticSettingsTestsall pass.Not done: skipping the drawing of the pages
PagesToIncludeleaves out. Every page is still drawn and the unwanted ones dropped. Morph'sImageExportOptions.Pagescould limit that to a range.