microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.74k stars 3.66k forks source link

[BUG]: Android events do not match native events #28748

Open Nantris opened 10 months ago

Nantris commented 10 months ago

System info

Source code

https://github.com/Nantris/PlaywrightBeforeInputTest

Steps

See README

Expected

Playwright's events match the native Android events in not sending event.keycode.

The should also match the native behavior of event.preventDefault() - for example deleteContentBackward is not actually preventable in Android Chrome (even though the spec says it should be) - but when run in Playwright the action can be prevented.

Actual

These behaviors don't match the native implementations and so tests can't be trusted to reflect real world results.

Keycode:

At minimum Enter/Space/Backspace are affected by this issue.

I've discovered that Playwright keydown and keyup send an event.code === 'Backspace' on Android, but the softkeys keyboard does not send that code.

Additionally, for Space - it sends a keycode of 32 and a code of Space - but the softkeys produce a keycode of 229 and no code

I strongly suspect these discrepancies are what's breaking many of our tests, because listeners meant for desktop are firing in our mobile app in a way they never would on a real device.

preventDefault: I've also found that event.preventDefault can prevent events which are not actually preventable in real world usage on Android. My hope is that this might be caused by the keycode issue. I do not currently have a repro for this component.


Originally discussed in #26796.

Nantris commented 10 months ago

Friendly bump. This issue has a repro repo linked.

Nantris commented 9 months ago

Friendly bump. I understand the holidays slow things down for everyone.

I put together a repro and I've been trying to get attention on this issue for almost two months now and would really appreciate any sort of reply.

Nantris commented 9 months ago

Friendly bump.

Nantris commented 9 months ago

@yury-s I'm sorry to ping you directly. Is there a reason this issue hasn't received any reply?

I understand open source ebbs and flows, but it seems like every other issue receives replies from the maintainers quite quickly, and this one has no replies after over a month despite having a repro linked. I've been struggling with this since August 2023 and first isolated the issue nearly two months ago but I received no reply on the original issue either.

Nantris commented 8 months ago

Bumping.

Nantris commented 7 months ago

Bump.

Nantris commented 7 months ago

image

Nantris commented 6 months ago

Is there anything I can do to help get this resolved?

As far as I can tell I've checked all the boxes and would really appreciate any update from the devs, even if it's just to say there's no interest in fixing this right now.

Nantris commented 5 months ago

Bump.

Nantris commented 2 months ago

Bump.

Nantris commented 2 months ago

@yury-s @aslushnikov

Nantris commented 1 month ago

Still present in 1.47.2.

Nantris commented 3 weeks ago

Every single week for years now this makes my life a pain :(

It would be nice if someone could reply even to tell me the Playwright team doesn't care about Android (which I guess they don't.)