【问题标题】:Drag and drop (map panning) with protractor使用量角器拖放(地图平移)
【发布时间】:2014-10-09 05:42:15
【问题描述】:

我正在尝试使用 Protractor/Selenium 自动执行拖放操作,以检查基于图块(传单库)的地图是否正常工作,但我无法自动执行拖放操作(平移地图)。

我已经加载了一个带有地图的页面,如下所示: http://tombatossals.github.io/angular-leaflet-directive/examples/center-example.html

而且这个量角器测试没有平移地图,所选图像上的 dragAndDrop 操作似乎不起作用。

describe('Panning map', function() {    
    var ptor, driver;
    beforeEach(function() {        
        ptor = protractor.getInstance();
        browser.get('center-example.html');
        driver = ptor.driver;
    }, 30000);

    it('should update the center value if the map is dragged', function() {
        var el = element(by.xpath('.//img[contains(@class, "leaflet-tile-loaded")][1]'));
        browser.actions().dragAndDrop(el.find(), { x: 40, y: 40 }).perform();
        ptor.sleep(2000);
        expect(element(by.model("london.lat")).getAttribute("value")).toBe('51.505');
        expect(element(by.model("london.lng")).getAttribute("value")).toBe('-1.09');
    });
});

dragAndDrop 操作不适用于此类示例的原因是什么?

【问题讨论】:

标签: angularjs leaflet protractor


【解决方案1】:

这是一个已知的网络驱动程序问题:https://code.google.com/p/selenium/issues/detail?id=3604

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-11
    相关资源
    最近更新 更多