Open dentuzhik opened 9 years ago
Making it same instance is not very easy task as for now. However, I thought about making actions object extendable, maybe it will help you. What do you think about something like this (it won't work now, its just API proposal):
gemini.Actions.extend({
paste: function(input, value) {
this.sendKeys(...)
}
})
gemini.suite('foo', function(suite) {
suite
.setUrl('bar')
.setCaptureElement('.baz')
.capture('paste-text', function(actions, find) {
actions.paste('.baz__input', '123')
});
});
I like the idea of extendable actions, and for the purpose of the example provided they are more natural However I still think that it will be more convenient, if actions would be the same object, or at least currying in a way example does won't fail to perform an action.
If it's not possible to fix in the near future it should be at least outlined in docs, because it will cause obvious confusion when facing in the wild.
Btw, is there a clean way to do copy paste in webdriver/gemini, without using platform-dependent key-bindings and temporary dom elements?
Btw, is there a clean way to do copy paste in webdriver/gemini, without using platform-dependent key-bindings and temporary dom elements?
No, as far as I know, the only way to perform copy-paste is using sendKeys
.
No, as far as I know, the only way to perform copy-paste is using sendKeys.
What about adding some helpers for those purposes? it would be great! @dentuzhik Denis, what about PR with shortcuts? Could you do it?
@SevInf are you interested in helpers for copy, cut and paste? I can implement them, but only with assumption that ctrl
is used as modifier, unless there's a way to check a platform.
@dentuzhik, yes, send PR.
There is a way to check a platform:
browser.init
is actually resolved with a capabilities, sent by WebDriver
. Currently, the value is ignored but it has platform
field which has standard set of values for major OSes.
This makes currying of helpers, that depend on actions impossible.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.