Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and github-actions[bot] committed Nov 12, 2024
1 parent 5a2efd5 commit 15e039b
Showing 1 changed file with 37 additions and 23 deletions.
60 changes: 37 additions & 23 deletions _includes/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## DotReporter

[See Source](https://github.com/Codeception/Codeception/blob/main/ext/DotReporter.php)
[See Source](https://github.com/Codeception/Codeception/blob/5.1/ext/DotReporter.php)

DotReporter provides less verbose output for test execution.
Like PHPUnit printer it prints dots "." for successful tests and "F" for failures.
Like PHPUnit printer it prints dots "." for successful testes and "F" for failures.

![](https://cloud.githubusercontent.com/assets/220264/26132800/4d23f336-3aab-11e7-81ba-2896a4c623d2.png)

Expand Down Expand Up @@ -34,9 +34,11 @@ codecept run --ext DotReporter
Failures and Errors are printed by a standard Codeception reporter.
Use this extension as an example for building custom reporters.



## Logger

[See Source](https://github.com/Codeception/Codeception/blob/main/ext/Logger.php)
[See Source](https://github.com/Codeception/Codeception/blob/5.1/ext/Logger.php)

Log suites/tests/steps using Monolog library.
Monolog should be installed additionally by Composer.
Expand All @@ -60,18 +62,20 @@ extensions:
* `max_files` (default: 3) - how many log files to keep




## Recorder

[See Source](https://github.com/Codeception/Codeception/blob/main/ext/Recorder.php)
[See Source](https://github.com/Codeception/Codeception/blob/5.1/ext/Recorder.php)

Saves a screenshot of each step in acceptance tests and shows them as a slideshow on one HTML page (here's an [example](https://codeception.com/images/recorder.gif)).
Works only for suites with WebDriver module enabled.
Saves a screenshot of each step in acceptance tests and shows them as a slideshow on one HTML page (here's an [example](https://codeception.com/images/recorder.gif))
Activated only for suites with WebDriver module enabled.

The screenshots are saved to `tests/_output/record_*` directories, open `index.html` to see them as a slideshow.

#### Installation

Add this to the list of enabled extensions in `codeception.yml` or `Acceptance.suite.yml`:
Add this to the list of enabled extensions in `codeception.yml` or `acceptance.suite.yml`:

``` yaml
extensions:
Expand Down Expand Up @@ -102,23 +106,26 @@ extensions:
```
#### Skipping recording of steps with annotations

It is also possible to skip recording of steps for specified tests by using the `@skipRecording` annotation.
It is also possible to skip recording of steps for specified tests by using the @skipRecording annotation.

```php
/**
* @skipRecording login
* @skipRecording amOnUrl
*/
*\/
public function testLogin(AcceptanceTester $I)
{
$I->login();
$I->amOnUrl('https://codeception.com');
}
```




## RunBefore

[See Source](https://github.com/Codeception/Codeception/blob/main/ext/RunBefore.php)
[See Source](https://github.com/Codeception/Codeception/blob/5.1/ext/RunBefore.php)

Extension for execution of some processes before running tests.

Expand All @@ -143,13 +150,15 @@ extensions:
- dependent_process_2_2
```

HINT: You can use different configurations per environment.
HINT: you can use different configurations per environment.



## RunFailed

[See Source](https://github.com/Codeception/Codeception/blob/main/ext/RunFailed.php)
[See Source](https://github.com/Codeception/Codeception/blob/5.1/ext/RunFailed.php)

Saves failed tests into `tests/_output/failed` in order to rerun failed tests.
Saves failed tests into tests/_output/failed in order to rerun failed tests.

To rerun failed tests just run the `failed` group:

Expand All @@ -161,26 +170,30 @@ To change failed group name add:
```
--override "extensions: config: Codeception\Extension\RunFailed: fail-group: another_group1"
```
Remember: If you run tests and they generated custom-named fail group, to run this group, you should add override too.
Remember: if you run tests and they generated custom-named fail group, to run this group, you should add override too

**This extension is enabled by default**.
Starting from Codeception 2.1 **this extension is enabled by default**.

``` yaml
extensions:
enabled: [Codeception\Extension\RunFailed]
```

On each execution failed tests are logged and saved into `tests/_output/failed` file.



## RunProcess

[See Source](https://github.com/Codeception/Codeception/blob/main/ext/RunProcess.php)
[See Source](https://github.com/Codeception/Codeception/blob/5.1/ext/RunProcess.php)

Extension to start and stop processes per suite.
Can be used to start/stop chromedriver, MailCatcher, etc.
Can be used to start/stop selenium server, chromedriver, mailcatcher, etc.

Can be enabled in suite config:
Can be configured in suite config:

```yaml
# Acceptance.suite.yml
# acceptance.suite.yml
extensions:
enabled:
- Codeception\Extension\RunProcess:
Expand All @@ -190,7 +203,7 @@ extensions:
Multiple parameters can be passed as array:

```yaml
# Acceptance.suite.yml
# acceptance.suite.yml
extensions:
enabled:
Expand All @@ -201,7 +214,8 @@ extensions:

In the end of a suite all launched processes will be stopped.

To wait for the process to be launched, use the `sleep` option. In this case the configuration needs to be specified as object:
To wait for the process to be launched use `sleep` option.
In this case you need configuration to be specified as object:

```yaml
extensions:
Expand All @@ -212,13 +226,13 @@ extensions:
sleep: 5 # wait 5 seconds for processes to boot
```

HINT: You can use different configurations per environment.
HINT: you can use different configurations per environment.



## SimpleReporter

[See Source](https://github.com/Codeception/Codeception/blob/main/ext/SimpleReporter.php)
[See Source](https://github.com/Codeception/Codeception/blob/5.1/ext/SimpleReporter.php)

This extension demonstrates how you can implement console output of your own.
Recommended to be used for development purposes only.
Expand Down

0 comments on commit 15e039b

Please sign in to comment.