Skip to content

Commit 949eb11

Browse files
committed
try looks-same options
1 parent fb8fd4f commit 949eb11

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default defineConfig({
1818
/* Fail the build on CI if you accidentally left test.only in the source code. */
1919
forbidOnly: !!process.env.CI,
2020
/* Retry on CI only */
21-
retries: process.env.CI ? 2 : 0,
21+
retries: process.env.CI ? 1 : 0,
2222
/* Maximum run time of one test */
2323
timeout: 120_000,
2424
/* Opt out of parallel tests on CI. */

tests/text-rendering.spec.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ const COMPLEX_ARABIC = COMPLEX_HEBREW + COMPLEX_HEBREW_COUNT;
3434
const COMPLEX_ARABIC_COUNT = 1;
3535

3636
const BASIC_MAX_DIFF = 50;
37-
const LOOSE_MAX_DIFF = 75;
37+
const LOOSE_MAX_DIFF = 100;
3838

3939
const OUTPUT_DIR = "temp/playwright";
40+
4041
const LS_OPTIONS = {
4142
createDiffImage: true,
42-
strict: false,
4343
ignoreAntialiasing: true,
44+
tolerance: 10,
45+
antialiasingTolerance: 50,
4446
} as const;
4547

4648
async function compareWrapping(page: Page, width: number) {
@@ -59,12 +61,9 @@ async function compareWrapping(page: Page, width: number) {
5961
const { equal, diffImage, differentPixels } = await looksSame(
6062
`${OUTPUT_DIR}/wrap-${width}-test${i}-html.png`,
6163
`${OUTPUT_DIR}/wrap-${width}-test${i}-canvas.png`,
62-
{
63-
createDiffImage: true,
64-
strict: false,
65-
}
64+
LS_OPTIONS
6665
);
67-
diffImage?.save(`${OUTPUT_DIR}/wrap-${width}-diff${i}.png`);
66+
diffImage?.save(`${OUTPUT_DIR}/wrap-${width}-test${i}-diff.png`);
6867

6968
if (differentPixels) {
7069
console.log(
@@ -96,7 +95,7 @@ async function compareLetterSpacing(page: Page, width: number) {
9695
`${OUTPUT_DIR}/spacing-${width}-test${i}-canvas.png`,
9796
LS_OPTIONS
9897
);
99-
diffImage?.save(`${OUTPUT_DIR}/spacing-${width}-diff${i}.png`);
98+
diffImage?.save(`${OUTPUT_DIR}/spacing-${width}-test${i}-diff.png`);
10099

101100
if (differentPixels) {
102101
console.log(
@@ -127,7 +126,7 @@ async function compareDetection(page: Page, width: number, start: number, count:
127126
`${OUTPUT_DIR}/detection-${width}-test${i}-canvas.png`,
128127
LS_OPTIONS
129128
);
130-
diffImage?.save(`${OUTPUT_DIR}/detection-${width}-diff${i}.png`);
129+
diffImage?.save(`${OUTPUT_DIR}/detection-${width}-test${i}-diff.png`);
131130

132131
if (differentPixels) {
133132
console.log(
@@ -158,7 +157,7 @@ async function compareComplex(page: Page, width: number, start: number, count: n
158157
`${OUTPUT_DIR}/complex-${width}-test${i}-canvas.png`,
159158
LS_OPTIONS
160159
);
161-
diffImage?.save(`${OUTPUT_DIR}/complex-${width}-diff${i}.png`);
160+
diffImage?.save(`${OUTPUT_DIR}/complex-${width}-test${i}-diff.png`);
162161

163162
if (differentPixels) {
164163
console.log(
@@ -193,8 +192,8 @@ test("wrap 840", async ({ page }) => {
193192
await compareWrapping(page, 840);
194193
});
195194

196-
test("wrap 700", async ({ page }) => {
197-
await compareWrapping(page, 700);
195+
test("wrap 620", async ({ page }) => {
196+
await compareWrapping(page, 620);
198197
});
199198

200199
// TODO: fix embedded RTL in LTR

tests/text-rendering/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async function demo() {
6262
);
6363
await renderText(
6464
TextTextureRenderer,
65-
"One first line of some rather long text.\nAnd another quite long line; maybe longer!"
65+
"One first line of rather long text.\nAnd another quite long line; maybe longer!"
6666
);
6767

6868
// styled rendering

0 commit comments

Comments
 (0)