Dragging (panning the map) using the protractor

I am trying to automate the drag & drop action with Protractor / Selenium to check if the tile-based map works (leaflet library), but I cannot automate the drag & drop action (panning the map).

I loaded a map page like this one: http://tombatossals.imtqy.com/angular-leaflet-directive/examples/center-example.html

And this protractor test does not pan the map, the dragAndDrop action on the selected image does not work.

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'); }); }); 

What could be the reason that the dragAndDrop action is not applied with an example like this?

+6
source share
1 answer

This is a known issue with webdriver: https://code.google.com/p/selenium/issues/detail?id=3604

+2
source

All Articles