catchpoint / WebPageTest.agent

Cross-platform WebPageTest agent
Other
210 stars 138 forks source link

Add trusted mouseClick command to WPT #654

Open MaryamHuntsperger opened 3 months ago

MaryamHuntsperger commented 3 months ago

Existing click and clickAndWait WPT commands are JavaScript initiated events which are synthetic. Hence "Trusted" flag for JS events is set to false. Such events get ignored by EventTiming API (https://www.w3.org/TR/event-timing/). This problem was issued https://github.com/catchpoint/WebPageTest/issues/3048

image

Moreover, WPT click command does not support right and double click; mentioned in https://github.com/catchpoint/WebPageTest/issues/3049 .

We have created a new mouseClick command with the following format which supports left, right and double click: mouseClick [tab] Id| selector [tab] left|right|double

The new command uses Devtools Protocol (https://chromedevtools.github.io/devtools-protocol/tot/Input/) input domain to dispatch Trusted mousepressed and mousereleased events.

image
arthesh commented 3 months ago

Tagging @mjkozicki , @claud-io , would appreciate if you could review this PR and provide feedback. This should be a useful command to run true interactivity tests with Event timing metrics.

MaryamHuntsperger commented 3 months ago

@pmeenan / @vibaldem FYI, this PR is for https://github.com/catchpoint/WebPageTest/issues/3048 and https://github.com/catchpoint/WebPageTest/issues/3049 .

MaryamHuntsperger commented 3 months ago

@pmeenan, please take a look.