Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/test_real_browsers.py::test_get_screenshot[chrome] FAILED #116

Open
dimaqq opened this issue Jan 28, 2021 · 2 comments
Open

tests/test_real_browsers.py::test_get_screenshot[chrome] FAILED #116

dimaqq opened this issue Jan 28, 2021 · 2 comments

Comments

@dimaqq
Copy link
Contributor

dimaqq commented Jan 28, 2021

session = <arsenic.session.Session object at 0x1058477c0>

    async def test_get_screenshot(session):
        await session.get("/screenshot/")
        rect = await session.wait_for_element(5, "#rect")
        screenshot = await session.get_screenshot()
        image = Image.open(screenshot)
        info = await rect.get_rect()
        rect_img = image.crop((info.x, info.y, info.x + info.height, info.y + info.width))
        colors = rect_img.getcolors()
        assert len(colors) == 1
        count, color = colors[0]
        assert count == int(info.width * info.height)
>       assert color == (254, 220, 186, 255)
E       assert (250, 221, 189, 255) == (254, 220, 186, 255)
E         At index 0 diff: 250 != 254
E         Full diff:
E         - (254, 220, 186, 255)
E         ?    ^    ^    ^
E         + (250, 221, 189, 255)
E         ?    ^    ^    ^

It's a small difference, but I wonder why?

(running in the newer-pillow branch, macos, big sur, ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761}) )

@ojii
Copy link
Contributor

ojii commented Jan 28, 2021

Is this on macos? I wonder if Apple's fancy TrueTone/NightShift actually affects the pixels in the screenshot taken. I would hope it doesn't, but who knows?

@ojii
Copy link
Contributor

ojii commented Jan 28, 2021

on my machine (macos) I also get FAILED tests/test_real_browsers.py::test_get_screenshot[chrome] - assert (249, 221, 190, 255) == (254, 220, 186, 255).

I'm inclined to blame this on Apple trying to be fancy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants