Skip to content

Commit

Permalink
Tweak config to allow for higher tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
sabberworm committed Nov 19, 2024
1 parent fc1692e commit e7faec7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ aem {

inputs.dir("src/test/playwright")
inputs.file("configs/playwright.config.ts")
outputs.dir(project.layout.buildDirectory.dir(name))
outputs.dir(project.layout.buildDirectory.dir("reports/$name"))
}

Expand Down
11 changes: 9 additions & 2 deletions configs/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { devices, PlaywrightTestConfig } from '@playwright/test';
import { getPort } from 'get-port-please';

const outputDir = '../build/reports/playwright';
const outputDir = '../build/playwright';

async function loadConfig(): Promise<PlaywrightTestConfig> {
const port = await getPort({ random: true });
Expand All @@ -21,7 +21,7 @@ async function loadConfig(): Promise<PlaywrightTestConfig> {
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['html', { open: 'never', outputFolder: outputDir }],
['html', { open: 'never', outputFolder: '../build/reports/playwright' }],
['junit', { outputFile: `${outputDir}/TEST-playwright.xml` }],
],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
Expand All @@ -43,6 +43,13 @@ async function loadConfig(): Promise<PlaywrightTestConfig> {
},
],

expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0.05,
maxDiffPixels: 10,
}
},

/* Run your local dev server before starting the tests */
webServer: {
command: `npm run watch:serve -- --listen=${port}`,
Expand Down

0 comments on commit e7faec7

Please sign in to comment.