加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 使用量角器拖放(地图平移)

发布时间:2020-12-17 08:47:08 所属栏目:安全 来源:网络整理
导读:我正在尝试使用Protractor / Selenium自动执行拖放操作,以检查基于图块(传单库)的地图是否正常工作,但我无法自动执行拖放操作(平移地图). 我已经加载了一个包含地图的页面,如下所示: http://tombatossals.github.io/angular-leaflet-directive/examples/cen
我正在尝试使用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操作不适用于这样的例子的原因?

这是一个已知的webdriver问题: https://code.google.com/p/selenium/issues/detail?id=3604

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读