@@ -34,13 +34,15 @@ const COMPLEX_ARABIC = COMPLEX_HEBREW + COMPLEX_HEBREW_COUNT;
3434const COMPLEX_ARABIC_COUNT = 1 ;
3535
3636const BASIC_MAX_DIFF = 50 ;
37- const LOOSE_MAX_DIFF = 75 ;
37+ const LOOSE_MAX_DIFF = 100 ;
3838
3939const OUTPUT_DIR = "temp/playwright" ;
40+
4041const LS_OPTIONS = {
4142 createDiffImage : true ,
42- strict : false ,
4343 ignoreAntialiasing : true ,
44+ tolerance : 10 ,
45+ antialiasingTolerance : 50 ,
4446} as const ;
4547
4648async 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
0 commit comments