@@ -19,7 +19,8 @@ static async Task Main()
1919 {
2020 const string baseUrl = "http://localhost:9919" ;
2121
22- var repoRoot = typeof ( Program ) . Assembly . GetCustomAttributes < AssemblyMetadataAttribute > ( )
22+ var repoRoot = typeof ( Program )
23+ . Assembly . GetCustomAttributes < AssemblyMetadataAttribute > ( )
2324 . Single ( a => a . Key == "RepoRoot" )
2425 . Value ! ;
2526
@@ -29,69 +30,72 @@ static async Task Main()
2930 using var host = hostBuilder . Build ( ) ;
3031 await host . StartAsync ( ) ;
3132
32- var logger = host . Services . GetRequiredService < ILoggerFactory > ( )
33+ var logger = host
34+ . Services . GetRequiredService < ILoggerFactory > ( )
3335 . CreateLogger ( "GovUk.Frontend.AspNetCore.DocSamplesScreenshotter" ) ;
3436
3537 await new BrowserFetcher ( ) . DownloadAsync ( BrowserFetcher . DefaultRevision ) ;
36- var browser = await Puppeteer . LaunchAsync ( new LaunchOptions ( )
37- {
38- Headless = true
39- } ) ;
38+ var browser = await Puppeteer . LaunchAsync ( new LaunchOptions ( ) { Headless = true } ) ;
4039
41- await WriteScreenshots ( new [ ]
42- {
43- ( "Accordion/AccordionWithSummarySections" , "accordion-with-summary-sections.png" ) ,
44- ( "BackLink/BackLinkWithDefaultContent" , "back-link-with-default-content.png" ) ,
45- ( "BackLink/BackLinkWithCustomContent" , "back-link-with-custom-content.png" ) ,
46- ( "Breadcrumbs/Breadcrumbs" , "breadcrumbs.png" ) ,
47- ( "Button/DefaultButton" , "button-default.png" ) ,
48- ( "Button/SecondaryButton" , "button-secondary.png" ) ,
49- ( "Button/StartButton" , "button-start.png" ) ,
50- ( "Button/DisabledButton" , "button-disabled.png" ) ,
51- ( "Checkboxes/Checkboxes" , "checkboxes.png" ) ,
52- ( "Checkboxes/CheckboxesWithConditional" , "checkboxes-with-conditional.png" ) ,
53- ( "Checkboxes/CheckboxesWithError" , "checkboxes-with-error.png" ) ,
54- ( "Checkboxes/CheckboxesWithNone" , "checkboxes-with-none.png" ) ,
55- ( "Checkboxes/CheckboxesWithoutFieldset" , "checkboxes-without-fieldset.png" ) ,
56- ( "CharacterCount/CharacterCount" , "character-count.png" ) ,
57- ( "DateInput/DateInput" , "date-input.png" ) ,
58- ( "DateInput/DateInputWithCustomItemLabels" , "date-input-with-custom-labels.png" ) ,
59- ( "DateInput/DateInputWithCustomItemValues" , "date-input-with-custom-values.png" ) ,
60- ( "DateInput/DateInputWithError" , "date-input-with-error.png" ) ,
61- ( "DateInput/DateInputWithFieldset" , "date-input-with-fieldset.png" ) ,
62- ( "Details/Details" , "details.png" ) ,
63- ( "Details/DetailsExpanded" , "details-expanded.png" ) ,
64- ( "ErrorSummary/ErrorSummary" , "error-summary.png" ) ,
65- ( "ErrorSummary/ErrorSummaryWithModelStateError" , "error-summary-with-modelstate-error.png" ) ,
66- ( "ErrorSummary/ErrorSummaryWithTitle" , "error-summary-with-title.png" ) ,
67- ( "FileUpload/FileUpload" , "file-upload.png" ) ,
68- ( "FileUpload/FileUploadWithErrors" , "file-upload-with-errors.png" ) ,
69- ( "InsetText/InsetText" , "inset-text.png" ) ,
70- ( "NotificationBanner/NotificationBanner" , "notification-banner.png" ) ,
71- ( "NotificationBanner/NotificationBannerSuccess" , "notification-banner-success.png" ) ,
72- ( "NotificationBanner/NotificationBannerWithOverridenTitle" , "notification-banner-with-overriden-title.png" ) ,
73- ( "Pagination/Pagination" , "pagination.png" ) ,
74- ( "Pagination/Stacked" , "pagination-stacked.png" ) ,
75- ( "Pagination/WithEllipsis" , "pagination-with-ellipsis.png" ) ,
76- ( "Panel/Panel" , "panel.png" ) ,
77- ( "Radios/Radios" , "radios.png" ) ,
78- ( "Radios/RadiosWithConditional" , "radios-with-conditional.png" ) ,
79- ( "Radios/RadiosWithError" , "radios-with-error.png" ) ,
80- ( "Select/Select" , "select.png" ) ,
81- ( "SummaryList/SummaryListWithActions" , "summary-list-with-actions.png" ) ,
82- ( "SummaryList/SummaryListWithCard" , "summary-list-with-card.png" ) ,
83- ( "SummaryList/SummaryListWithoutActions" , "summary-list-without-actions.png" ) ,
84- ( "PhaseBanner/PhaseBanner" , "phase-banner.png" ) ,
85- ( "Tabs/Tabs" , "tabs.png" ) ,
86- ( "Tag/DefaultTag" , "tag-default.png" ) ,
87- ( "Tag/TagWithClass" , "tag-with-class.png" ) ,
88- ( "TextArea/TextArea" , "textarea.png" ) ,
89- ( "TextInput/TextInput" , "text-input.png" ) ,
90- ( "TextInput/TextInputWithError" , "text-input-with-error.png" ) ,
91- ( "TextInput/TextInputWithPrefixAndSuffix" , "text-input-with-prefix-and-suffix.png" ) ,
92- ( "TextInput/TextInputWithModelBinding" , "text-input-with-modelbinding.png" ) ,
93- ( "WarningText/WarningText" , "warning-text.png" )
94- } ) ;
40+ await WriteScreenshots (
41+ new [ ]
42+ {
43+ ( "Accordion/AccordionWithSummarySections" , "accordion-with-summary-sections.png" ) ,
44+ ( "BackLink/BackLinkWithDefaultContent" , "back-link-with-default-content.png" ) ,
45+ ( "BackLink/BackLinkWithCustomContent" , "back-link-with-custom-content.png" ) ,
46+ ( "Breadcrumbs/Breadcrumbs" , "breadcrumbs.png" ) ,
47+ ( "Button/DefaultButton" , "button-default.png" ) ,
48+ ( "Button/SecondaryButton" , "button-secondary.png" ) ,
49+ ( "Button/StartButton" , "button-start.png" ) ,
50+ ( "Button/DisabledButton" , "button-disabled.png" ) ,
51+ ( "Checkboxes/Checkboxes" , "checkboxes.png" ) ,
52+ ( "Checkboxes/CheckboxesWithConditional" , "checkboxes-with-conditional.png" ) ,
53+ ( "Checkboxes/CheckboxesWithError" , "checkboxes-with-error.png" ) ,
54+ ( "Checkboxes/CheckboxesWithNone" , "checkboxes-with-none.png" ) ,
55+ ( "Checkboxes/CheckboxesWithoutFieldset" , "checkboxes-without-fieldset.png" ) ,
56+ ( "CharacterCount/CharacterCount" , "character-count.png" ) ,
57+ ( "DateInput/DateInput" , "date-input.png" ) ,
58+ ( "DateInput/DateInputWithCustomItemLabels" , "date-input-with-custom-labels.png" ) ,
59+ ( "DateInput/DateInputWithCustomItemValues" , "date-input-with-custom-values.png" ) ,
60+ ( "DateInput/DateInputWithError" , "date-input-with-error.png" ) ,
61+ ( "DateInput/DateInputWithFieldset" , "date-input-with-fieldset.png" ) ,
62+ ( "Details/Details" , "details.png" ) ,
63+ ( "Details/DetailsExpanded" , "details-expanded.png" ) ,
64+ ( "ErrorSummary/ErrorSummary" , "error-summary.png" ) ,
65+ ( "ErrorSummary/ErrorSummaryWithModelStateError" , "error-summary-with-modelstate-error.png" ) ,
66+ ( "ErrorSummary/ErrorSummaryWithTitle" , "error-summary-with-title.png" ) ,
67+ ( "FileUpload/FileUpload" , "file-upload.png" ) ,
68+ ( "FileUpload/FileUploadWithErrors" , "file-upload-with-errors.png" ) ,
69+ ( "InsetText/InsetText" , "inset-text.png" ) ,
70+ ( "NotificationBanner/NotificationBanner" , "notification-banner.png" ) ,
71+ ( "NotificationBanner/NotificationBannerSuccess" , "notification-banner-success.png" ) ,
72+ (
73+ "NotificationBanner/NotificationBannerWithOverridenTitle" ,
74+ "notification-banner-with-overriden-title.png"
75+ ) ,
76+ ( "Pagination/Pagination" , "pagination.png" ) ,
77+ ( "Pagination/Stacked" , "pagination-stacked.png" ) ,
78+ ( "Pagination/WithEllipsis" , "pagination-with-ellipsis.png" ) ,
79+ ( "Panel/Panel" , "panel.png" ) ,
80+ ( "Radios/Radios" , "radios.png" ) ,
81+ ( "Radios/RadiosWithConditional" , "radios-with-conditional.png" ) ,
82+ ( "Radios/RadiosWithError" , "radios-with-error.png" ) ,
83+ ( "Select/Select" , "select.png" ) ,
84+ ( "SummaryList/SummaryListWithActions" , "summary-list-with-actions.png" ) ,
85+ ( "SummaryList/SummaryListWithCard" , "summary-list-with-card.png" ) ,
86+ ( "SummaryList/SummaryListWithoutActions" , "summary-list-without-actions.png" ) ,
87+ ( "PhaseBanner/PhaseBanner" , "phase-banner.png" ) ,
88+ ( "Tabs/Tabs" , "tabs.png" ) ,
89+ ( "Tag/DefaultTag" , "tag-default.png" ) ,
90+ ( "Tag/TagWithClass" , "tag-with-class.png" ) ,
91+ ( "TextArea/TextArea" , "textarea.png" ) ,
92+ ( "TextInput/TextInput" , "text-input.png" ) ,
93+ ( "TextInput/TextInputWithError" , "text-input-with-error.png" ) ,
94+ ( "TextInput/TextInputWithPrefixAndSuffix" , "text-input-with-prefix-and-suffix.png" ) ,
95+ ( "TextInput/TextInputWithModelBinding" , "text-input-with-modelbinding.png" ) ,
96+ ( "WarningText/WarningText" , "warning-text.png" ) ,
97+ }
98+ ) ;
9599
96100 await browser . CloseAsync ( ) ;
97101 await host . StopAsync ( ) ;
@@ -136,7 +140,8 @@ async Task WriteScreenshot(string pagePath, string screenshotPath)
136140 {
137141 throw new ArgumentException (
138142 $ "Unsuccessful response ({ ( int ) response . Status } ) for '{ pagePath } '.",
139- nameof ( pagePath ) ) ;
143+ nameof ( pagePath )
144+ ) ;
140145 }
141146
142147 var container = await page . WaitForSelectorAsync ( "#container" ) ;
0 commit comments