Angularjs   发布时间:2022-04-20  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了angularjs – 使用量角器拖放(地图平移)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用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 – 使用量角器拖放(地图平移)全部内容,希望文章能够帮你解决angularjs – 使用量角器拖放(地图平移)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。