Skip to content

Commit

Permalink
Document usage (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chekote authored Nov 19, 2017
1 parent 46933e5 commit 3ae9d95
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
60 changes: 56 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,62 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Chekote/BehatRetryExtension/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Chekote/BehatRetryExtension/?branch=master)
[![StyleCI](https://styleci.io/repos/110754153/shield?style=plastic)](https://styleci.io/repos/110754153)

# behat-then-spinner
# Behat Retry Extension
Automatically spin (retry) "Then" steps in Behat

## Development pre-requisites
## Usage

1. Add it to your requirements (typically dev only)

```bash
composer require --dev chekote/behat-retry-extension
```

2. Enable the extension:

```yaml
# behat.yml
default:
# ...
extensions:
Chekote\BehatRetryExtension
```
3. Optionally configure the extension
```yaml
# behat.yml
default:
# ...
extensions:
Chekote\BehatRetryExtension:
timeout: 10
interval: 1000000000
```
## Configuration Options
### Timeout
Type: Float
Default: 5
The timeout setting is the number of seconds that the extension should retry "Then" steps until they are considered a failure.
### Interval
Type: Integer
Default: 100000000 (0.1 seconds)
The interval is how many nanoseconds the extension will wait between attempts. The default is to attempt 10 times a second. Attempting the retry more frequently will potentially allow your tests to pass quicker, but this depends on your environment.
It is possible that attempting the assertion too frequently will put a load on your application in such a way that the tests actually take longer to run. You will need to experiment with your particular application to determine what setting is best for you.
## Development
### pre-requisites
Install [Docker](https://www.docker.com).
Expand All @@ -18,7 +70,7 @@ You will also want to ensure that `./bin` is in your `$PATH` and is the highest
export PATH=./bin:$PATH
```
## Setting up the project for development
### Setting up the project for development
Clone the repository:
Expand All @@ -33,7 +85,7 @@ Initialize the project:
init_project
```

## Tooling
### Tooling

The project includes a set of command line tools (such as php, etc) located in the bin folder. These can be run from anywhere on your machine and will execute as if they were the tools installed natively on your machine.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
final class RuntimeStepTester implements StepTester
{
/** Number of seconds to attempt "Then" steps before accepting a failure */
/** @var float Number of seconds to attempt "Then" steps before accepting a failure */
public static $timeout;

/** @var int number of nanoseconds to wait between each retry of "Then" steps */
Expand Down

0 comments on commit 3ae9d95

Please sign in to comment.