How to test drag amp; drop functionality in AngularJS e2e testing(如何测试阻力amp;AngularJS e2e 测试中的删除功能)
问题描述
我正在尝试测试我的应用程序,我需要将小部件从一个位置移动到另一个位置,换句话说,我需要测试拖动 &在端到端测试中删除功能.
I am trying to test my application where I need to move a widget from one location to other, in other word I need to test drag & drop functionality in an end to end test.
我将如何测试这个?
推荐答案
我也遇到了同样的问题.我的解决方案是在此处遵循 Selenium 问题中的建议:https://code.google.com/p/selenium/issues/detail?id=3604#c20
I had this same issue. The solution for me was to follow the advice in the Selenium issue here: https://code.google.com/p/selenium/issues/detail?id=3604#c20
从@nilsK 的示例开始,这是我的解决方案:
Starting with the example from @nilsK, here was my solution:
var yourOffset = {x:5,y:5};
ptor().actions()
.mouseMove(yourElement,yourOffset)
.mouseDown()
.mouseMove(yourElement,{x:0,y:0}) // Initial move to trigger drag start
.mouseMove(youTarget[,targetOffset]) // [] optional
.mouseUp()
.perform();
我认为这也解决了这个问题
这篇关于如何测试阻力&AngularJS e2e 测试中的删除功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何测试阻力&AngularJS e2e 测试中的删除功能
基础教程推荐
- npm start 错误与 create-react-app 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
