PHPackages                             alnutile/pickle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. alnutile/pickle

ActiveLibrary

alnutile/pickle
===============

Gherkin to Dusk

v0.0.2(8y ago)352915[6 issues](https://github.com/alnutile/pickle/issues)[1 PRs](https://github.com/alnutile/pickle/pulls)MITPHPPHP ~5.6|~7.0

Since May 19Pushed 8y ago4 watchersCompare

[ Source](https://github.com/alnutile/pickle)[ Packagist](https://packagist.org/packages/alnutile/pickle)[ Docs](https://github.com/alnutile/gd)[ RSS](/packages/alnutile-pickle/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (16)Versions (3)Used By (0)

Pickle
======

[](#pickle)

[![Build Status](https://camo.githubusercontent.com/ccae591566980d57b4fc78f19e7b5721e9fbe4a4007831f5ac3462b5012baef9/68747470733a2f2f7472617669732d63692e6f72672f616c6e7574696c652f7069636b6c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alnutile/pickle)

[![Latest Version on Packagist](https://camo.githubusercontent.com/16a9b55d207ce9c698b9686f833907da85b3acfcf7906104526d8a62a0dfe583/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6e7574696c652f7069636b6c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alnutile/pickle)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/3d24b913e2e1169068a9da983f188446884b73502e5e1983ee1b254fe221e7a4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616c6e7574696c652f7069636b6c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/alnutile/pickle)[![Coverage Status](https://camo.githubusercontent.com/51ea6100ef71ab672623dd451d4842db7b5a0c2da864f8ecd07b90daefca80e3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f616c6e7574696c652f7069636b6c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/alnutile/pickle/code-structure)[![Quality Score](https://camo.githubusercontent.com/10098bb743dd2a71b1bb8a565403cfc6d62614f56b05a8c22719a3f2cb47b59d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f616c6e7574696c652f7069636b6c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/alnutile/pickle)[![Total Downloads](https://camo.githubusercontent.com/54bb938fe8ef6e45b6dac67ff39ebd95c1f2bac627e7ba9f0971279c26765b1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c6e7574696c652f7069636b6c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alnutile/pickle)

Overview
--------

[](#overview)

[![](https://camo.githubusercontent.com/ffd4334c29da73dce8740ad7681a246c59b91beeeaefb5916990f13c27aca569/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f37656b3872333437376c6c6a6162342f7069636b6c652e6a70673f646c3d30)](https://camo.githubusercontent.com/ffd4334c29da73dce8740ad7681a246c59b91beeeaefb5916990f13c27aca569/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f37656b3872333437376c6c6a6162342f7069636b6c652e6a70673f646c3d30)

Converting Gherkin file to PHPUnit Compatible and Dusk Compatible files.

This will attempt to make an easy way to work with Dusk and PHPUnit from a Gherkin formatted file.

If you are familiar with Behat then this workflow might be similar.

**[Intro Video](https://youtu.be/GmA-6hnhljI)**

**[Intro Slides](https://goo.gl/djVXhJ)**

Topics
------

[](#topics)

- [UI Example](#ui)
- [Running](#running)
- [RoadMap](#roadmap)
- [Install](#install)
- [Testing](#testing)
- [Contributing](#contributing)
- [Security](#security)
- [Credits](#credits)
- [License](#license)

### Initialize

[](#initialize)

In this example I have written a feature [1](#feature) file and now I want to turn that into my first PHPUnit compatible test.

For example I make a file `tests/features/profile.feature`

```
Feature: Test Profile Page
  Can See and Edit my profile
  As a user of the system
  So I can manage my profile

  Scenario: Edit Profile
    Given I have a profile created
    And I am in edit mode
    Then I can change the first name
    And the last name
    And and save my settings
    Then when I view my profile it will have those new settings

```

One of the key aspects I will talk about later is how I can use one file to drive two types of tests, Integration then Browser. And how the Gherkin syntax can influence how I name my classes in line with the business writing of the feature [2](#bdd).

[![](https://camo.githubusercontent.com/2c3064ed012624e45cade26770cacce8c27f70f267fe68745d972b370f10f1df/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f34346c66786464327778726f7263762f6f6e655f66696c652e706e673f646c3d30)](https://camo.githubusercontent.com/2c3064ed012624e45cade26770cacce8c27f70f267fe68745d972b370f10f1df/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f34346c66786464327778726f7263762f6f6e655f66696c652e706e673f646c3d30)

> NOTE: the above feature does not really summarize the goal in business terms it is still quite a bit focused on the web.

So at this point I can type, assuming you installed Pickle globally as I cover below:

```
pickle initialize tests/features/profile.feature

```

or for a Browser test:

```
pickle initialize --context=browser tests/features/profile.feature

```

In this case let's focus on domain context eg Integration.

Now it will make a test for me in `tests/Feature/ProfileTest.php`

and I can start working on that file which would look something like this

```
