Closed Bug 1846740 Opened 1 year ago Closed 1 year ago

[wdspec] Some screenshot clip tests fail because of comparing float with integer values

Categories

(Remote Protocol :: WebDriver BiDi, defect, P1)

defect
Points:
1

Tracking

(firefox118 fixed)

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m8], [wptsync upstream])

Attachments

(1 file)

Currently some tests for browsingContext.screenshot with the clip argument fail because the compared values are floats and not integers. Affected tests are test_clip_viewport and test_clip_element.

Here the failure message:

FAIL message: assert (190, 23) == (190.6666717529297, 23)

Affected tests use the get_physical_element_dimensions() helper to retrieve the element dimension. While the documentation says it returns integers: Tuple of (int, int) it's not the fact.

https://searchfox.org/mozilla-central/rev/0816653c3ab851fa0e362eaec48c643fb764eaf4/testing/web-platform/tests/webdriver/tests/bidi/browsing_context/capture_screenshot/__init__.py#50-60

For us the failures started when the clipping tests have been added via bug 1840998.

Most likely we have to floor the value when comparing with the PNG dimensions.

Note it doesn't seem to be an issue in our own CI but on Github the test fails.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d86212d5deaf [wdspec] get_physical_element_dimensions has to return integer numbers and not float. r=webdriver-reviewers,jdescottes
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41335 for changes under testing/web-platform/tests
Priority: -- → P1
Whiteboard: [webdriver:m8]
Points: --- → 1
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Upstream PR was closed without merging
Whiteboard: [webdriver:m8] → [webdriver:m8], [wptsync upstream]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: