global element api not working with element properties as argument
Description of the bug/issue
When ElementProperties is passed to global element() API as an argument, the command fails with the following error:
This is happening because of this line: https://github.com/nightwatchjs/nightwatch/blob/4b09cb57c8a9fb29d6b6795e59c64b4942bddf67/lib/api/_loaders/element-global.js#L90
Here, instead of a By instance, an Element instance is getting passed as locator.
Steps to reproduce
No response
Sample test
browser.navigateTo('https://www.bstackdemo.com/')
const elem = element({selector: '.shelf-item', index: 24});
await elem.getId();
Command to run
No response
Verbose Output
No response
Nightwatch Configuration
No response
Nightwatch.js Version
v3 beta1
Node Version
No response
Browser
No response
Operating System
No response
Additional Information
No response
I want to work on this issue.
Can i take this forward @garg3133
I think this issue should be closed ref: https://github.com/nightwatchjs/nightwatch/pull/3835#issuecomment-1812013588