带有ContextMenu的赛普拉斯无法正常工作-React Contextify

时间:2018-07-17 16:32:30

标签: reactjs cypress

我正在使用一个名为React Contexty的库,它在Contextify内有一个菜单,当我确实要求它单击该菜单项时,它称为ContextMenu。 ContextMenu,它单击但未发生操作。

柏树:

cy.get("img[data-test=img--menu-candidate]")
  .click({
    force: true
  })

cy.get(".testinhoImg").click({
  force: true
})

我的MenuContext:

        <ContextMenu id={`menu-${this.props.candidate.id}`} animation={animation.fade} theme={theme.light}>
          <Item>
            <div style={{ width: '50px', marginLeft: '0.5em', marginRight: '0.5em' }}>
              <img src={ViewSrc} alt="View" />
            </div>
            <span className="ibm-plex-sans-serif-regular ibm-textcolor-blue-60"> View </span>
          </Item>

有人知道为什么吗?帮帮我吗?

HTML:

<div class="react-contexify react-contexify__theme--light react-contexify__will-enter--fade" style="left: 447px; top: 308px; opacity: 1;">
  <div>
    <div class="react-contexify__item" role="presentation">
      <div class="react-contexify__item__data">
        <div style="width: 50px; margin-left: 0.5em; margin-right: 0.5em;"><img src="/static/media/view.2844f64a.svg" alt="View"></div><span class="ibm-plex-sans-serif-regular ibm-textcolor-blue-60"> View </span></div>
    </div>
    <div class="react-contexify__separator"></div>
    <div class="react-contexify__item" role="presentation">
      <div class="react-contexify__item__data">
        <div style="width: 65px;"><img src="/static/media/move.f7f8dc44.svg" alt="Move to folder" style="margin-left: 0.5em; margin-right: 0.5em;"></div><span class="ibm-plex-sans-serif-regular ibm-textcolor-blue-60">Move to folder</span></div>
    </div>
    <div class="react-contexify__item" role="presentation">
      <div class="react-contexify__item__data">
        <div style="width: 50px; padding-right: 1em;"><img src="/static/media/email.330dcb30.svg" alt="Send Email" style="padding-right: 1em;"></div><span class="ibm-plex-sans-serif-regular ibm-textcolor-blue-60">Send Email</span></div>
    </div>
    <div class="react-contexify__item react-contexify__item--disabled" role="presentation">
      <div class="react-contexify__item__data">
        <div style="width: 65px;"><img src="/static/media/remove-folder.d620c9fb.svg" alt="Move to folder" style="margin-left: 0.5em; margin-right: 0.5em;"></div><span class="ibm-plex-sans-serif-regular ibm-textcolor-blue-60">Remove from folder</span></div>
    </div>
    <div class="react-contexify__item" role="presentation">
      <div class="react-contexify__item__data">
        <div style="width: 50px; margin-left: 0.5em; margin-right: 0.5em;"><img src="/static/media/delete.e899d653.svg" alt="Delete" style="padding-right: 1.2em;"></div><span class="ibm-plex-sans-serif-regular ibm-textcolor-blue-60">Delete</span></div>
    </div>
  </div>
</div>

0 个答案:

没有答案