andywer / drag-mock

Trigger HTML5 drag & drop events for testing
MIT License
35 stars 11 forks source link

Can't get it to work with webdriver.io #6

Open sunyatasattva opened 8 years ago

sunyatasattva commented 8 years ago

I am trying to make your mock work with webdriver.io, here is my minimal test case:

var dragMock = require('drag-mock');
var webdriverio = require('webdriverio');
var options = {
    desiredCapabilities: {
        browserName: 'firefox'
    }
};

var webdriver = webdriverio.remote(options).init();

// set up webdriver.dragStart(), webdriver.dragOver(), webdriver.dragLeave() and webdriver.drop()
dragMock.extendWebdriver(webdriver);

// load the drag-mock library into the browser context
dragMock.loadLibrary(webdriver);

webdriver
    .url('http://html5demos.com/drag')
    .waitForVisible('#one', 2000)
    .dragStart('#one')
    .delay(250)
    .drop('#bin', function(error) {
        if (error) {
          console.error(error);
        }
    });

I get an error as the async function doesn't return anything. Any pointers?

andywer commented 8 years ago

Hey! I cannot give you a solution out-of-the-box. But maybe you can provide the exact error?