addCommand
Add custom command to client/browser instance. Read more about addCommand
here.
Usage
1 | browser.addCommand(commandName,customMethod,overwrite); |
Parameters
Param | Type | Details |
---|---|---|
commandName | String | name of your custom command |
customMethod | Function | your custom method |
overwrite | Boolean | if set to true you can overwrite existing commands |
Example
1 | // adding `async` as function name disables the synchronous behavior of WebdriverIO commands |
1 | browser.addCommand("getUrlAndTitle", function (customVar) { |
1 | it('should use my custom command', function () { |