Automated tests 如何单击应在“上消失的元素”;touchmove";事件

Automated tests 如何单击应在“上消失的元素”;touchmove";事件,automated-tests,e2e-testing,testcafe,ui-testing,web-testing,Automated Tests,E2e Testing,Testcafe,Ui Testing,Web Testing,我正在为我们的web应用程序的移动版本编写一个测试用例,我不能单击设计为在“touchmove”事件中消失的弹出窗口。 有没有办法克服这个特殊的问题 平台信息: OS:Mac OS Mojave 10.14.13 TestCafe版本:1.0.1 Chrome版本:72.0.03626 TestCafebrowsersvalue:chrome:emulation:device=iphonex 当testcafe尝试执行单击时,弹出窗口消失。我尝试先将元素悬停,然后单击它,但这没有帮助 下面是处理

我正在为我们的web应用程序的移动版本编写一个测试用例,我不能单击设计为在“touchmove”事件中消失的弹出窗口。 有没有办法克服这个特殊的问题

平台信息:
OS:Mac OS Mojave 10.14.13
TestCafe版本:1.0.1
Chrome版本:72.0.03626
TestCafe
browsers
value:
chrome:emulation:device=iphonex

当testcafe尝试执行单击时,弹出窗口消失。我尝试先将元素悬停,然后单击它,但这没有帮助

下面是处理“touchmove”事件的React代码

  componentDidUpdate(prevProps) {
    if (!prevProps.undoRemove && this.props.undoRemove) {
      window.addEventListener('touchmove', this.props.onHideUndo)
    } else if (prevProps.undoRemove && !this.props.undoRemove) {
      window.removeEventListener('touchmove', this.props.onHideUndo)
    }
  }

  componentWillUnmount() {
    if (this.props.undoRemove) this.props.onHideUndo()
    window.removeEventListener('touchmove', this.props.onHideUndo)
  }
验证该行为的代码:

test('Undo Popup - Click on "Undo" button should return item back', async t => {
  const defItemCount = await page.itemCount;
  const rItemId = await page.getItemByIndex(1).info.sku.textContent;

  await page.removeItemByIndex(1);
  await t.expect(page.itemCount).notEql(defProdCount);
  await t.click(page.undoPopup.undoButton);
  await t.expect(page.itemCount).eql(defItemCount);
})
我希望在testcafe
单击操作时,我会单击该按钮,

拖动
操作时,它应该会像预期的那样消失。

据我所知,问题的原因是
触摸移动
事件,该事件迫使弹出窗口关闭。单击任何元素都不会引发
touchmove
事件,因此我在TestCafe存储库中创建了一个单独的。请跟踪查看进度

嗨,亚历克斯。谢谢。将观看您创建的问题。