Closed Bug 1841008 Opened 10 months ago Closed 5 months ago

Details property is not set correctly for triple clicks

Categories

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

Firefox 116
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1864614

People

(Reporter: alexrudenko, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Steps to reproduce:

The issue was spotted when running Puppeteer tests with Firefox BiDi. TLDR; the following Puppeteer call triggers a triple click over BiDi: await page.click('textarea', {count: 3});

The test expects that three click events are dispatched and the detail property on each click event indicates the click count:

    expect(
      await page.evaluate(() => {
        return window.clicks;
      })
    ).toMatchObject({0: 1, 1: 2, 2: 3});

The complete test is here https://github.com/puppeteer/puppeteer/blob/main/test/src/click.spec.ts#L144

To run it, checkout Puppeteer, add '.only' to the it statement on the test and run the following steps:

npm ci
npm run clean # optional if you have a very old build
npm run build
PUPPETEER_PRODUCT=firefox npm ci
npm run test:firefox:bidi -- --no-coverage

Actual results:

  1. Page.click
    should select the text by triple clicking:
    Error: expect(received).toMatchObject(expected)

Expected: {"0": 1, "1": 2, "2": 3}
Received: [1, 1, 1]
at Context.<anonymous> (/Users/alexrudenko/src/puppeteer/test/src/click.spec.ts:163:7)
at processTicksAndRejections (node:internal/process/task_queues:95:5)

Expected results:

The test should pass.

Component: Untriaged → WebDriver BiDi
Product: Firefox → Remote Protocol
OS: Unspecified → macOS
Hardware: Unspecified → ARM64
OS: macOS → Unspecified
Hardware: ARM64 → Unspecified
Summary: [WebDriver BiDi] details property is not set correctly for triple clicks → Details property is not set correctly for triple clicks

The following is the BiDi command sent by Puppeteer:

{
  "id": 19,
  "method": "input.performActions",
  "params": {
    "context": "f7a4056f-7b61-4051-8d82-0b0d7ec6ba1c",
    "actions": [
      {
        "type": "pointer",
        "id": "__puppeteer_mouse",
        "actions": [
          {
            "type": "pointerMove",
            "x": 0,
            "y": 0,
            "origin": {
              "type": "element",
              "element": {
                "type": "node",
                "handle": "e04df329-13cb-46fa-b901-0663a6df749c",
                "sharedId": "f69a1d8e-7afd-4ee0-a7cc-65e331d99216",
                "value": {
                  "nodeType": 1,
                  "localName": "textarea",
                  "namespaceURI": "http://www.w3.org/1999/xhtml",
                  "childNodeCount": 0,
                  "attributes": {},
                  "shadowRoot": null
                }
              }
            }
          },
          { "type": "pointerDown", "button": 0 },
          { "type": "pointerUp", "button": 0 },
          { "type": "pointerDown", "button": 0 },
          { "type": "pointerUp", "button": 0 },
          { "type": "pointerDown", "button": 0 },
          { "type": "pointerUp", "button": 0 }
        ]
      }
    ]
  }
}

A similar issue seems to be happening with double clicks: the dblclick event is not being emitted. It might be the same root cause or perhaps a separate issue.

I run the test and I can see the test failing with BiDi and passing with CDP. Maybe it's related to bug 1795327 and we have a general issue with triple clicks. I didn't investigate further yet, but mind find some time next week.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Note that it also doesn't help to add additional pauses between the individual actions. The whole paragraph is not getting selected.

Summary: Details property is not set correctly for triple clicks → Interacting with elements via "input.performActions" in a background tab doesn't work correctly

I didn't expect to change the summary.

Summary: Interacting with elements via "input.performActions" in a background tab doesn't work correctly → Details property is not set correctly for triple clicks
Priority: -- → P3
See Also: → parent-actions

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(hskupin)
Severity: -- → S3
Flags: needinfo?(hskupin)
Status: NEW → RESOLVED
Closed: 5 months ago
Duplicate of bug: 1864614
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.