webdriverio: Actions example does not work

There are some test cases where I have to emulate a mouseover action of the user. First I’ve used moveToObject() for this but it doesn’t seem to work correctly (e.g. a dropdown closes what should not happen until mouseleave) and it doesn’t seem to be supported by all browsers as I also read in another issue https://github.com/webdriverio/webdriverio/issues/2140

So I tried to go with the actions command instead. But I wasn’t able to emulate a mouseover with. Even the example in the docs doesn’t work (tested chrome & firefox).

My simple test always fails and throws an error: unimplemented command: session/873f30b97e472cb8dc655504648f3c93/actions

Isn’t the actions api supported yet although it’s in the docs?

Here’s my example test

var assert = require('chai').assert;
describe('Actions test :: ', function() {
    it('should succeed', function() {
        browser.url('https://www.google.com');
        browser.actions([{
            "type": "pointer",
            "id": "finger1",
            "parameters": {"pointerType": "touch"},
            "actions": [
                {"type": "pointerMove", "duration": 0, "x": 100, "y": 100},
                {"type": "pointerDown", "button": 0},
                {"type": "pause", "duration": 500},
                {"type": "pointerMove", "duration": 1000, "origin": "pointer", "x": -50, "y": 0},
                {"type": "pointerUp", "button": 0}
            ]
        }, {
            "type": "pointer",
            "id": "finger2",
            "parameters": {"pointerType": "touch"},
            "actions": [
                {"type": "pointerMove", "duration": 0, "x": 100, "y": 100},
                {"type": "pointerDown", "button": 0},
                {"type": "pause", "duration": 500},
                {"type": "pointerMove", "duration": 1000, "origin": "pointer", "x": 50, "y": 0},
                {"type": "pointerUp", "button": 0}
            ]
        }]);
        browser.actions();
        assert.equal(1, 1);
    });
});

Mac OSX 10.13.1 (High Sierra) node v8.6.0 chrome 62.0

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

@christian-bromann the problem with gitter is questions won’t get found as easy as in the issues (at least imo)

However I feel a bit lost regarding mouseover action in my tests because neither moveToObject nor the actions api seem to be the solution. For now I have to live with a workaround via the execute command. But I understand you can’t do much if the browser drivers haven’t implemented the necessary commands yet.

Would just be great if it was more clear in the docs if a specific command is not (fully) supported. Maybe I’ll make a PR once I’ve got a few minutes.