English 中文(简体)
Playwright component screenshot sometimes fail due to different alignment
原标题:

I am doing visual screenshot testing at component/element/locator level and not full page. Test passes most of the time, but sometimes, in actual image the text is rendered few pixels below the expected image (see attachment). However, size of component still remains same as expected. Can i improve my settings to avoid this. My current settings are:

metadata: {
        deviceName:  iPhone 12 ,
    },
    use: {
        ...devices[ iPhone 12 ],
        launchOptions: {
            args: [
                 --font-render-hinting=none ,
                 --disable-skia-runtime-opts ,
                 --disable-font-subpixel-positioning ,
                 --disable-lcd-text ,
                 --force-color-profile=generic-rgb ,
                 --disable-gpu ,
                 --disable-translate ,
                 --disable-extensions ,
                 --disable-accelerated-2d-canvas ,
                 --force-device-scale-factor=1 ,
                 --js-flags=--random-seed=1157259157 ,
                 --disable-partial-raster ,
                 --use-gl=egl ,
            ],
        },
    },

Actual image:actual

Expected image:expected

Diff:diff

问题回答

暂无回答




相关问题
How do I set the page viewport size using Scrapy Playwight?

I didn t find any satisfactory answer about this. All I want is just set the viewport to 1080*19200 (yes, 1920 * 10) before the request to simulate a screen of that size. Is this even possible using ...

How to get test result in fixture

is it possible to get test result in Playwright fixture? See the sample code below, how to access test result(passed/failed/skipped) after await use(todoPage); in testFixture? It would help me decide ...

热门标签