diff --git a/package-lock.json b/package-lock.json index e24aef1249..6ee9b7c00d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "devDependencies": { "@argos-ci/cli": "^2.4.2", "@argos-ci/playwright": "^2.0.0", - "@playwright/test": "^1.42.1", + "@playwright/test": "^1.49.0", "@semantic-release/changelog": "^6.0.1", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "*", @@ -9786,17 +9786,19 @@ } }, "node_modules/@playwright/test": { - "version": "1.42.1", + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.49.0.tgz", + "integrity": "sha512-DMulbwQURa8rNIQrf94+jPJQ4FmOVdpE5ZppRNvWVjvhC+6sOeo28r8MgIpQRYouXRtt/FCCXU7zn20jnHR4Qw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.42.1" + "playwright": "1.49.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/@pnpm/config.env-replace": { @@ -57726,36 +57728,43 @@ } }, "node_modules/playwright": { - "version": "1.42.1", + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.0.tgz", + "integrity": "sha512-eKpmys0UFDnfNb3vfsf8Vx2LEOtflgRebl0Im2eQQnYMA4Aqd+Zw8bEOB+7ZKvN76901mRnqdsiOGKxzVTbi7A==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.42.1" + "playwright-core": "1.49.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.42.1", + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.0.tgz", + "integrity": "sha512-R+3KKTQF3npy5GTiKH/T+kdhoJfJojjHESR1YEWhYuEKRVfVaxH3+4+GvXE5xyCngCxhxnykk0Vlah9v8fs3jA==", "dev": true, "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/playwright/node_modules/fsevents": { "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, + "hasInstallScript": true, "license": "MIT", "optional": true, "os": [ diff --git a/package.json b/package.json index 7f07a61ff0..f029c06b93 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "devDependencies": { "@argos-ci/cli": "^2.4.2", "@argos-ci/playwright": "^2.0.0", - "@playwright/test": "^1.42.1", + "@playwright/test": "^1.49.0", "@semantic-release/changelog": "^6.0.1", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "latest", diff --git a/playwright.config.ts b/playwright.config.ts index 754d40d085..a9018ee82c 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,4 +1,5 @@ -import { PlaywrightTestConfig } from "@playwright/test"; +import { devices } from "@playwright/test"; +import type { PlaywrightTestConfig } from "@playwright/test"; const config: PlaywrightTestConfig = { snapshotDir: "screenshots/", @@ -20,6 +21,14 @@ const config: PlaywrightTestConfig = { url: "http://127.0.0.1:3000", reuseExistingServer: !process.env.CI, }, + projects: [ + { + name: "chromium", + use: { + ...devices["Desktop Chrome"], + }, + }, + ], }; export default config; diff --git a/visuals/exclude.json b/visuals/exclude.json index a177746202..170461a1dd 100644 --- a/visuals/exclude.json +++ b/visuals/exclude.json @@ -1 +1 @@ -["/integrations/"] +["/integrations/*", "/security-bulletins/reports/*"] diff --git a/visuals/screenshot.docs.spec.ts b/visuals/screenshot.docs.spec.ts index 5cd5f2d269..361247fd48 100644 --- a/visuals/screenshot.docs.spec.ts +++ b/visuals/screenshot.docs.spec.ts @@ -11,11 +11,22 @@ const stylesheet = fs.readFileSync(stylesheetPath).toString(); test.describe.configure({ mode: "parallel" }); function isVersionedDocsPathname(pathname: string, excludeList: string[]): boolean { - if (excludeList.some((excludedPath) => pathname === excludedPath || pathname.startsWith(excludedPath))) { - console.log(`Excluding ${pathname} because it matches or starts with an exclude list pattern`); + if ( + excludeList.some((excludedPath) => { + if (excludedPath.endsWith("/*")) { + // Let's remove the trailing "/*" to match sub-paths + const basePath = excludedPath.slice(0, -2); + // Exclude sub-paths only, not the index page + return pathname.startsWith(basePath) && pathname !== `${basePath}/`; + } + // This is an exact match + return pathname === excludedPath; + }) + ) { return false; } + // Additional exclusion criteria if (pathname.startsWith("/api/") || pathname.match(/\/\d+\.\d+\.x\//)) { return false; } @@ -23,11 +34,6 @@ function isVersionedDocsPathname(pathname: string, excludeList: string[]): boole return true; } -test.beforeAll(() => { - console.log("Excluded pages: ", excludeList); - console.log("Total pages: ", extractSitemapPathnames(sitemapPath).length); -}); - function screenshotPathname(pathname: string) { test(`pathname ${pathname}`, async ({ page }) => { console.log(`Taking screenshot of ${pathname}`);