protractor
protractor copied to clipboard
I can't DragAndDrop
I have a issue, i can't dragAndDrop element.
This element is dragAndDrop by jquery in Angular Directive.
I try dragAndDrop for many ways:
describe('DragAndDrop ', function() {
beforeEach(function() {
browser.get(browser.baseUrl);
browser.waitForAngular();
});
it('test', function(){
//var coordenadas = placaUno.getLocation();
var buttonStart = element(by.binding('landing-main-button-start')).click();
var placas= element(by.buttonText('Placas')).click();
//OK
//var placaUno = element.all(by.repeater('board in boards')).get(1);
//img placa to drag and drop
var placaUnoCSS = element(by.css('#hwtoolbox > div > ul > li:nth-child(1) > div.submenu-level > div > div > div:nth-child(1) > img'));
//space with drop placa
var espacioPlaca = element(by.css('#boardSchema'));
//First way -- not found
//browser.actions().mouseDown(placaUnoCSS).mouseMove(placaUnoCSS,espacioPlaca).mouseUp().perform()
//Second way -- not found
browser.actions()
.dragAndDrop(placaUnoCSS, espacioPlaca)
.perform();
//Third way -- not found
/*
browser.actions().dragAndDrop(
browser.findElement(by.css('#hwtoolbox > div > ul > li:nth-child(1) > div.submenu-level > div > div > div:nth-child(1) > img')),
browser.findElement(by.css('#protoboard-canvas'))).perform();
*/
browser.pause();
});
afterEach(function(){
});
});
Is necesary call a native Jquery event in test?.
Moreover debug step by step, elements are present, click is OK, mouseDown is ok... DragAndDrope sentecence is ok but not drag and drop on website.
I wait the solutions, thanks for your time ;)
Duplicate of https://github.com/angular/protractor/issues/583
@sjelin closed this issue, but I have the same issue, would you like to tell me how to simulate dragAndDrop?
They talk about work-arounds here