Skip to content

realSwipe - coordinate does not take cypress scaling (or zoom) into consideration  #640

Open
@amoshydra

Description

@amoshydra

Expected

Given swipe with length 200px, it should perform a swipe with 200px on the viewport regardless of browser's zoom or cypress scaling.

cy
  .get("body")
  .realSwipe("toRight", {
    length: 200,
  })

Current

In 100% zoom, realSwipe triggers a swipe with length 200px (expected)
In 50% zoom, realSwipe triggers a swipe with length ~400px (unexpected)

100% 50%
100-percent 50-ercent
99.98 --> 300.20 = distance 200.22 89.90 --> 504.04 = distance 414.14

Reproduce

Perform a swipe with 200px and observe the distance travelled in 100% zoom and 50% zoom.

Notice in the screenshots below, realSwipe 200px produces the same dots pattern in both 100% and 50%. A shorter dots pattern is expected in 50% zoom.

100% 50% diff
image image image
image image image

Reproduce repo: https://github.com/amoshydra/repro-dmtrKovalenko-cypress-real-events-i-swipes/tree/real-swipe-with-different-zoomed

Additional note

Possibility related to #10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions