@@ -8,7 +8,23 @@ const siteUrl = "http://localhost:3000"
8
8
const sitemapPath = "./build/sitemap.xml"
9
9
const stylesheetPath = "./tests/playwright-argos/screenshot.css"
10
10
const stylesheet = fs . readFileSync ( stylesheetPath ) . toString ( )
11
- const ignoredPathnames = [ "/docs/reference/api" ]
11
+ const ignoredPathnames = [
12
+ // Thes files are too large to screenshot
13
+ "/docs/reference/api" ,
14
+ "/docs/hydra/reference/api" ,
15
+ "/docs/kratos/reference/api" ,
16
+ "/docs/keto/reference/api" ,
17
+ "/docs/oathkeeper/reference/api" ,
18
+ // the configuration pages are lazily loaded and the screenshot is sometimes taken before they are loaded
19
+ "/docs/kratos/reference/configuration-editor" ,
20
+ "/docs/hydra/reference/configuration-editor" ,
21
+ "/docs/keto/reference/configuration-editor" ,
22
+ "/docs/oathkeeper/reference/configuration-editor" ,
23
+ "/docs/kratos/reference/configuration" ,
24
+ "/docs/hydra/reference/configuration" ,
25
+ "/docs/keto/reference/configuration" ,
26
+ "/docs/oathkeeper/reference/configuration" ,
27
+ ]
12
28
13
29
// Wait for hydration, requires Docusaurus v2.4.3+
14
30
// Docusaurus adds a <html data-has-hydrated="true"> once hydrated
@@ -29,12 +45,7 @@ function screenshotPathname(pathname: string) {
29
45
30
46
test . describe ( "Docusaurus site screenshots" , ( ) => {
31
47
const pathnames = extractSitemapPathnames ( sitemapPath )
32
-
33
- for ( const p of pathnames ) {
34
- if ( ignoredPathnames . includes ( p ) ) {
35
- console . log ( `Ignoring ${ p } ` )
36
- } else {
37
- screenshotPathname ( p )
38
- }
39
- }
48
+ pathnames
49
+ . filter ( ( p ) => ! ignoredPathnames . includes ( p ) )
50
+ . forEach ( screenshotPathname )
40
51
} )
0 commit comments