Skip to content

Commit 561291b

Browse files
committed
preparing 0.6.3 release
1 parent fbc01c5 commit 561291b

File tree

6 files changed

+51
-7
lines changed

6 files changed

+51
-7
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ site
77
docs/build
88
test/data/output
99
test/acceptance/output
10-
examples/output
10+
examples/output
11+
test/data/app/db
12+
test/data/sandbox/steps.d.ts

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## 0.6.3
2+
3+
* Errors are printed in non-verbose mode. Shows "Selenium not started" and other important errors.
4+
* Allowed to set custom test options:
5+
6+
```js
7+
Scenario('My scenario', { build_id: 123, type: 'slow' }, function (I)
8+
```
9+
those options can be accessed as `opts` property inside a `test` object. Can be used in custom listeners.
10+
11+
* Added `docs` directory to a package.
12+
* [WebDriverIO][Protractor][SeleniumWebdriver] Bugfix: cleaning session when `restart: false` by @tfiwm [#519](https://github.com/Codeception/CodeceptJS/pull/519)
13+
* [WebDriverIO][Protractor][Nightmare] Added second parameter to `saveScreenshot` to allow a full page screenshot. By @HughZurname
14+
* Added suite object to `suite.before` and `suite.after` events by @implico. [#496](https://github.com/Codeception/CodeceptJS/pull/496)
15+
116
## 0.6.2
217

318
* Added `config` object to [public API](http://codecept.io/hooks/#api)

docs/hooks.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,31 @@ Available events:
190190

191191
For further reference look for [currently available listeners](https://github.com/Codeception/CodeceptJS/tree/master/lib/listener) using event system.
192192

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+
193218
### Recorder
194219

195220
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.

examples/absolutenet_test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22
Feature('Testing Begins');
33

4-
Scenario('ANI testing', function*(I){
4+
// test with some demo params
5+
Scenario('ANI testing', { id: 123, user_id: 1235 } ,function*(I){
56
I.amOnPage('http://www.absolutenet.com/');
67
let title = yield I.grabTitle();
78
// console.info(title);

lib/listener/helpers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const event = require('../event');
44
const container = require('../container');
55
const recorder = require('../recorder');
6-
const debug = require('../output').debug;
6+
const error = require('../output').error;
77

88
/**
99
* Enable Helpers to listen to test events
@@ -38,7 +38,7 @@ module.exports = function () {
3838

3939
event.dispatcher.on(event.test.started, function (test) {
4040
runHelpersHook('_test', test);
41-
recorder.catch((e) => debug(e));
41+
recorder.catch((e) => error(e));
4242
});
4343

4444
event.dispatcher.on(event.test.before, function () {
@@ -48,10 +48,10 @@ module.exports = function () {
4848
event.dispatcher.on(event.test.failed, function (test) {
4949
runAsyncHelpersHook('_failed', test, true);
5050
// should not fail test execution, so errors should be catched
51-
recorder.catch((e) => debug(e));
51+
recorder.catch((e) => error(e));
5252
});
5353

54-
event.dispatcher.on(event.test.after, function (test) {
54+
event.dispatcher.on(event.test.after, function () {
5555
runAsyncHelpersHook('_after', {}, true);
5656
});
5757

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeceptjs",
3-
"version": "0.6.2",
3+
"version": "0.6.3",
44
"description": "Modern Era Aceptance Testing Framework for NodeJS",
55
"homepage": "http://codecept.io",
66
"repository": "Codeception/codeceptjs",
@@ -15,6 +15,7 @@
1515
},
1616
"files": [
1717
"bin",
18+
"docs",
1819
"lib",
1920
"translations"
2021
],

0 commit comments

Comments
 (0)