Skip to content

Update extensions.md: Fixing links to sourcecodes #874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 23 additions & 37 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/5.1/ext/DotReporter.php)
[See Source](https://github.com/Codeception/Codeception/blob/main/ext/DotReporter.php)

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

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

Expand Down Expand Up @@ -34,11 +34,9 @@ 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/5.1/ext/Logger.php)
[See Source](https://github.com/Codeception/Codeception/blob/main/ext/Logger.php)

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




## Recorder

[See Source](https://github.com/Codeception/Codeception/blob/5.1/ext/Recorder.php)
[See Source](https://github.com/Codeception/Codeception/blob/main/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))
Activated 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)).
Works 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 @@ -106,26 +102,23 @@ 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/5.1/ext/RunBefore.php)
[See Source](https://github.com/Codeception/Codeception/blob/main/ext/RunBefore.php)

Extension for execution of some processes before running tests.

Expand All @@ -150,15 +143,13 @@ 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/5.1/ext/RunFailed.php)
[See Source](https://github.com/Codeception/Codeception/blob/main/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 @@ -170,30 +161,26 @@ 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.

Starting from Codeception 2.1 **this extension is enabled by default**.
**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/5.1/ext/RunProcess.php)
[See Source](https://github.com/Codeception/Codeception/blob/main/ext/RunProcess.php)

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

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

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

```yaml
# acceptance.suite.yml
# Acceptance.suite.yml

extensions:
enabled:
Expand All @@ -214,8 +201,7 @@ extensions:

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

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

```yaml
extensions:
Expand All @@ -226,13 +212,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/5.1/ext/SimpleReporter.php)
[See Source](https://github.com/Codeception/Codeception/blob/main/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