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 测试中的删除功能


基础教程推荐
- 如何在特定日期之前获取消息? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01