<commit_before># Storyplayer

Bring your user and service stories to life through your tests.

## If Installed System-Wide ...

### Installation

Storyplayer should be installed via [Composer](http://getcomposer.org/). To install Storyplayer, create a `composer.json` file with the following contents:

```json
{
    "require": {
        "datasift/storyplayer": "1.3.3"
    }
}
```

Then, run `composer install`. Once that's completed, run `./vendor/bin/storyplayer install` to install any additional dependencies.

### Usage

Create a default Storyplayer config file:

```bash
mkdir ./etc && echo '{"environments":{}}' > ./etc/storyplayer.json
```

If your tests need a web browser, make sure you've started browsermob-proxy and selenium:

```
./vendor/bin/browsermob-proxy.sh start
./vendor/bin/selenium-server.sh start
```

Basic usage is:

```
./vendor/bin/storyplayer <environment> <story>
```

where:

* `<environment>` is the name of the environment that you want to run your story against
* `<story>` is the path to the PHP file containing your story and its test

## Running It Out Of A Git Clone

See [installing Storyplayer](http://datasift.github.io/storyplayer/installation.html).

### Building The Dependencies

If you want to run storyplayer from inside its own git repo, make sure that you have [Phix](http://phix-project.org) installed, and then do the following:

```
phing build-vendor<commit_msg>Environment arg is now optional<commit_after># Storyplayer

Bring your user and service stories to life through your tests.

## If Installed System-Wide ...

### Installation

Storyplayer should be installed via [Composer](http://getcomposer.org/). To install Storyplayer, create a `composer.json` file with the following contents:

```json
{
    "require": {
        "datasift/storyplayer": "1.3.3"
    }
}
```

Then, run `composer install`. Once that's completed, run `./vendor/bin/storyplayer install` to install any additional dependencies.

### Usage

Create a default Storyplayer config file:

```bash
mkdir ./etc && echo '{"environments":{}}' > ./etc/storyplayer.json
```

If your tests need a web browser, make sure you've started browsermob-proxy and selenium:

```
./vendor/bin/browsermob-proxy.sh start
./vendor/bin/selenium-server.sh start
```

Basic usage is:

```
./vendor/bin/storyplayer [-e <environment>] <story>
```

where:

* `<environment>` is the name of the environment that you want to run your story against (defaults to your hostname)
* `<story>` is the path to the PHP file containing your story and its test

## Running It Out Of A Git Clone

See [installing Storyplayer](http://datasift.github.io/storyplayer/installation.html).

### Building The Dependencies

If you want to run storyplayer from inside its own git repo, make sure that you have [Phix](http://phix-project.org) installed, and then do the following:

```
phing build-vendor
{'fraction_non_alphanumeric': 0.12174817898022892, 'fraction_numerical': 0.002081165452653486, 'mean_word_length': 4.215189873417722, 'pattern_counts': {'":': 6, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3032364', 'n_tokens_mistral': 877, 'n_tokens_neox': 829, 'n_words': 326}