beforeCommand, afterCommand do not work when use async
See original GitHub issueHello,
I’m trying to use beforeCommand and afterCommand hooks in order to catch browser.url command. unfortunately, it does not work.
/**
* Runs before a WebdriverIO command gets executed.
* @param {String} commandName hook command name
* @param {Array} args arguments that command would receive
*/
beforeCommand: function (commandName, args) {
//something
},
/**
* Runs after a WebdriverIO command gets executed
* @param {String} commandName hook command name
* @param {Array} args arguments that command would receive
* @param {Number} result 0 - command success, 1 - command error
* @param {Object} error error object if any
*/
afterCommand: function (commandName, args, result, error) {
//something
},
Did I miss something ?
Thx
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
webdriverio/webdriverio - Gitter
To use the first you have to set the function name to async. ... start pause beforeCommand done 2001 pause afterCommand start pause...
Read more >jquery - how to get executed command name in beforeCommand or ...
Is there exist a way to figure out which command is fired in "beforecommand:Composer" event ? i.e : Editor.on("beforecommand:composer", function ...
Read more >Configuration File - WebdriverIO
The configuration file contains all necessary information to run your test suite. It's a NodeJS module that exports a JSON. Here is an...
Read more >JavaScript Async - W3Schools
Very often we will not need a reject function. Example without reject. async function myDisplay() { let myPromise = new Promise ...
Read more >Commands Ext — TwitchIO 2 2.0.0a documentation
Method which registers a command for use by the bot. Parameters ... By default if this is not supplied, the function name will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
working on a fix
@christian-bromann this is a regression since
5.16.11
and now standalone mode doesn’t work at all.