Skip to content

how to handle screenshot assertion of div out of the current viewport? #51

@andreabisello

Description

@andreabisello

Hi,

when i use needle to capture screenshot under the current viewport, screenshot becomes black.

passport-target-question

for example, if my browser has 1000px of height but the page is scrollable because its body has a height of 2000px, and my target id is in the page, but out of the area the browser can see, the screenshot becomes black.

i attached two screenshot. the test is the same, but i put a time.sleep(10) that permits to me to scroll down in the page obtaining a screenshot

passport-target-question

how should i handle this situation?

should i implement a "if not visible scroll browser to makes the div visible" ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions