v8.24.0
v8.24.0 (2023-11-23)
🚀 New Feature
wdio-browser-runner,wdio-cli,wdio-config,wdio-globals,wdio-jasmine-framework,wdio-reporter,wdio-runner,wdio-smoke-test-cjs-service,wdio-smoke-test-reporter,wdio-smoke-test-service,wdio-types-
#11714 (@wdio/runner): support assertion hooks (@christian-bromann)
Given you have the following hooks in yourwdio.conf.js:beforeAssertion: (params) => { console.log('beforeAssertion', params) }, afterAssertion: (params) => { console.log('afterAssertion', params) }
and in your tests you have an assertion like this:
await expect(browser).toHaveTitle('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js | WebdriverIO')
Then it will log the following data:
[0-0] beforeAssertion { [0-0] matcherName: 'toHaveTitle', [0-0] expectedValue: 'WebdriverIO · Next-gen browser and mobile automation test framework for Node.js | WebdriverIO', [0-0] options: { [0-0] wait: 5000, [0-0] interval: 500, [0-0] beforeAssertion: [AsyncFunction: beforeAssertion], [0-0] afterAssertion: [AsyncFunction: afterAssertion] [0-0] } [0-0] } [0-0] afterAssertion { [0-0] matcherName: 'toHaveTitle', [0-0] expectedValue: 'WebdriverIO · Next-gen browser and mobile automation test framework for Node.js | WebdriverIO', [0-0] options: { [0-0] wait: 5000, [0-0] interval: 500, [0-0] beforeAssertion: [AsyncFunction: beforeAssertion], [0-0] afterAssertion: [AsyncFunction: afterAssertion] [0-0] }, [0-0] result: { pass: true, message: [Function: message] } [0-0] }
-
Committers: 1
- Christian Bromann (@christian-bromann)