You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/hooks.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,6 +190,31 @@ Available events:
190
190
191
191
For further reference look for [currently available listeners](https://github.com/Codeception/CodeceptJS/tree/master/lib/listener) using event system.
192
192
193
+
#### Test Object
194
+
195
+
Test events provide a test object with following fields:
196
+
197
+
*`title` title of a test
198
+
*`body` test function as a string
199
+
*`opts` additional test options like retries, and others
200
+
*`pending` true if test is scheduled for execution and false if a test has finished
201
+
*`file` path to a file with a test.
202
+
*`steps` array of executed steps (available only in `test.passed` or `test.failed` event)
203
+
204
+
and others
205
+
206
+
#### Step Object
207
+
208
+
Step events provide step objects with following fields:
209
+
210
+
*`name` name of a step, like 'see', 'click', and others
211
+
*`actor` current actor, in most cases it `I`
212
+
*`helper` current helper instance used to execute this step
213
+
*`helperMethod` corresponding helper method, in most cases is the same as `name`
214
+
*`status` status of a step (passed or failed)
215
+
*`prefix` if a step is executed inside `within` block contain within text, like: 'Within .js-signup-form'.
216
+
*`args` passed arguments
217
+
193
218
### Recorder
194
219
195
220
To inject asynchronous functions in a test or before/after a test you can subscribe to corresponding event and register a function inside a recorder object. [Recorder](https://github.com/Codeception/CodeceptJS/blob/master/lib/recorder.js) represents a global promises chain.
0 commit comments