codeceptjs / codeceptjs/CodeceptJS

rightClick in WebDriver helper doesn't perform the action correctly in W3C mode

未关闭
#2,414 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
4.2k
派生
757
平均合并
2 天 9 小时
30 天内合并 PR
16

描述

https://github.com/codecept-js/CodeceptJS/blob/62fa771720e90223ef2ab7900a80cd3588c0a4b1/lib/helper/WebDriver.js#L914-L921

Some time ago the api for actions in W3C mode changed in webdriver.io and this helper function seems to be in the old format (pressKeys for example is in the new format).

As it is the function complains about type and id not being set.

I think it should be something like:
```
if (this.browser.isW3C) {
// W3C version
return this.browser.performActions([{
type: 'pointer',
id: 'rightClickMouse',
parameters: { pointerType: 'mouse' },
actions: [{ type: 'pointerDown', button: 2 }, { type: 'pointerUp', button: 2 }],
}
]);
}
```

But this doesn't seem to work with the el.moveTo anymore, I see the context menu appear in the top left corner of the browser, so I'm guessing the moveTo for the element probably has to be worked into the action array itself? Not to sure on this...

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。