Skip to content

Commit 0f7d580

Browse files
authored
chore: ignore more paths on argos & ignore videos (#1724)
1 parent c5599f3 commit 0f7d580

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

playwright-argos.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
import { devices } from "@playwright/test"
21
import type { PlaywrightTestConfig } from "@playwright/test"
2+
import { devices } from "@playwright/test"
33

44
const config: PlaywrightTestConfig = {
55
testDir: "./tests/playwright-argos",
66
webServer: {
77
port: 3000,
88
command: "npm run serve",
99
},
10+
11+
// Tests shouldn't fail. If they do something is wrong with the test or the site.
12+
maxFailures: 0,
13+
workers: 1,
14+
1015
projects: [
1116
{
1217
name: "chromium",

tests/playwright-argos/screenshot.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ img[src$='.gif'],
77
/* Algolia keyboard shortcuts appear with a little delay */
88
.DocSearch-Button-Keys > kbd,
99
/* The live playground preview can often display dates/counters */
10-
[class*='playgroundPreview'] {
10+
[class*='playgroundPreview'],
11+
video {
1112
visibility: hidden;
1213
}
1314

tests/playwright-argos/screenshot.spec.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,23 @@ const siteUrl = "http://localhost:3000"
88
const sitemapPath = "./build/sitemap.xml"
99
const stylesheetPath = "./tests/playwright-argos/screenshot.css"
1010
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+
]
1228

1329
// Wait for hydration, requires Docusaurus v2.4.3+
1430
// Docusaurus adds a <html data-has-hydrated="true"> once hydrated
@@ -29,12 +45,7 @@ function screenshotPathname(pathname: string) {
2945

3046
test.describe("Docusaurus site screenshots", () => {
3147
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)
4051
})

0 commit comments

Comments
 (0)