【问题标题】:hover on svg in cypress and test tooltip将鼠标悬停在 cypress 中的 svg 上并测试工具提示
【发布时间】:2020-06-03 03:05:17
【问题描述】:

场景:

我也有类似的

<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <!-- Using g to inherit presentation attributes -->
  <g fill="white" stroke="green" stroke-width="5">
    <circle cx="40" cy="40" r="25" />
    <circle cx="60" cy="60" r="25" />
  </g>
</svg>

悬停在svg上会显示一个tooltip,我需要测试是否显示tooltip,内容是否正确。

有什么建议吗?尝试了不工作的触发器(鼠标悬停)

【问题讨论】:

    标签: automation cypress


    【解决方案1】:
    cy.get(svg).trigger('focus')
    

    为我工作

    【讨论】:

      猜你喜欢
      • 2015-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-08
      • 2023-02-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多