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/configuration.md
+21-18Lines changed: 21 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,24 +9,27 @@ CodeceptJS configuration is set in `codecept.conf.js` file.
9
9
10
10
After running `codeceptjs init` it should be saved in test root.
11
11
12
-
Here is an overview of available options with their defaults:
13
-
14
-
***tests**: `"./*_test.js"` - pattern to locate tests. Allows to enter [glob pattern](https://github.com/isaacs/node-glob), Can either be a pattern to locate tests or an array of patterns to locate tests / test file names.
15
-
***grep**: - pattern to filter tests by name
16
-
***include**: `{}` - actors and page objects to be registered in DI container and included in tests. Accepts objects and module `require` paths
17
-
***timeout**: `10000` - default tests timeout
18
-
***output**: `"./output"` - where to store failure screenshots, etc
19
-
***helpers**: `{}` - list of enabled helpers
20
-
***mocha**: `{}` - mocha options, [reporters](https://codecept.io/reports/) can be configured here
21
-
***multiple**: `{}` - multiple options, see [Multiple Execution](https://codecept.io/parallel#multiple-browsers-execution)
22
-
***bootstrap**: `"./bootstrap.js"` - an option to run code _before_ tests are run. See [Hooks](https://codecept.io/hooks/#bootstrap-teardown)).
23
-
***bootstrapAll**: `"./bootstrap.js"` - an option to run code _before_ all test suites are run when using the run-multiple mode. See [Hooks](https://codecept.io/hooks/#bootstrap-teardown)).
24
-
***teardown**: - an option to run code _after_ all test suites are run when using the run-multiple mode. See [Hooks](https://codecept.io/hooks/#bootstrap-teardown).
25
-
***teardownAll**: - an option to run code _after_ tests are run. See [Hooks](https://codecept.io/hooks/#bootstrap-teardown).
26
-
***noGlobals**: `false` - disable registering global variables like `Actor`, `Helper`, `pause`, `within`, `DataTable`
27
-
***hooks**: - include custom listeners to plug into execution workflow. See [Custom Hooks](https://codecept.io/hooks/#custom-hooks)
28
-
***translation**: - [locale](https://codecept.io/translation/) to be used to print s teps output, as well as used in source code.
29
-
***require**: `[]` - array of module names to be required before codecept starts. See [Require](#require)
12
+
| Name | Type | Description |
13
+
| :------ | :------ | :------ |
14
+
|`bootstrap`|`Function`\|`boolean`\|`string`| Execute JS code before tests are run. https://codecept.io/bootstrap/ Can be either JS module file or async function: ```js bootstrap: async () => server.launch(), ``` or ```js bootstrap: 'bootstrap.js', ```|
15
+
|`bootstrapAll`|`Function`\|`boolean`\|`string`| Execute JS code before launching tests in parallel mode. https://codecept.io/bootstrap/#bootstrapall-teardownall|
|`include?`|`any`| Include page objects to access them via dependency injection ```js I: "./custom_steps.js", loginPage: "./pages/Login.js", User: "./pages/User.js", ``` Configured modules can be injected by name in a Scenario: ```js Scenario('test', { I, loginPage, User }) ```|
22
+
|`mocha?`|`any`|[Mocha test runner options](https://mochajs.org/#configuring-mocha-nodejs), additional [reporters](https://codecept.io/reports/#xml) can be configured here. Example: ```js mocha: { "mocha-junit-reporter": { stdout: "./output/console.log", options: { mochaFile: "./output/result.xml", attachments: true //add screenshot for a failed test } } } ```|
23
+
|`noGlobals?`|`boolean`| Disable registering global functions (Before, Scenario, etc). Not recommended |
24
+
|`output`|`string`| Where to store failure screenshots, artifacts, etc |
|`teardown`|`Function`\|`boolean`\|`string`| Execute JS code after tests are run. https://codecept.io/bootstrap/ Can be either JS module file or async function: ```js teardown: async () => server.stop(), ``` or ```js teardown: 'teardown.js', ```|
28
+
|`teardownAll`|`Function`\|`boolean`\|`string`| Execute JS code after finishing tests in parallel mode. https://codecept.io/bootstrap/#bootstrapall-teardownall|
29
+
|`tests`|`string`| Pattern to locate CodeceptJS tests. Allows to enter glob pattern or an Array<string> of patterns to match tests / test file names. For tests in JavaScript: ```js tests: 'tests/**.test.js' ``` For tests in TypeScript: ```js tests: 'tests/**.test.ts' ```|
30
+
|`timeout?`|`number`| Set default tests timeout in seconds. Tests will be killed on no response after timeout. ```js timeout: 20, ```|
31
+
|`translation?`|`string`| Enable localized test commands https://codecept.io/translation/|
0 commit comments