拖放用量角器在dthmlx组件用量、拖放、组件、dthmlx

2023-09-13 03:57:08 作者:时光凉透初时模样

我使用具有角DHTMLX调度器组件。 DHTMLX调度你可以在时间线视图的现场演示活动拖放

I am using dhtmlx scheduler component with angular. Dhtmlx scheduler You can find drag and drop of events in live demo of Timeline view.

我需要作家量角器测试案例吧。我怎么能执行拖放使用量角器DHTMLX组件的下降?

I need to writer protractor test case for it. How can I perform drag and drop of dhtmlx component using protractor?

推荐答案

在DHTMLX调度页面上提供的演示没有使用棱角分明。我发现其他合适的演示页面,我将作为一个例子使用。

The demos available on the Dhtmlx scheduler page don't use angular. I've found another suitable demo page which I would use as an example.

的总体思路是pretty简单 - 使用 dragAndDrop()功能。遗憾的是它不记录在 API文档页面。可能这是因为它是从we​​bdriverjs和量角器来有什么用它做。总之,目前,你可以在这里找到一些资料和样品:

The general idea is pretty simple - use dragAndDrop() function. Unfortunately it is not documented on the API documentation page. May be this is because it is coming from webdriverjs and protractor has nothing to do with it. Anyway, currently, you can find some information and samples here:

如何做拖和量角器降? actions_spec.js How测试拖放放大器;在AngularJS端到端测试拖放功能 How to do drag and drop in protractor? actions_spec.js How to test drag & drop functionality in AngularJS e2e testing

基本上,你可以通过 X移动元素或偏移到左或右,或顶部或底部;或者,你可以移动到另一个元素。

Basically you can either move an element by x or y offset to the left or right or top or bottom; or, you can move to an another element.

下面是(移动任务#1 1000向右)的例子:

Here's an example (moving Task #1 by 1000 to the right):

describe("Sample test", function () {
    beforeEach(function () {
        browser.get("http://dhtmlx.github.io/angular-gantt-demo/");
        browser.waitForAngular();
    });

    it("should move the task", function () {
        var task = element(by.xpath('//div[@class="gantt_bars_area"]//div[@task_id="2"]'));

        browser.actions().dragAndDrop(
            task,
            {x:1000, y:0}
        ).perform();

        browser.sleep(10000);
    });
});

另外,您也可以手动链鼠标按下()的mouseMove() mouseUp事件()的行动,例如:

How模拟拖和量角器降行动? 拖放放大器;通过中继器与量角器下降 How to simulate a drag and drop action in protractor? Drag & Drop with Protractor by Repeater