Bug 232995

Summary: CSS hover does not trigger on click-command on iOS
Product: WebKit Reporter: sebastian.klaar
Component: WebDriverAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bburg, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: iPhone / iPad   
OS: iOS 14   

Description sebastian.klaar 2021-11-11 06:03:43 PST
When testing on iOS 13 and 14 in Safari using Appium, we launch a simple web page with some divs that have a hover effect. Clicking on the div should activate the hover effect on mobile devices. This happens when we exectue the click manually. But the command session/some_session_id/element/some_element_id/click does not trigger a hover effect. A simple html page for reproducing the behavior can be found below.

Issue was reported already 3 years ago: https://discuss.appium.io/t/invoke-hover-state-in-safari-ios/22853

Steps to reproduce the behavior:

<head>  
  <style>
    .test1 {
      display: flex;
      width: 200px;
      height: 50px;
      background-color: yellow;
    }

    .test2 {
      display: flex;
      width: 100px;
      height: 25px;
      background-color: red;
    }
    .test2:hover {
      background-color: green;
    }
    .test1:hover {
      background-color: blue;
      }

  </style>
</head>
<body>
  <div class="test1" onclick="void(0)">
    Test 1
    <div class="test2" id="test" onclick="void(0)">
      Test 2
    </div>
  </div>
</body>

Appium logs
2021-08-17 06:57:24:714 - [HTTP] --> POST /wd/hub/session/some_session_id/element/5000/click
2021-08-17 06:57:24:715 - [HTTP] {}
2021-08-17 06:57:24:715 - [debug] [MJSONWP (2cd46df3)] Calling AppiumDriver.click() with args: ["5000","2cd46df3-26e9-4f35-afd7-d2dce67967fe"]
2021-08-17 06:57:24:715 - [debug] [XCUITest] Executing command 'click'
2021-08-17 06:57:24:716 - [debug] [RemoteDebugger] Executing atom 'click' with 'args=[{"ELEMENT":":wdc:1629183444508"}]; frames='
2021-08-17 06:57:24:724 - [debug] [RemoteDebugger] Executing 'click' atom in default context
2021-08-17 06:57:24:724 - [debug] [RemoteDebugger] Sending javascript command: '(function(){return function(){var h,aa=this;fun...'
2021-08-17 06:57:24:725 - [debug] [RemoteDebugger] Sending '_rpc_forwardSocketData:' message to app 'PID:3360', page '1', target 'page-35' (id: 170): 'Runtime.evaluate'
2021-08-17 06:57:24:781 - [debug] [RemoteDebugger] Received data response from send (id: 170): '"{"status":0,"value":null}"'
2021-08-17 06:57:24:781 - [debug] [RemoteDebugger] Sending to Web Inspector took 57ms
2021-08-17 06:57:24:781 - [debug] [RemoteDebugger] Received result for atom 'click' execution: null
2021-08-17 06:57:24:782 - [debug] [MJSONWP (2cd46df3)] Responding to client with driver.click() result: null
2021-08-17 06:57:24:783 - [HTTP] <-- POST /wd/hub/session/some_session_id/element/5000/click 200 68 ms - 76
Comment 1 sebastian.klaar 2021-11-11 06:05:44 PST
Reference: https://feedbackassistant.apple.com/feedback/9522743
Comment 2 Sam Sneddon [:gsnedders] 2021-11-15 04:28:11 PST
rdar://82019343