protractor icon indicating copy to clipboard operation
protractor copied to clipboard

I can't DragAndDrop

Open Luisangonzalez opened this issue 11 years ago • 3 comments

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

Luisangonzalez avatar Jun 19 '15 14:06 Luisangonzalez

Duplicate of https://github.com/angular/protractor/issues/583

sjelin avatar Jun 29 '15 17:06 sjelin

@sjelin closed this issue, but I have the same issue, would you like to tell me how to simulate dragAndDrop?

wangfeiv avatar Jul 01 '15 07:07 wangfeiv

They talk about work-arounds here

sjelin avatar Jul 01 '15 22:07 sjelin