Skip to content

Screenshot size no match screen size. #9

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

Open
Apkawa opened this issue Apr 30, 2025 · 0 comments
Open

Screenshot size no match screen size. #9

Apkawa opened this issue Apr 30, 2025 · 0 comments

Comments

@Apkawa
Copy link
Owner

Apkawa commented Apr 30, 2025

Have issue in my project https://github.com/Apkawa/xlsx2html/blob/bf85665476f0f3f453a1115f5d9f6bf967730085/tests/test_files.py#L119

Locally is ok, on ci fail test

def test_screenshot_diff(temp_file, browser, screenshot_regression):
    browser.driver.set_window_size(1280, 1024)
    out_file = temp_file()
    xlsx2html(XLSX_FILE, out_file, locale="en")
    browser.visit("file://" + out_file)
    # Wait loading page
    from selenium.webdriver.support.wait import WebDriverWait

    WebDriverWait(browser, timeout=10).until(page_has_loaded)
    time.sleep(1)
    # Debug CI
    print("Window size", browser.driver.get_window_size())
    screenshot_file = temp_file(extension=".png")
    browser.driver.save_screenshot(screenshot_file)
    im = Image.open(screenshot_file)
    assert im.size == (1280, 1024)
    # End debug CI
    screenshot_regression()

I dunno can be fixed

SeleniumHQ/selenium#14660

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

1 participant