|
| 1 | +# Official Extensions |
| 2 | + |
| 3 | +## Codeception\Extension\Logger |
| 4 | + |
| 5 | +Log suites/tests/steps using Monolog library. |
| 6 | +Monolog should be installed additionally by Composer. |
| 7 | + |
| 8 | +``` |
| 9 | +composer require monolog/monolog |
| 10 | +``` |
| 11 | + |
| 12 | +Steps are logged into `tests/_output/codeception.log` |
| 13 | + |
| 14 | +To enable this module add to your `codeception.yml`: |
| 15 | + |
| 16 | +``` yaml |
| 17 | +extensions: |
| 18 | + enabled: [Codeception\Extension\Logger] |
| 19 | +``` |
| 20 | +
|
| 21 | +#### Config |
| 22 | +
|
| 23 | +* `max_files` (default: 3) - how many log files to keep |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +## Codeception\Extension\Recorder |
| 29 | + |
| 30 | +Saves screenshots of each step in acceptance tests and shows them as a slideshow. |
| 31 | +Activated only for suites with WebDriver module enabled. |
| 32 | + |
| 33 | +  |
| 34 | + |
| 35 | +Slideshows saves are saved into `tests/_output/record_*` directories. |
| 36 | +Open `index.html` to see the slideshow. |
| 37 | + |
| 38 | +#### Installation |
| 39 | + |
| 40 | +Add to list of enabled extensions |
| 41 | + |
| 42 | +``` yaml |
| 43 | +extensions: |
| 44 | + enabled: [Codeception\Extension\Recorder] |
| 45 | +``` |
| 46 | + |
| 47 | +#### Configuration |
| 48 | + |
| 49 | +* `delete_successful` (default: true) - delete records for successfully passed tests (log only failed and errored) |
| 50 | +* `module` (default: WebDriver) - which module for screenshots to use. Module should implement `Codeception\Lib\Interfaces\ScreenshotSaver` interaface. Currently only WebDriver or any its children can be used. |
| 51 | + |
| 52 | +``` yaml |
| 53 | +extensions: |
| 54 | + config: |
| 55 | + Codeception\Extension\Recorder: |
| 56 | + delete_successful: false |
| 57 | +``` |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +## Codeception\Extension\RunFailed |
| 63 | + |
| 64 | +Saves failed tests into tests/log/failed in order to rerun failed tests. |
| 65 | + |
| 66 | +To rerun failed tests just run the `failed` group: |
| 67 | + |
| 68 | +``` |
| 69 | +php codecept run -g failed |
| 70 | +``` |
| 71 | + |
| 72 | +Starting from Codeception 2.1 **this extension is enabled by default**. |
| 73 | + |
| 74 | +``` yaml |
| 75 | +extensions: |
| 76 | + enabled: [Codeception\Extension\RunFailed] |
| 77 | +``` |
| 78 | + |
| 79 | +On each execution failed tests are logged and saved into `tests/_output/failed` file. |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +## Codeception\Extension\SimpleOutput |
| 84 | + |
| 85 | +This extension demonstrates how you can implement console output of your own. |
| 86 | +Recommended to be used for development purposes only. |
| 87 | + |
| 88 | + |
| 89 | + |
0 commit comments